btrfs: pass a reloc_control to relocate_file_extent_cluster()
Instead of passing in a reloc_control's data_inode and file_extent_cluster members, pass in the whole reloc_control structure. Reviewed-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
fa4adfc786
commit
2e9e8dcdd5
@ -3084,9 +3084,10 @@ release_folio:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int relocate_file_extent_cluster(struct inode *inode,
|
||||
const struct file_extent_cluster *cluster)
|
||||
static int relocate_file_extent_cluster(struct reloc_control *rc)
|
||||
{
|
||||
struct inode *inode = rc->data_inode;
|
||||
const struct file_extent_cluster *cluster = &rc->cluster;
|
||||
u64 offset = BTRFS_I(inode)->reloc_block_group_start;
|
||||
unsigned long index;
|
||||
unsigned long last_index;
|
||||
@ -3132,7 +3133,7 @@ static noinline_for_stack int relocate_data_extent(struct reloc_control *rc,
|
||||
struct btrfs_root *root = BTRFS_I(inode)->root;
|
||||
|
||||
if (cluster->nr > 0 && extent_key->objectid != cluster->end + 1) {
|
||||
ret = relocate_file_extent_cluster(inode, cluster);
|
||||
ret = relocate_file_extent_cluster(rc);
|
||||
if (ret)
|
||||
return ret;
|
||||
cluster->nr = 0;
|
||||
@ -3158,7 +3159,7 @@ static noinline_for_stack int relocate_data_extent(struct reloc_control *rc,
|
||||
* the cluster we need to relocate.
|
||||
*/
|
||||
root->relocation_src_root = cluster->owning_root;
|
||||
ret = relocate_file_extent_cluster(inode, cluster);
|
||||
ret = relocate_file_extent_cluster(rc);
|
||||
if (ret)
|
||||
return ret;
|
||||
cluster->nr = 0;
|
||||
@ -3177,7 +3178,7 @@ static noinline_for_stack int relocate_data_extent(struct reloc_control *rc,
|
||||
cluster->nr++;
|
||||
|
||||
if (cluster->nr >= MAX_EXTENTS) {
|
||||
ret = relocate_file_extent_cluster(inode, cluster);
|
||||
ret = relocate_file_extent_cluster(rc);
|
||||
if (ret)
|
||||
return ret;
|
||||
cluster->nr = 0;
|
||||
@ -3775,8 +3776,7 @@ restart:
|
||||
}
|
||||
|
||||
if (!err) {
|
||||
ret = relocate_file_extent_cluster(rc->data_inode,
|
||||
&rc->cluster);
|
||||
ret = relocate_file_extent_cluster(rc);
|
||||
if (ret < 0)
|
||||
err = ret;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user