From 04b47939b84f388c3a8c0b09077fe56b27d2f9f2 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 10 Apr 2018 13:00:42 -0500 Subject: [PATCH] os/bluestore: factor VDO into bluestore's 'allocated' value If we are on VDO, report the *raw* storage we've allocated, as reported by VDO. Signed-off-by: Sage Weil --- src/os/bluestore/BlueStore.cc | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index c4fb44aff06..14498391906 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -7114,6 +7114,15 @@ int BlueStore::statfs(struct store_statfs_t *buf) } } + { + std::lock_guard l(vstatfs_lock); + buf->allocated = vstatfs.allocated(); + buf->data_stored = vstatfs.stored(); + buf->data_compressed = vstatfs.compressed(); + buf->data_compressed_original = vstatfs.compressed_original(); + buf->data_compressed_allocated = vstatfs.compressed_allocated(); + } + uint64_t thin_total, thin_avail; if (bdev->get_thin_utilization(&thin_total, &thin_avail)) { buf->total += thin_total; @@ -7121,6 +7130,8 @@ int BlueStore::statfs(struct store_statfs_t *buf) // we are limited by both the size of the virtual device and the // underlying physical device. bfree = std::min(bfree, thin_avail); + + buf->allocated = thin_total - thin_avail; } else { buf->total = bdev->get_size(); } @@ -7138,15 +7149,6 @@ int BlueStore::statfs(struct store_statfs_t *buf) - buf->omap_allocated; } - { - std::lock_guard l(vstatfs_lock); - buf->allocated = vstatfs.allocated(); - buf->data_stored = vstatfs.stored(); - buf->data_compressed = vstatfs.compressed(); - buf->data_compressed_original = vstatfs.compressed_original(); - buf->data_compressed_allocated = vstatfs.compressed_allocated(); - } - dout(20) << __func__ << " " << *buf << dendl; return 0; }