]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
kv/MemDB: fill in statfs directly
authorxie xingguo <xie.xingguo@zte.com.cn>
Sat, 23 Jul 2016 00:57:51 +0000 (08:57 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Sat, 23 Jul 2016 00:57:51 +0000 (08:57 +0800)
Which is faster.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/kv/MemDB.h

index 273a78dda5da4e379684ba58c8f79145715f5b98..ab7726bbb8eb9d46add37773966d647acd6f6736 100644 (file)
@@ -172,14 +172,10 @@ public:
 
   int get_statfs(struct store_statfs_t *buf) {
     std::lock_guard<std::mutex> l(m_lock);
-    store_statfs_t s;
-    s.total = m_total_bytes;
-    s.allocated = m_allocated_bytes;
-    s.stored = m_total_bytes;
-    s.compressed = 0;
-    s.compressed_allocated = 0;
-    s.compressed_original = 0;
-    *buf = s;
+    buf->reset();
+    buf->total = m_total_bytes;
+    buf->allocated = m_allocated_bytes;
+    buf->stored = m_total_bytes;
     return 0;
   }