]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/newstore: use fs abstaction layer
authorSage Weil <sage@redhat.com>
Tue, 7 Apr 2015 22:22:09 +0000 (15:22 -0700)
committerSage Weil <sage@redhat.com>
Tue, 1 Sep 2015 17:39:36 +0000 (13:39 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/os/newstore/NewStore.cc
src/os/newstore/NewStore.h

index c226f81a87d3d5ee5bb4e29fdccd936cd776f75d..d32cb987bba77b601c6f3a1ac646d1f219275868 100644 (file)
@@ -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()
index eb548ecb75e22d605e8a9df4054feafff8abdfa0..98eef602d567ab64126b7bff8db3da28285dff4c 100644 (file)
@@ -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