From baac49c75b246ed7d369ad79e6b5a66c7a9cb601 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Fri, 12 Nov 2021 17:50:46 +0800 Subject: [PATCH] more --- include/dnode/vnode/vnode.h | 2 +- include/util/mallocator.h | 1 + source/dnode/vnode/impl/src/vnodeMain.c | 7 ++++++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/include/dnode/vnode/vnode.h b/include/dnode/vnode/vnode.h index 51cd643caf..52470d60a9 100644 --- a/include/dnode/vnode/vnode.h +++ b/include/dnode/vnode/vnode.h @@ -45,7 +45,7 @@ SVnode *vnodeOpen(const char *path, const SVnodeOptions *pVnodeOptions); /** * @brief Close a VNODE * - * @param pVnode The vnode object + * @param pVnode The vnode object to close */ void vnodeClose(SVnode *pVnode); diff --git a/include/util/mallocator.h b/include/util/mallocator.h index 6a10a26156..fd66811f38 100644 --- a/include/util/mallocator.h +++ b/include/util/mallocator.h @@ -25,6 +25,7 @@ extern "C" { typedef struct SMemAllocator SMemAllocator; struct SMemAllocator { + char name[16]; void *impl; void *(*malloc)(SMemAllocator *, uint64_t size); void *(*calloc)(SMemAllocator *, uint64_t nmemb, uint64_t size); diff --git a/source/dnode/vnode/impl/src/vnodeMain.c b/source/dnode/vnode/impl/src/vnodeMain.c index a0c1d38ea9..c70b692c30 100644 --- a/source/dnode/vnode/impl/src/vnodeMain.c +++ b/source/dnode/vnode/impl/src/vnodeMain.c @@ -87,6 +87,11 @@ static void vnodeFree(SVnode *pVnode) { static int vnodeOpenImpl(SVnode *pVnode) { char dir[TSDB_FILENAME_LEN]; + if (vnodeOpenBufPool(pVnode) < 0) { + // TODO: handle error + return -1; + } + // Open meta sprintf(dir, "%s/meta", pVnode->path); pVnode->pMeta = metaOpen(dir, &(pVnode->options.metaOptions)); @@ -111,7 +116,7 @@ static int vnodeOpenImpl(SVnode *pVnode) { static void vnodeCloseImpl(SVnode *pVnode) { if (pVnode) { - // TODO: Close TQ + vnodeCloseBufPool(pVnode); tsdbClose(pVnode->pTsdb); metaClose(pVnode->pMeta); }