]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: factor VDO into bluestore's 'allocated' value 28852/head
authorSage Weil <sage@redhat.com>
Tue, 10 Apr 2018 18:00:42 +0000 (13:00 -0500)
committerJosh Durgin <jdurgin@redhat.com>
Wed, 3 Jul 2019 00:12:02 +0000 (20:12 -0400)
If we are on VDO, report the *raw* storage we've allocated, as reported
by VDO.

Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 04b47939b84f388c3a8c0b09077fe56b27d2f9f2)

src/os/bluestore/BlueStore.cc

index 3b1b8145b05d63ee68a6582f43ce2feec291c9f2..56dc432afe51b7ac667411359492e73fe4e88fe4 100644 (file)
@@ -7170,6 +7170,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;
@@ -7177,6 +7186,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();
   }
@@ -7194,15 +7205,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;
 }