summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2016-11-01 13:29:25 +0100
committerDavid Sterba <dsterba@suse.com>2016-11-09 13:47:30 +0100
commit6122cb32c6035b745a0495b970cb9a75ac0da0d8 (patch)
tree44d5ab4340d301d61b2d1c618007696232102131
parent5c4d53450b2c6ff7169c99f9158c14ae96b7b0a8 (diff)
btrfs-progs: introduce key type for persistent temporary items
The number of distinct key types is not that big that we could waste one for something new we want to store in the tree. We'll introduce a new name for an existing key value and use the objectid for further extension. The victim is the BTRFS_BALANCE_ITEM_KEY (248). The nature of the balance status item is a good example of the temporary item. It exists from beginning of the balance, keeps the status until it finishes. [ kernel patch 0bbbccb17fea86818e1a058faf5903aefd20b31a ] Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r--ctree.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/ctree.h b/ctree.h
index c76b1f10..dc4b35c2 100644
--- a/ctree.h
+++ b/ctree.h
@@ -1211,6 +1211,24 @@ struct btrfs_root {
#define BTRFS_QGROUP_RELATION_KEY 246
/*
+ * Obsolete name, see BTRFS_TEMPORARY_ITEM_KEY.
+ */
+#define BTRFS_BALANCE_ITEM_KEY 248
+
+/*
+ * The key type for tree items that are stored persistently, but do not need to
+ * exist for extended period of time. The items can exist in any tree.
+ *
+ * [subtype, BTRFS_TEMPORARY_ITEM_KEY, data]
+ *
+ * Existing items:
+ *
+ * - balance status item
+ * (BTRFS_BALANCE_OBJECTID, BTRFS_TEMPORARY_ITEM_KEY, 0)
+ */
+#define BTRFS_TEMPORARY_ITEM_KEY 248
+
+/*
* Persistently stores the io stats in the device tree.
* One key for all stats, (0, BTRFS_DEV_STATS_KEY, devid).
*/