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 <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Josef Bacik 2023-08-23 10:32:53 -04:00 committed by David Sterba
parent f7271ef547
commit ec9cbf2f43
2 changed files with 2 additions and 0 deletions

View File

@ -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 */

View File

@ -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;