From aaa1c1ccbbcde2e9534773590f1b29a78276cf0b Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Thu, 19 Nov 2020 11:02:32 +0000 Subject: [PATCH] refactor --- src/inc/tfs.h | 10 ++++++++++ src/tfs/inc/tdisk.h | 5 ----- src/tsdb/inc/tsdbMain.h | 7 ++++--- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/inc/tfs.h b/src/inc/tfs.h index 3c0ae1ed75..c02dc2bb0f 100644 --- a/src/inc/tfs.h +++ b/src/inc/tfs.h @@ -22,6 +22,16 @@ extern "C" { #endif +typedef struct { + int level; + int id; +} SDiskID; + +typedef struct { + SDiskID did; + char fname[TSDB_FILENAME_LEN]; +} STfsFile; + int tfsInit(SDiskCfg *pDiskCfg, int ndisk); void tfsDestroy(); int tfsUpdateInfo(); diff --git a/src/tfs/inc/tdisk.h b/src/tfs/inc/tdisk.h index 532dc6a39f..f15512355d 100644 --- a/src/tfs/inc/tdisk.h +++ b/src/tfs/inc/tdisk.h @@ -20,11 +20,6 @@ extern "C" { #endif -typedef struct { - int level; - int id; -} SDiskID; - typedef struct { uint64_t size; uint64_t free; diff --git a/src/tsdb/inc/tsdbMain.h b/src/tsdb/inc/tsdbMain.h index cb21108e9d..fce5fb1eaf 100644 --- a/src/tsdb/inc/tsdbMain.h +++ b/src/tsdb/inc/tsdbMain.h @@ -26,7 +26,7 @@ #include "tsdb.h" #include "tskiplist.h" #include "tutil.h" -#include "tmount.h" +#include "tfs.h" #ifdef __cplusplus extern "C" { @@ -189,9 +189,10 @@ typedef struct { } STsdbFileInfo; typedef struct { - char fname[TSDB_FILENAME_LEN]; - int fd; + // char fname[TSDB_FILENAME_LEN]; + // int fd; + STfsFile tfile; STsdbFileInfo info; } SFile; -- GitLab