]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common, test: move instrumented_bptr to a dedicated header.
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Mon, 10 Jan 2022 23:19:59 +0000 (23:19 +0000)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Wed, 12 Jan 2022 20:35:50 +0000 (20:35 +0000)
We're going to reuse it outside `test/bufferlist.cc`.

Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/common/buffer_instrumentation.h [new file with mode: 0644]
src/test/bufferlist.cc

diff --git a/src/common/buffer_instrumentation.h b/src/common/buffer_instrumentation.h
new file mode 100644 (file)
index 0000000..65c8053
--- /dev/null
@@ -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
index abd7b99b3ce600b64820b155d640aebcc0b99472..cf182f01748ba02f5e311e4721c247167bc166ea 100644 (file)
@@ -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;