aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2016-01-25 11:32:11 -0500
committerDavid Sterba <dsterba@suse.com>2016-02-11 10:15:43 -0500
commit50c2d5abe64c1726b48d292a2ab04f60e8238933 (patch)
tree46ef95353bb165cc1d2474cd68a95174c834c7cf
parentc479cb4f14f99868108da99568950e5311e1fe4c (diff)
btrfs: introduce key type for persistent permanent 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. Similar to the temporary items, we'll introduce a new name for an existing key value and use the objectid for further extension. The victim is the BTRFS_DEV_STATS_KEY (248). The device stats are an example of a permanent item. Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r--fs/btrfs/ctree.h20
1 files changed, 17 insertions, 3 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index e20f40649917..ffc081e11277 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -2204,10 +2204,24 @@ struct btrfs_ioctl_defrag_range_args {
2204#define BTRFS_TEMPORARY_ITEM_KEY 248 2204#define BTRFS_TEMPORARY_ITEM_KEY 248
2205 2205
2206/* 2206/*
2207 * Persistantly stores the io stats in the device tree. 2207 * Obsolete name, see BTRFS_PERSISTENT_ITEM_KEY
2208 * One key for all stats, (0, BTRFS_DEV_STATS_KEY, devid).
2209 */ 2208 */
2210#define BTRFS_DEV_STATS_KEY 249 2209#define BTRFS_DEV_STATS_KEY 249
2210
2211/*
2212 * The key type for tree items that are stored persistently and usually exist
2213 * for a long period, eg. filesystem lifetime. The item kinds can be status
2214 * information, stats or preference values. The item can exist in any tree.
2215 *
2216 * [subtype, BTRFS_PERSISTENT_ITEM_KEY, data]
2217 *
2218 * Existing items:
2219 *
2220 * - device statistics, store IO stats in the device tree, one key for all
2221 * stats
2222 * (0, BTRFS_DEV_STATS_KEY, 0)
2223 */
2224#define BTRFS_PERSISTENT_ITEM_KEY 249
2211 2225
2212/* 2226/*
2213 * Persistantly stores the device replace state in the device tree. 2227 * Persistantly stores the device replace state in the device tree.