Commit fa4adfc7 authored by Johannes Thumshirn's avatar Johannes Thumshirn Committed by David Sterba

btrfs: pass reloc_control to relocate_data_extent()

Pass a 'struct reloc_control' to relocate_data_extent() instead of
it's data_inode and file_extent_cluster separately.
Reviewed-by: default avatarJosef Bacik <josef@toxicpanda.com>
Signed-off-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 8b62f14d
...@@ -3123,10 +3123,11 @@ static int relocate_file_extent_cluster(struct inode *inode, ...@@ -3123,10 +3123,11 @@ static int relocate_file_extent_cluster(struct inode *inode,
return ret; return ret;
} }
static noinline_for_stack int relocate_data_extent(struct inode *inode, static noinline_for_stack int relocate_data_extent(struct reloc_control *rc,
const struct btrfs_key *extent_key, const struct btrfs_key *extent_key)
struct file_extent_cluster *cluster)
{ {
struct inode *inode = rc->data_inode;
struct file_extent_cluster *cluster = &rc->cluster;
int ret; int ret;
struct btrfs_root *root = BTRFS_I(inode)->root; struct btrfs_root *root = BTRFS_I(inode)->root;
...@@ -3745,8 +3746,7 @@ static noinline_for_stack int relocate_block_group(struct reloc_control *rc) ...@@ -3745,8 +3746,7 @@ static noinline_for_stack int relocate_block_group(struct reloc_control *rc)
if (rc->stage == MOVE_DATA_EXTENTS && if (rc->stage == MOVE_DATA_EXTENTS &&
(flags & BTRFS_EXTENT_FLAG_DATA)) { (flags & BTRFS_EXTENT_FLAG_DATA)) {
rc->found_file_extent = true; rc->found_file_extent = true;
ret = relocate_data_extent(rc->data_inode, ret = relocate_data_extent(rc, &key);
&key, &rc->cluster);
if (ret < 0) { if (ret < 0) {
err = ret; err = ret;
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment