From: Radoslaw Zarzynski Date: Mon, 10 Jan 2022 23:19:59 +0000 (+0000) Subject: common, test: move instrumented_bptr to a dedicated header. X-Git-Tag: v17.1.0~51^2~2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=a0777ce5ac367daaaf87653821f1fdd9a69ade4f;p=ceph.git common, test: move instrumented_bptr to a dedicated header. We're going to reuse it outside `test/bufferlist.cc`. Signed-off-by: Radoslaw Zarzynski --- diff --git a/src/common/buffer_instrumentation.h b/src/common/buffer_instrumentation.h new file mode 100644 index 0000000000000..65c8053239768 --- /dev/null +++ b/src/common/buffer_instrumentation.h @@ -0,0 +1,14 @@ +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab + +#include "include/buffer.h" + +namespace ceph::buffer_instrumentation { + +struct instrumented_bptr : public ceph::buffer::ptr { + const ceph::buffer::raw* get_raw() const { + return _raw; + } +}; + +} // namespace ceph::buffer_instrumentation diff --git a/src/test/bufferlist.cc b/src/test/bufferlist.cc index abd7b99b3ce60..cf182f01748ba 100644 --- a/src/test/bufferlist.cc +++ b/src/test/bufferlist.cc @@ -29,6 +29,7 @@ #include "include/utime.h" #include "include/coredumpctl.h" #include "include/encoding.h" +#include "common/buffer_instrumentation.h" #include "common/environment.h" #include "common/Clock.h" #include "common/safe_io.h" @@ -47,11 +48,7 @@ using namespace std; static char cmd[128]; -struct instrumented_bptr : public ceph::buffer::ptr { - const ceph::buffer::raw* get_raw() const { - return _raw; - } -}; +using ceph::buffer_instrumentation::instrumented_bptr; TEST(Buffer, constructors) { unsigned len = 17;