diff --git a/source/dnode/vnode/src/tsdb/tsdbFS2.c b/source/dnode/vnode/src/tsdb/tsdbFS2.c index 13a88d10118357685b1a15d412741573e45e9893..ff38d4cc001bea0ca34f2dbd4e2501b962bbf249 100644 --- a/source/dnode/vnode/src/tsdb/tsdbFS2.c +++ b/source/dnode/vnode/src/tsdb/tsdbFS2.c @@ -15,6 +15,7 @@ #include "tsdbFS2.h" #include "tsdbUpgrade.h" +#include "vnd.h" extern int vnodeScheduleTask(int (*execute)(void *), void *arg); extern int vnodeScheduleTaskEx(int tpid, int (*execute)(void *), void *arg); @@ -69,23 +70,12 @@ static int32_t destroy_fs(STFileSystem **fs) { } int32_t current_fname(STsdb *pTsdb, char *fname, EFCurrentT ftype) { - if (pTsdb->pVnode->pTfs) { - snprintf(fname, // - TSDB_FILENAME_LEN, // - "%s%s%s%s%s", // - tfsGetPrimaryPath(pTsdb->pVnode->pTfs), // - TD_DIRSEP, // - pTsdb->path, // - TD_DIRSEP, // - gCurrentFname[ftype]); - } else { - snprintf(fname, // - TSDB_FILENAME_LEN, // - "%s%s%s", // - pTsdb->path, // - TD_DIRSEP, // - gCurrentFname[ftype]); - } + int32_t offset = 0; + + vnodeGetPrimaryDir(pTsdb->path, pTsdb->pVnode->pTfs, fname, TSDB_FILENAME_LEN); + offset = strlen(fname); + snprintf(fname + offset, TSDB_FILENAME_LEN - offset - 1, "%s%s", TD_DIRSEP, gCurrentFname[ftype]); + return 0; } @@ -892,4 +882,4 @@ int32_t tsdbFSEnableBgTask(STFileSystem *fs) { fs->stop = false; taosThreadMutexUnlock(fs->mutex); return 0; -} \ No newline at end of file +}