]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/crimson/os/seastore/onode_manager/staged-fltree/node_types.h
import quincy beta 17.1.0
[ceph.git] / ceph / src / crimson / os / seastore / onode_manager / staged-fltree / node_types.h
index 6774544c717d24fcb71a3596ce89842dc4037c17..c5ee76b71bca8ec408db03240ee839d4e63ebe6a 100644 (file)
@@ -61,4 +61,51 @@ constexpr match_stat_t MSTAT_LT3 =  3; // key < index [pool/shard]
 constexpr match_stat_t MSTAT_MIN = MSTAT_END;
 constexpr match_stat_t MSTAT_MAX = MSTAT_LT3;
 
+enum class node_delta_op_t : uint8_t {
+  INSERT,
+  SPLIT,
+  SPLIT_INSERT,
+  UPDATE_CHILD_ADDR,
+  ERASE,
+  MAKE_TAIL,
+  SUBOP_UPDATE_VALUE = 0xff,
+};
+
+/** nextent_state_t
+ *
+ * The possible states of tree node extent(NodeExtentAccessorT).
+ *
+ * State transition implies the following capabilities is changed:
+ * - mutability is changed;
+ * - whether to record;
+ * - memory has been copied;
+ *
+ * load()----+
+ *           |
+ * alloc()   v
+ *  |        +--> [READ_ONLY] ---------+
+ *  |        |         |               |
+ *  |        |   prepare_mutate()      |
+ *  |        |         |               |
+ *  |        v         v               v
+ *  |        +--> [MUTATION_PENDING]---+
+ *  |        |                         |
+ *  |        |                     rebuild()
+ *  |        |                         |
+ *  |        v                         v
+ *  +------->+--> [FRESH] <------------+
+ *
+ * Note that NodeExtentAccessorT might still be MUTATION_PENDING/FRESH while
+ * the internal extent has become DIRTY after the transaction submission is
+ * started while nodes destruction and validation has not been completed yet.
+ */
+enum class nextent_state_t : uint8_t {
+  READ_ONLY = 0,       // requires mutate for recording
+                       //   CLEAN/DIRTY
+  MUTATION_PENDING,    // can mutate, needs recording
+                       //   MUTATION_PENDING
+  FRESH,               // can mutate, no recording
+                       //   INITIAL_WRITE_PENDING
+};
+
 }