From: Sage Weil Date: Tue, 7 Apr 2015 22:22:09 +0000 (-0700) Subject: os/newstore: use fs abstaction layer X-Git-Tag: v9.1.0~242^2~85 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8f2c2bff30fbf17c8bc654aa2574ed29b07cdd98;p=ceph.git os/newstore: use fs abstaction layer Signed-off-by: Sage Weil --- 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