enh: add tsdbFSCreateRefSnapshotWithoutLock
This commit is contained in:
parent
f2bd43c07e
commit
5c85525fd0
|
@ -961,6 +961,13 @@ int32_t tsdbFSDestroyCopySnapshot(TFileSetArray **fsetArr) {
|
|||
}
|
||||
|
||||
int32_t tsdbFSCreateRefSnapshot(STFileSystem *fs, TFileSetArray **fsetArr) {
|
||||
taosThreadRwlockRdlock(&fs->tsdb->rwLock);
|
||||
int32_t code = tsdbFSCreateRefSnapshotWithoutLock(fs, fsetArr);
|
||||
taosThreadRwlockUnlock(&fs->tsdb->rwLock);
|
||||
return code;
|
||||
}
|
||||
|
||||
int32_t tsdbFSCreateRefSnapshotWithoutLock(STFileSystem *fs, TFileSetArray **fsetArr) {
|
||||
int32_t code = 0;
|
||||
STFileSet *fset, *fset1;
|
||||
|
||||
|
|
|
@ -52,6 +52,7 @@ int32_t tsdbCloseFS(STFileSystem **fs);
|
|||
int32_t tsdbFSCreateCopySnapshot(STFileSystem *fs, TFileSetArray **fsetArr);
|
||||
int32_t tsdbFSDestroyCopySnapshot(TFileSetArray **fsetArr);
|
||||
int32_t tsdbFSCreateRefSnapshot(STFileSystem *fs, TFileSetArray **fsetArr);
|
||||
int32_t tsdbFSCreateRefSnapshotWithoutLock(STFileSystem *fs, TFileSetArray **fsetArr);
|
||||
int32_t tsdbFSDestroyRefSnapshot(TFileSetArray **fsetArr);
|
||||
|
||||
int32_t tsdbFSCreateCopyRangedSnapshot(STFileSystem *fs, TSnapRangeArray *pExclude, TFileSetArray **fsetArr,
|
||||
|
|
|
@ -4947,7 +4947,7 @@ int32_t tsdbTakeReadSnap2(STsdbReader* pReader, _query_reseek_func_t reseek, STs
|
|||
}
|
||||
|
||||
// fs
|
||||
code = tsdbFSCreateRefSnapshot(pTsdb->pFS, &pSnap->pfSetArray);
|
||||
code = tsdbFSCreateRefSnapshotWithoutLock(pTsdb->pFS, &pSnap->pfSetArray);
|
||||
|
||||
// unlock
|
||||
taosThreadRwlockUnlock(&pTsdb->rwLock);
|
||||
|
|
Loading…
Reference in New Issue