Message ID | 20240606-reloc-cleanups-v2-5-5172a6926f62@kernel.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | btrfs: small cleanups for relocation code | expand |
On Thu, Jun 06, 2024 at 10:35:03AM +0200, Johannes Thumshirn wrote: > From: Johannes Thumshirn <johannes.thumshirn@wdc.com> > > Pass a 'struct reloc_control' to prealloc_file_extent_cluster() > instead of passing its members 'data_inode' and 'cluster' on their own. > > Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: Josef Bacik <josef@toxicpanda.com> Thanks, Josef
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index df3f7c11cfce..c138d08cce76 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c @@ -2790,10 +2790,10 @@ int relocate_tree_blocks(struct btrfs_trans_handle *trans, return ret; } -static noinline_for_stack int prealloc_file_extent_cluster( - struct btrfs_inode *inode, - const struct file_extent_cluster *cluster) +static noinline_for_stack int prealloc_file_extent_cluster(struct reloc_control *rc) { + const struct file_extent_cluster *cluster = &rc->cluster; + struct btrfs_inode *inode = BTRFS_I(rc->data_inode); u64 alloc_hint = 0; u64 start; u64 end; @@ -3104,7 +3104,7 @@ static int relocate_file_extent_cluster(struct reloc_control *rc) if (!ra) return -ENOMEM; - ret = prealloc_file_extent_cluster(BTRFS_I(inode), cluster); + ret = prealloc_file_extent_cluster(rc); if (ret) goto out;