From 3e1593e2fbf3bb3db13609268dc88eda3ae47432 Mon Sep 17 00:00:00 2001 From: Radoslaw Zarzynski Date: Sun, 14 Oct 2018 14:56:50 +0200 Subject: [PATCH] common: hint bufferlist's buffer_track_c_str accordingly. Signed-off-by: Radoslaw Zarzynski --- src/common/buffer.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/common/buffer.cc b/src/common/buffer.cc index b1c533ed3100f..f48f865028a17 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; } -- 2.39.5