]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
os/bluestore/BlueStore: using buffprt::zero rather than memset.
authorJianpeng Ma <jianpeng.ma@intel.com>
Thu, 13 Jul 2017 16:23:06 +0000 (00:23 +0800)
committerJianpeng Ma <jianpeng.ma@intel.com>
Thu, 13 Jul 2017 16:23:06 +0000 (00:23 +0800)
Just for the code to look consistent

Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
src/os/bluestore/BlueStore.cc

index a123bfd3516da0ebbfd400e6912a1f770a4d3b62..b52d5ce3e1bcd7028e36769b88d1ae3e14e8f868 100644 (file)
@@ -9287,12 +9287,12 @@ void BlueStore::_pad_zeros(
   if (front_pad) {
     size_t front_copy = MIN(chunk_size - front_pad, length);
     bufferptr z = buffer::create_page_aligned(chunk_size);
-    memset(z.c_str(), 0, front_pad);
+    z.zero(0, front_pad, false);
     pad_count += front_pad;
     bl->copy(0, front_copy, z.c_str() + front_pad);
     if (front_copy + front_pad < chunk_size) {
       back_pad = chunk_size - (length + front_pad);
-      memset(z.c_str() + front_pad + length, 0, back_pad);
+      z.zero(front_pad + length, back_pad, false);
       pad_count += back_pad;
     }
     bufferlist old, t;
@@ -9313,7 +9313,7 @@ void BlueStore::_pad_zeros(
     assert(back_copy <= length);
     bufferptr tail(chunk_size);
     bl->copy(length - back_copy, back_copy, tail.c_str());
-    memset(tail.c_str() + back_copy, 0, back_pad);
+    tail.zero(back_copy, back_pad, false);
     bufferlist old;
     old.swap(*bl);
     bl->substr_of(old, 0, length - back_copy);