From 694d8aa9c9679a53cdee1bef1c3032bcbe86ddba Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Tue, 9 Nov 2021 11:45:01 +0800 Subject: [PATCH] more --- source/dnode/vnode/impl/inc/vnodeDef.h | 3 ++- source/dnode/vnode/impl/inc/vnodeSync.h | 27 ++++++++++++++++++++++++ source/dnode/vnode/impl/src/vnodeSync.c | 14 ++++++++++++ source/dnode/vnode/impl/src/vnodeWrite.c | 2 ++ 4 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 source/dnode/vnode/impl/inc/vnodeSync.h create mode 100644 source/dnode/vnode/impl/src/vnodeSync.c diff --git a/source/dnode/vnode/impl/inc/vnodeDef.h b/source/dnode/vnode/impl/inc/vnodeDef.h index 62b8ea0b3a..3443c072d7 100644 --- a/source/dnode/vnode/impl/inc/vnodeDef.h +++ b/source/dnode/vnode/impl/inc/vnodeDef.h @@ -17,11 +17,12 @@ #define _TD_VNODE_DEF_H_ #include "mallocator.h" +#include "sync.h" #include "vnode.h" #include "vnodeAllocatorPool.h" +#include "vnodeCommit.h" #include "vnodeOptions.h" #include "vnodeStateMgr.h" -#include "vnodeCommit.h" #ifdef __cplusplus extern "C" { diff --git a/source/dnode/vnode/impl/inc/vnodeSync.h b/source/dnode/vnode/impl/inc/vnodeSync.h new file mode 100644 index 0000000000..7831c8ca80 --- /dev/null +++ b/source/dnode/vnode/impl/inc/vnodeSync.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2019 TAOS Data, Inc. + * + * This program is free software: you can use, redistribute, and/or modify + * it under the terms of the GNU Affero General Public License, version 3 + * or later ("AGPL"), as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#ifndef _TD_VNODE_SYNC_H_ +#define _TD_VNODE_SYNC_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} +#endif + +#endif /*_TD_VNODE_SYNC_H_*/ \ No newline at end of file diff --git a/source/dnode/vnode/impl/src/vnodeSync.c b/source/dnode/vnode/impl/src/vnodeSync.c new file mode 100644 index 0000000000..6dea4a4e57 --- /dev/null +++ b/source/dnode/vnode/impl/src/vnodeSync.c @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2019 TAOS Data, Inc. + * + * This program is free software: you can use, redistribute, and/or modify + * it under the terms of the GNU Affero General Public License, version 3 + * or later ("AGPL"), as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ \ No newline at end of file diff --git a/source/dnode/vnode/impl/src/vnodeWrite.c b/source/dnode/vnode/impl/src/vnodeWrite.c index 3126633411..764f034810 100644 --- a/source/dnode/vnode/impl/src/vnodeWrite.c +++ b/source/dnode/vnode/impl/src/vnodeWrite.c @@ -31,6 +31,8 @@ int vnodeApplyWriteRequest(SVnode *pVnode, const SRequest *pRequest) { // TODO: handle error } + memcpy(pReq, pRequest, reqSize); + // Push the request to TQ so consumers can consume tqPushMsg(pVnode->pTq, pReq, 0); -- GitLab