]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: report omap and internal metadata usage
authorSage Weil <sage@redhat.com>
Tue, 3 Oct 2017 03:28:13 +0000 (22:28 -0500)
committerJosh Durgin <jdurgin@redhat.com>
Wed, 3 Jul 2019 00:11:54 +0000 (20:11 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit fc5561ed6e1d44cda83a7c31d27f7392ee2e18ee)

src/os/bluestore/BlueStore.cc

index 23b488762d18a6804d8d6f0d00dfd9ec2cd9994d..3b1b8145b05d63ee68a6582f43ce2feec291c9f2 100644 (file)
@@ -6220,6 +6220,8 @@ int BlueStore::_fsck(bool deep, bool repair)
   statfs(&actual_statfs);
   expected_statfs.total = actual_statfs.total;
   expected_statfs.available = actual_statfs.available;
+  expected_statfs.internal_metadata = actual_statfs.internal_metadata;
+  expected_statfs.omap_allocated = actual_statfs.omap_allocated;
 
   // walk PREFIX_OBJ
   dout(1) << __func__ << " walking object keyspace" << dendl;
@@ -7153,7 +7155,10 @@ int BlueStore::statfs(struct store_statfs_t *buf)
 {
   buf->reset();
 
+  buf->omap_allocated = db->estimate_prefix_size(PREFIX_OMAP);
+
   uint64_t bfree = alloc->get_free();
+
   if (bluefs) {
     // part of our shared device is "free" according to BlueFS, but we
     // can't touch bluestore_bluefs_min of it.
@@ -7182,6 +7187,11 @@ int BlueStore::statfs(struct store_statfs_t *buf)
     if (bluefs_shared_bdev != BlueFS::BDEV_DB) {
       buf->total += bluefs->get_total(BlueFS::BDEV_DB);
     }
+
+    // call any non-omap bluefs space "internal metadata"
+    buf->internal_metadata =
+      std::max(bluefs->get_used(), (uint64_t)cct->_conf->bluestore_bluefs_min)
+      - buf->omap_allocated;
   }
 
   {