]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
btrfs: pass walk_control structure to replay_one_extent()
authorFilipe Manana <fdmanana@suse.com>
Thu, 28 Aug 2025 12:05:52 +0000 (13:05 +0100)
committerDavid Sterba <dsterba@suse.com>
Tue, 23 Sep 2025 06:49:19 +0000 (08:49 +0200)
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 <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/tree-log.c

index ca0946f947dfa14817e994d504c8bc18e27c6c90..aac648ae30fbb3eb50c71d3dbd6c7a9bb7346e72 100644 (file)
@@ -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;
                }