From: Filipe Manana Date: Thu, 28 Aug 2025 12:05:52 +0000 (+0100) Subject: btrfs: pass walk_control structure to replay_one_extent() X-Git-Tag: v6.18-rc1~204^2~58 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c7da72022bb2cfeb21951b875db1f029ff236a72;p=thirdparty%2Fkernel%2Fstable.git btrfs: pass walk_control structure to replay_one_extent() Instead of passing the transaction and subvolume root as arguments to replay_one_extent(), pass the walk_control structure as we can grab all of those from the structure. This reduces the number of arguments passed and it's going to be needed by an incoming change that improves error reporting for log replay. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba --- diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index ca0946f947dfa..aac648ae30fbb 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -642,12 +642,13 @@ static int read_alloc_one_name(struct extent_buffer *eb, void *start, int len, * The extent is inserted into the file, dropping any existing extents * from the file that overlap the new one. */ -static noinline int replay_one_extent(struct btrfs_trans_handle *trans, - struct btrfs_root *root, +static noinline int replay_one_extent(struct walk_control *wc, struct btrfs_path *path, struct extent_buffer *eb, int slot, struct btrfs_key *key) { + struct btrfs_trans_handle *trans = wc->trans; + struct btrfs_root *root = wc->root; struct btrfs_drop_extents_args drop_args = { 0 }; struct btrfs_fs_info *fs_info = root->fs_info; int found_type; @@ -2728,7 +2729,7 @@ static int replay_one_buffer(struct extent_buffer *eb, if (ret) break; } else if (key.type == BTRFS_EXTENT_DATA_KEY) { - ret = replay_one_extent(trans, root, path, eb, i, &key); + ret = replay_one_extent(wc, path, eb, i, &key); if (ret) break; }