]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
common: hint bufferlist's buffer_track_c_str accordingly.
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Sun, 14 Oct 2018 12:56:50 +0000 (14:56 +0200)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Thu, 6 Dec 2018 14:40:03 +0000 (15:40 +0100)
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/common/buffer.cc

index b1c533ed3100fb2b08891bd1e4e7bf98c523c887..f48f865028a17526b778baeadb26b5eb604d830b 100644 (file)
@@ -676,25 +676,25 @@ using namespace ceph;
 
   const char *buffer::ptr::c_str() const {
     ceph_assert(_raw);
-    if (buffer_track_c_str)
+    if (unlikely(buffer_track_c_str))
       buffer_c_str_accesses++;
     return _raw->get_data() + _off;
   }
   char *buffer::ptr::c_str() {
     ceph_assert(_raw);
-    if (buffer_track_c_str)
+    if (unlikely(buffer_track_c_str))
       buffer_c_str_accesses++;
     return _raw->get_data() + _off;
   }
   const char *buffer::ptr::end_c_str() const {
     ceph_assert(_raw);
-    if (buffer_track_c_str)
+    if (unlikely(buffer_track_c_str))
       buffer_c_str_accesses++;
     return _raw->get_data() + _off + _len;
   }
   char *buffer::ptr::end_c_str() {
     ceph_assert(_raw);
-    if (buffer_track_c_str)
+    if (unlikely(buffer_track_c_str))
       buffer_c_str_accesses++;
     return _raw->get_data() + _off + _len;
   }