From 8f2c2bff30fbf17c8bc654aa2574ed29b07cdd98 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 7 Apr 2015 15:22:09 -0700 Subject: [PATCH] os/newstore: use fs abstaction layer Signed-off-by: Sage Weil --- src/os/newstore/NewStore.cc | 6 ++++++ src/os/newstore/NewStore.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/os/newstore/NewStore.cc b/src/os/newstore/NewStore.cc index c226f81a87d3..d32cb987bba7 100644 --- a/src/os/newstore/NewStore.cc +++ b/src/os/newstore/NewStore.cc @@ -569,6 +569,7 @@ NewStore::NewStore(CephContext *cct, const string& path) : ObjectStore(path), cct(cct), db(NULL), + fs(NULL), path_fd(-1), fsid_fd(-1), frag_fd(-1), @@ -633,6 +634,9 @@ int NewStore::_open_path() << dendl; return r; } + assert(fs == NULL); + fs = FS::create(path_fd); + dout(1) << __func__ << " using fs driver '" << fs->get_name() << "'" << dendl; return 0; } @@ -640,6 +644,8 @@ void NewStore::_close_path() { VOID_TEMP_FAILURE_RETRY(::close(path_fd)); path_fd = -1; + delete fs; + fs = NULL; } int NewStore::_open_frag() diff --git a/src/os/newstore/NewStore.h b/src/os/newstore/NewStore.h index eb548ecb75e2..98eef602d567 100644 --- a/src/os/newstore/NewStore.h +++ b/src/os/newstore/NewStore.h @@ -24,6 +24,7 @@ #include "common/RWLock.h" #include "common/WorkQueue.h" #include "os/ObjectStore.h" +#include "os/fs/FS.h" #include "os/KeyValueDB.h" #include "newstore_types.h" @@ -364,6 +365,7 @@ public: private: CephContext *cct; KeyValueDB *db; + FS *fs; uuid_d fsid; int path_fd; ///< open handle to $path int fsid_fd; ///< open handle (locked) to $path/fsid -- 2.47.3