diff mbox series

[26/38] btrfs-progs: add trans_lock to fs_info

Message ID 99c37d184d3095659df91da2df5ef7ebdae70080.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 exists in the kernel, and is touched by ctree.c, add it to the
btrfs_fs_info to make sync'ing ctree.c more straightforward.

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

Patch

diff --git a/kernel-shared/ctree.h b/kernel-shared/ctree.h
index 0b440b1a..6ceae3e9 100644
--- a/kernel-shared/ctree.h
+++ b/kernel-shared/ctree.h
@@ -324,6 +324,8 @@  struct btrfs_fs_info {
 	struct extent_io_tree extent_ins;
 	struct extent_io_tree *excluded_extents;
 
+	spinlock_t trans_lock;
+
 	struct rb_root block_group_cache_tree;
 	/* logical->physical extent mapping */
 	struct btrfs_mapping_tree mapping_tree;
diff --git a/kernel-shared/disk-io.c b/kernel-shared/disk-io.c
index 286eb9cb..4f87b6fb 100644
--- a/kernel-shared/disk-io.c
+++ b/kernel-shared/disk-io.c
@@ -870,6 +870,8 @@  struct btrfs_fs_info *btrfs_new_fs_info(int writable, u64 sb_bytenr)
 	INIT_LIST_HEAD(&fs_info->space_info);
 	INIT_LIST_HEAD(&fs_info->recow_ebs);
 
+	spin_lock_init(&fs_info->trans_lock);
+
 	if (!writable)
 		fs_info->readonly = 1;