From: Sage Weil Date: Tue, 10 Apr 2018 18:00:42 +0000 (-0500) Subject: os/bluestore: factor VDO into bluestore's 'allocated' value X-Git-Tag: v14.0.1~569^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=04b47939b84f388c3a8c0b09077fe56b27d2f9f2;p=ceph.git 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 --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index c4fb44aff069b..14498391906f0 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; }