From 75470804037957b813a1197823aff1cc5eabbd19 Mon Sep 17 00:00:00 2001 From: Qu Wenruo Date: Tue, 2 Jul 2024 16:57:21 +0930 Subject: [PATCH] btrfs-progs: remove fs_info parameter from btrfs_create_tree() The @fs_info parameter can be easily extracted from @trans, and kernel has already remove the parameter. Signed-off-by: Qu Wenruo --- kernel-shared/disk-io.c | 4 ++-- kernel-shared/disk-io.h | 1 - kernel-shared/free-space-tree.c | 2 +- mkfs/main.c | 8 ++++---- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/kernel-shared/disk-io.c b/kernel-shared/disk-io.c index 295bd50a..3e8cab11 100644 --- a/kernel-shared/disk-io.c +++ b/kernel-shared/disk-io.c @@ -2369,12 +2369,12 @@ int btrfs_delete_and_free_root(struct btrfs_trans_handle *trans, } struct btrfs_root *btrfs_create_tree(struct btrfs_trans_handle *trans, - struct btrfs_fs_info *fs_info, struct btrfs_key *key) { - struct extent_buffer *leaf; + struct btrfs_fs_info *fs_info = trans->fs_info; struct btrfs_root *tree_root = fs_info->tree_root; struct btrfs_root *root; + struct extent_buffer *leaf; int ret = 0; root = kzalloc(sizeof(*root), GFP_KERNEL); diff --git a/kernel-shared/disk-io.h b/kernel-shared/disk-io.h index 9f848635..0047db5e 100644 --- a/kernel-shared/disk-io.h +++ b/kernel-shared/disk-io.h @@ -239,7 +239,6 @@ int write_tree_block(struct btrfs_trans_handle *trans, struct extent_buffer *eb); int btrfs_fs_roots_compare_roots(const struct rb_node *node1, const struct rb_node *node2); struct btrfs_root *btrfs_create_tree(struct btrfs_trans_handle *trans, - struct btrfs_fs_info *fs_info, struct btrfs_key *key); int btrfs_delete_and_free_root(struct btrfs_trans_handle *trans, struct btrfs_root *root); diff --git a/kernel-shared/free-space-tree.c b/kernel-shared/free-space-tree.c index 93806ca0..81fd57b8 100644 --- a/kernel-shared/free-space-tree.c +++ b/kernel-shared/free-space-tree.c @@ -1516,7 +1516,7 @@ int btrfs_create_free_space_tree(struct btrfs_fs_info *fs_info) if (IS_ERR(trans)) return PTR_ERR(trans); - free_space_root = btrfs_create_tree(trans, fs_info, &root_key); + free_space_root = btrfs_create_tree(trans, &root_key); if (IS_ERR(free_space_root)) { ret = PTR_ERR(free_space_root); goto abort; diff --git a/mkfs/main.c b/mkfs/main.c index b40f7432..077da1e3 100644 --- a/mkfs/main.c +++ b/mkfs/main.c @@ -748,7 +748,7 @@ static int create_data_reloc_tree(struct btrfs_trans_handle *trans) char *name = ".."; int ret; - root = btrfs_create_tree(trans, fs_info, &key); + root = btrfs_create_tree(trans, &key); if (IS_ERR(root)) { ret = PTR_ERR(root); goto out; @@ -870,7 +870,7 @@ static int create_uuid_tree(struct btrfs_trans_handle *trans) int ret = 0; UASSERT(fs_info->uuid_root == NULL); - root = btrfs_create_tree(trans, fs_info, &key); + root = btrfs_create_tree(trans, &key); if (IS_ERR(root)) { ret = PTR_ERR(root); goto out; @@ -900,7 +900,7 @@ static int create_global_root(struct btrfs_trans_handle *trans, u64 objectid, }; int ret = 0; - root = btrfs_create_tree(trans, fs_info, &key); + root = btrfs_create_tree(trans, &key); if (IS_ERR(root)) { ret = PTR_ERR(root); goto out; @@ -1127,7 +1127,7 @@ static int setup_raid_stripe_tree_root(struct btrfs_fs_info *fs_info) return ret; } - stripe_root = btrfs_create_tree(trans, fs_info, &key); + stripe_root = btrfs_create_tree(trans, &key); if (IS_ERR(stripe_root)) { ret = PTR_ERR(stripe_root); btrfs_abort_transaction(trans, ret);