From: Radoslaw Zarzynski Date: Sun, 14 Oct 2018 12:56:50 +0000 (+0200) Subject: common: hint bufferlist's buffer_track_c_str accordingly. X-Git-Tag: v14.1.0~676^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3e1593e2fbf3bb3db13609268dc88eda3ae47432;p=ceph.git common: hint bufferlist's buffer_track_c_str accordingly. Signed-off-by: Radoslaw Zarzynski --- diff --git a/src/common/buffer.cc b/src/common/buffer.cc index b1c533ed3100..f48f865028a1 100644 --- a/src/common/buffer.cc +++ b/src/common/buffer.cc @@ -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; }