From ec9cbf2f438fc6b6812e31f132074076c99f1c8a Mon Sep 17 00:00:00 2001 From: Josef Bacik Date: Wed, 23 Aug 2023 10:32:53 -0400 Subject: [PATCH] btrfs-progs: add commit_root_sem to btrfs_fs_info 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 Signed-off-by: David Sterba --- kernel-shared/ctree.h | 1 + kernel-shared/disk-io.c | 1 + 2 files changed, 2 insertions(+) diff --git a/kernel-shared/ctree.h b/kernel-shared/ctree.h index 48cd3b85..b354a212 100644 --- a/kernel-shared/ctree.h +++ b/kernel-shared/ctree.h @@ -329,6 +329,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 62820862..2a0d8991 100644 --- a/kernel-shared/disk-io.c +++ b/kernel-shared/disk-io.c @@ -879,6 +879,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;