]> 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>
Tue, 2 Jul 2019 04:33:22 +0000 (00:33 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit fc5561ed6e1d44cda83a7c31d27f7392ee2e18ee)

Conflicts:
src/os/bluestore/BlueStore.cc

trivial resolution

src/os/bluestore/BlueStore.cc

index 74b362ecdafc68e5151bffec59ba096e87acbe56..2ac49ecd3427370c702eaf45078880c86d7b61d8 100644 (file)
@@ -5902,6 +5902,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;
@@ -6436,6 +6438,8 @@ int BlueStore::statfs(struct store_statfs_t *buf)
   buf->total = bdev->get_size();
   buf->available = alloc->get_free();
 
+  buf->omap_allocated = db->estimate_prefix_size(PREFIX_OMAP);
+
   if (bluefs) {
     // part of our shared device is "free" according to BlueFS, but we
     // can't touch bluestore_bluefs_min of it.
@@ -6445,6 +6449,11 @@ int BlueStore::statfs(struct store_statfs_t *buf)
     if (shared_available > 0) {
       buf->available += shared_available;
     }
+
+    // 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;
   }
 
   {