]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: implement collect_metadata for BlueStore, BlueFS
authorSage Weil <sage@redhat.com>
Fri, 24 Mar 2017 00:41:53 +0000 (19:41 -0500)
committerSage Weil <sage@redhat.com>
Wed, 29 Mar 2017 17:24:00 +0000 (13:24 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/os/bluestore/BlueFS.cc
src/os/bluestore/BlueFS.h
src/os/bluestore/BlueStore.cc
src/os/bluestore/BlueStore.h

index 3f7fa0f2a0ce5d1595f90829db4b02a7a492cb71..4ca20860a76ff45c9347c43c125e8b8eed0e428f 100644 (file)
@@ -434,6 +434,16 @@ void BlueFS::umount()
   _shutdown_logger();
 }
 
+void BlueFS::collect_metadata(map<string,string> *pm)
+{
+  if (bdev[BDEV_DB])
+    bdev[BDEV_DB]->collect_metadata("bluefs_db_", pm);
+  if (bdev[BDEV_WAL])
+    bdev[BDEV_WAL]->collect_metadata("bluefs_wal_", pm);
+  if (bdev[BDEV_SLOW])
+    bdev[BDEV_SLOW]->collect_metadata("bluefs_slow_", pm);
+}
+
 int BlueFS::fsck()
 {
   std::lock_guard<std::mutex> l(lock);
index 28720cbb388ec31eb4b68cf708e0f2475f9e9a4a..030cf1709d2038c5fad87f6a9f8e8f536a70bbd3 100644 (file)
@@ -332,6 +332,7 @@ public:
   int mount();
   void umount();
 
+  void collect_metadata(map<string,string> *pm);
   int fsck();
 
   uint64_t get_fs_usage();
index 11c2147d22fb7d41037252c04db460bd1ae5d5dd..bf58c77ec6edd7c13b3a1dad1704a2bfd3a1abf9 100644 (file)
@@ -5434,6 +5434,19 @@ int BlueStore::fsck(bool deep)
   return errors;
 }
 
+void BlueStore::collect_metadata(map<string,string> *pm)
+{
+  dout(10) << __func__ << dendl;
+  bdev->collect_metadata("bluestore_bdev_", pm);
+  if (bluefs) {
+    (*pm)["bluefs"] = "1";
+    (*pm)["bluefs_single_shared_device"] = stringify((int)bluefs_single_shared_device);
+    bluefs->collect_metadata(pm);
+  } else {
+    (*pm)["bluefs"] = "0";
+  }
+}
+
 int BlueStore::statfs(struct store_statfs_t *buf)
 {
   buf->reset();
index fca4e20f2a42d8bb18585e63a92c4d986dc7f942..86cd05b4c31f33cae02c49441974dc050a11ff4a 100644 (file)
@@ -2031,6 +2031,8 @@ public:
 public:
   int statfs(struct store_statfs_t *buf) override;
 
+  void collect_metadata(map<string,string> *pm) override;
+
   bool exists(const coll_t& cid, const ghobject_t& oid) override;
   bool exists(CollectionHandle &c, const ghobject_t& oid) override;
   int set_collection_opts(