diff mbox series

[02/11] btrfs: add global_tree_id to btrfs_root_item

Message ID 4c2cd74a4cd9b3b8918741ad4fde28b0693fa232.1646692474.git.josef@toxicpanda.com (mailing list archive)
State New, archived
Headers show
Series btrfs: add snapshot_id to btrfs_header and root_item | expand

Commit Message

Josef Bacik March 7, 2022, 10:36 p.m. UTC
This is something Dave asked for in case we want to limit a subvolume to
a set of global roots.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 fs/btrfs/ctree.h                | 2 ++
 include/uapi/linux/btrfs_tree.h | 6 +++++-
 2 files changed, 7 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index b1cc1d34944a..222c5dda9079 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -2412,6 +2412,8 @@  BTRFS_SETGET_STACK_FUNCS(root_stransid, struct btrfs_root_item,
 			 stransid, 64);
 BTRFS_SETGET_STACK_FUNCS(root_rtransid, struct btrfs_root_item,
 			 rtransid, 64);
+BTRFS_SETGET_STACK_FUNCS(root_global_tree_id, struct btrfs_root_item,
+			 global_tree_id, 64);
 
 static inline bool btrfs_root_readonly(const struct btrfs_root *root)
 {
diff --git a/include/uapi/linux/btrfs_tree.h b/include/uapi/linux/btrfs_tree.h
index 92760ea4b448..cd62ca1950cb 100644
--- a/include/uapi/linux/btrfs_tree.h
+++ b/include/uapi/linux/btrfs_tree.h
@@ -682,7 +682,11 @@  struct btrfs_root_item {
 	struct btrfs_timespec otime;
 	struct btrfs_timespec stime;
 	struct btrfs_timespec rtime;
-	__le64 reserved[8]; /* for future */
+
+	/* If we want to use a specific set of global roots for this root. */
+	__le64 global_tree_id;
+
+	__le64 reserved[7]; /* for future */
 } __attribute__ ((__packed__));
 
 /*