From: Sage Weil Date: Fri, 26 May 2017 03:09:11 +0000 (-0400) Subject: buffer: make wasted() const X-Git-Tag: v12.1.0~87^2~1^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=cf98e9d5bf8bb45649ceea165de397604634da67;p=ceph.git buffer: make wasted() const Remove useless assert (we'll segv on the next line anyway). Signed-off-by: Sage Weil --- diff --git a/src/common/buffer.cc b/src/common/buffer.cc index 5d8dcf5c27d..50f08f1e5ca 100644 --- a/src/common/buffer.cc +++ b/src/common/buffer.cc @@ -952,9 +952,8 @@ static std::atomic_flag buffer_debug_lock = ATOMIC_FLAG_INIT; maybe_inline_memcpy(dest, src, l, 8); } - unsigned buffer::ptr::wasted() + unsigned buffer::ptr::wasted() const { - assert(_raw); return _raw->len - _len; } diff --git a/src/include/buffer.h b/src/include/buffer.h index 177e95f8a87..2665366c514 100644 --- a/src/include/buffer.h +++ b/src/include/buffer.h @@ -310,7 +310,7 @@ namespace buffer CEPH_BUFFER_API { bool can_zero_copy() const; int zero_copy_to_fd(int fd, int64_t *offset) const; - unsigned wasted(); + unsigned wasted() const; int cmp(const ptr& o) const; bool is_zero() const;