History

btrfs: add definitions and constants for remap-tree

Add an incompat flag for the new remap-tree feature, and the constants and definitions needed to support it.

Mark Harmstone committed 10 months ago

Commit ef6a31d1 parent c208aa08 files · +34 −4Browse files

Showing the changes to include/uapi (2 of 8 files). Show all

Unified · Split

2 files
  1. include/uapi/linux/btrfs.h +1 −0
  2. include/uapi/linux/btrfs_tree.h +17 −0
include/uapi/linux/btrfs.h+1−0
@@ -336,6 +336,7 @@ struct btrfs_ioctl_fs_info_args { · 335 unmodified lines
336336 #define BTRFS_FEATURE_INCOMPAT_EXTENT_TREE_V2 (1ULL << 13)
337337 #define BTRFS_FEATURE_INCOMPAT_RAID_STRIPE_TREE (1ULL << 14)
338338 #define BTRFS_FEATURE_INCOMPAT_SIMPLE_QUOTA (1ULL << 16)
339+#define BTRFS_FEATURE_INCOMPAT_REMAP_TREE (1ULL << 17)
339340
340341 struct btrfs_ioctl_feature_flags {
341342 __u64 compat_flags;
include/uapi/linux/btrfs_tree.h+17−0
@@ -76,6 +76,9 @@ · 75 unmodified lines
7676 /* Tracks RAID stripes in block groups. */
7777 #define BTRFS_RAID_STRIPE_TREE_OBJECTID 12ULL
7878
79+/* Holds details of remapped addresses after relocation. */
80+#define BTRFS_REMAP_TREE_OBJECTID 13ULL
81+
7982 /* device stats in the device tree */
8083 #define BTRFS_DEV_STATS_OBJECTID 0ULL
8184
@@ -282,6 +285,10 @@ · 200 unmodified lines
282285
283286 #define BTRFS_RAID_STRIPE_KEY 230
284287
288+#define BTRFS_IDENTITY_REMAP_KEY 234
289+#define BTRFS_REMAP_KEY 235
290+#define BTRFS_REMAP_BACKREF_KEY 236
291+
285292 /*
286293 * Records the overall state of the qgroups.
287294 * There's only one instance of this key present,
@@ -1161,6 +1168,7 @@ struct btrfs_dev_replace_item { · 873 unmodified lines
11611168 #define BTRFS_BLOCK_GROUP_RAID6 (1ULL << 8)
11621169 #define BTRFS_BLOCK_GROUP_RAID1C3 (1ULL << 9)
11631170 #define BTRFS_BLOCK_GROUP_RAID1C4 (1ULL << 10)
1171+#define BTRFS_BLOCK_GROUP_REMAPPED (1ULL << 11)
11641172 #define BTRFS_BLOCK_GROUP_RESERVED (BTRFS_AVAIL_ALLOC_BIT_SINGLE | \
11651173 BTRFS_SPACE_INFO_GLOBAL_RSV)
11661174
@@ -1323,4 +1331,13 @@ struct btrfs_verity_descriptor_item { · 156 unmodified lines
13231331 __u8 encryption;
13241332 } __attribute__ ((__packed__));
13251333
1334+/*
1335+ * For a range identified by a BTRFS_REMAP_KEY item in the remap tree, gives
1336+ * the address that the start of the range will get remapped to. This
1337+ * structure is also shared by BTRFS_REMAP_BACKREF_KEY.
1338+ */
1339+struct btrfs_remap_item {
1340+ __le64 address;
1341+} __attribute__ ((__packed__));
1342+
13261343 #endif /* _BTRFS_CTREE_H_ */