diff mbox series

[27/38] btrfs-progs: add commit_root_sem to btrfs_fs_info

Message ID c9846fce420a83114423ee84cd82e0987d95a54c.1692800904.git.josef@toxicpanda.com (mailing list archive)
State New, archived
Headers show
Series btrfs-progs: sync ctree.c into btrfs-progs | expand

Commit Message

Josef Bacik Aug. 23, 2023, 2:32 p.m. UTC
This is used in ctree.c around getting the old root, add this to our
btrfs_fs_info to make it more straightforward to sync ctree.c into
btrfs-progs.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 kernel-shared/ctree.h   | 1 +
 kernel-shared/disk-io.c | 1 +
 2 files changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/kernel-shared/ctree.h b/kernel-shared/ctree.h
index 6ceae3e9..2f6a0cab 100644
--- a/kernel-shared/ctree.h
+++ b/kernel-shared/ctree.h
@@ -325,6 +325,7 @@  struct btrfs_fs_info {
 	struct extent_io_tree *excluded_extents;
 
 	spinlock_t trans_lock;
+	struct rw_semaphore commit_root_sem;
 
 	struct rb_root block_group_cache_tree;
 	/* logical->physical extent mapping */
diff --git a/kernel-shared/disk-io.c b/kernel-shared/disk-io.c
index 4f87b6fb..092b54af 100644
--- a/kernel-shared/disk-io.c
+++ b/kernel-shared/disk-io.c
@@ -871,6 +871,7 @@  struct btrfs_fs_info *btrfs_new_fs_info(int writable, u64 sb_bytenr)
 	INIT_LIST_HEAD(&fs_info->recow_ebs);
 
 	spin_lock_init(&fs_info->trans_lock);
+	init_rwsem(&fs_info->commit_root_sem);
 
 	if (!writable)
 		fs_info->readonly = 1;