]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: factor VDO into bluestore's 'allocated' value 18096/head
authorSage Weil <sage@redhat.com>
Tue, 10 Apr 2018 18:00:42 +0000 (13:00 -0500)
committerSage Weil <sage@redhat.com>
Wed, 15 Aug 2018 22:18:44 +0000 (17:18 -0500)
If we are on VDO, report the *raw* storage we've allocated, as reported
by VDO.

Signed-off-by: Sage Weil <sage@redhat.com>
src/os/bluestore/BlueStore.cc

index c4fb44aff069bb0961f5fce9d6d1db3df59cdc2e..14498391906f005a923374e182cde07bef9cd3ae 100644 (file)
@@ -7114,6 +7114,15 @@ int BlueStore::statfs(struct store_statfs_t *buf)
     }
   }
 
+  {
+    std::lock_guard<std::mutex> 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<std::mutex> 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;
 }