]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/filestore: implement get_devices() 18453/head
authorSage Weil <sage@redhat.com>
Tue, 31 Oct 2017 17:30:28 +0000 (12:30 -0500)
committerSage Weil <sage@redhat.com>
Tue, 31 Oct 2017 17:30:44 +0000 (12:30 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/os/filestore/FileStore.cc
src/os/filestore/FileStore.h

index c91a74e43be84e09ba02476c06e77dbe3d119e82..35e99d667638a06da8bd1f4900809e225ad583d3 100644 (file)
@@ -708,6 +708,21 @@ void FileStore::collect_metadata(map<string,string> *pm)
   }
 }
 
+int FileStore::get_devices(set<string> *ls)
+{
+  char partition_path[PATH_MAX];
+  char dev_node[PATH_MAX];
+  int rc = 0;
+  rc = get_device_by_fd(fsid_fd, partition_path, dev_node, PATH_MAX);
+  if (rc == 0) {
+    ls->insert(dev_node);
+    if (strncmp(dev_node, "dm-", 3) == 0) {
+      get_dm_parents(dev_node, ls);
+    }
+  }
+  return 0;
+}
+
 int FileStore::statfs(struct store_statfs_t *buf0)
 {
   struct statfs buf;
index f7d4278e3ccd3082c3173220dc958128f9ef9a7f..a7c5b0ab3ee6212840019594873d7324fe0f5dce 100644 (file)
@@ -502,6 +502,7 @@ public:
   }
 
   void collect_metadata(map<string,string> *pm) override;
+  int get_devices(set<string> *ls) override;
 
   int statfs(struct store_statfs_t *buf) override;