]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/os/seastore/lba_manager/btree: move BtreeLBAPin to btree_range_pin.h
authorSamuel Just <sjust@redhat.com>
Tue, 7 Jul 2020 18:38:53 +0000 (11:38 -0700)
committerSamuel Just <sjust@redhat.com>
Tue, 4 Aug 2020 16:19:54 +0000 (09:19 -0700)
Signed-off-by: Samuel Just <sjust@redhat.com>
src/crimson/os/seastore/lba_manager/btree/btree_range_pin.h [new file with mode: 0644]
src/crimson/os/seastore/lba_manager/btree/lba_btree_node_impl.h

diff --git a/src/crimson/os/seastore/lba_manager/btree/btree_range_pin.h b/src/crimson/os/seastore/lba_manager/btree/btree_range_pin.h
new file mode 100644 (file)
index 0000000..0c9a5fd
--- /dev/null
@@ -0,0 +1,49 @@
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
+
+#pragma once
+
+#include "crimson/os/seastore/cached_extent.h"
+#include "crimson/os/seastore/seastore_types.h"
+
+namespace crimson::os::seastore::lba_manager::btree {
+
+/* BtreeLBAPin
+ *
+ * References leaf node
+ *
+ * TODO: does not at this time actually keep the relevant
+ * leaf resident in memory.  This is actually a bit tricky
+ * as we can mutate and therefore replace a leaf referenced
+ * by other, uninvolved but cached extents.  Will need to
+ * come up with some kind of pinning mechanism that handles
+ * that well.
+ */
+struct BtreeLBAPin : LBAPin {
+  paddr_t paddr;
+  laddr_t laddr = L_ADDR_NULL;
+  extent_len_t length = 0;
+  unsigned refcount = 0;
+
+public:
+  BtreeLBAPin(
+    paddr_t paddr,
+    laddr_t laddr,
+    extent_len_t length)
+    : paddr(paddr), laddr(laddr), length(length) {}
+
+  extent_len_t get_length() const final {
+    return length;
+  }
+  paddr_t get_paddr() const final {
+    return paddr;
+  }
+  laddr_t get_laddr() const final {
+    return laddr;
+  }
+  LBAPinRef duplicate() const final {
+    return LBAPinRef(new BtreeLBAPin(*this));
+  }
+};
+
+}
index 716ce458eeeb5531d4afbe307f0f00711774d8a3..73cc452dedf3563a9b98a97bd99c5b2194253fb3 100644 (file)
@@ -18,6 +18,7 @@
 #include "crimson/os/seastore/cache.h"
 #include "crimson/os/seastore/cached_extent.h"
 #include "crimson/os/seastore/lba_manager/btree/lba_btree_node.h"
+#include "crimson/os/seastore/lba_manager/btree/btree_range_pin.h"
 
 namespace crimson::os::seastore::lba_manager::btree {
 
@@ -431,42 +432,4 @@ struct LBALeafNode
 };
 using LBALeafNodeRef = TCachedExtentRef<LBALeafNode>;
 
-/* BtreeLBAPin
- *
- * References leaf node
- *
- * TODO: does not at this time actually keep the relevant
- * leaf resident in memory.  This is actually a bit tricky
- * as we can mutate and therefore replace a leaf referenced
- * by other, uninvolved but cached extents.  Will need to
- * come up with some kind of pinning mechanism that handles
- * that well.
- */
-struct BtreeLBAPin : LBAPin {
-  paddr_t paddr;
-  laddr_t laddr = L_ADDR_NULL;
-  extent_len_t length = 0;
-  unsigned refcount = 0;
-
-public:
-  BtreeLBAPin(
-    paddr_t paddr,
-    laddr_t laddr,
-    extent_len_t length)
-    : paddr(paddr), laddr(laddr), length(length) {}
-
-  extent_len_t get_length() const final {
-    return length;
-  }
-  paddr_t get_paddr() const final {
-    return paddr;
-  }
-  laddr_t get_laddr() const final {
-    return laddr;
-  }
-  LBAPinRef duplicate() const final {
-    return LBAPinRef(new BtreeLBAPin(*this));
-  }
-};
-
 }