From: Sage Weil Date: Tue, 3 Oct 2017 03:28:13 +0000 (-0500) Subject: os/bluestore: report omap and internal metadata usage X-Git-Tag: v14.0.1~569^2~4 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=fc5561ed6e1d44cda83a7c31d27f7392ee2e18ee;p=ceph.git os/bluestore: report omap and internal metadata usage Signed-off-by: Sage Weil --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index fe3f0911ff2ef..c4fb44aff069b 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -6175,6 +6175,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; @@ -7097,7 +7099,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. @@ -7126,6 +7131,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; } {