Commit 897cae79 authored by Naohiro Aota's avatar Naohiro Aota Committed by David Sterba

btrfs: drop unnecessary arguments from clustered allocation functions

Now that, find_free_extent_clustered() and find_free_extent_unclustered()
can access "last_ptr" from the "clustered" variable, we can drop it from
the arguments.
Reviewed-by: default avatarJosef Bacik <josef@toxicpanda.com>
Signed-off-by: default avatarNaohiro Aota <naohiro.aota@wdc.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent c668690d
...@@ -3502,11 +3502,11 @@ struct find_free_extent_ctl { ...@@ -3502,11 +3502,11 @@ struct find_free_extent_ctl {
* Return 0 means we have found a location and set ffe_ctl->found_offset. * Return 0 means we have found a location and set ffe_ctl->found_offset.
*/ */
static int find_free_extent_clustered(struct btrfs_block_group *bg, static int find_free_extent_clustered(struct btrfs_block_group *bg,
struct btrfs_free_cluster *last_ptr, struct find_free_extent_ctl *ffe_ctl,
struct find_free_extent_ctl *ffe_ctl, struct btrfs_block_group **cluster_bg_ret)
struct btrfs_block_group **cluster_bg_ret)
{ {
struct btrfs_block_group *cluster_bg; struct btrfs_block_group *cluster_bg;
struct btrfs_free_cluster *last_ptr = ffe_ctl->last_ptr;
u64 aligned_cluster; u64 aligned_cluster;
u64 offset; u64 offset;
int ret; int ret;
...@@ -3606,9 +3606,9 @@ static int find_free_extent_clustered(struct btrfs_block_group *bg, ...@@ -3606,9 +3606,9 @@ static int find_free_extent_clustered(struct btrfs_block_group *bg,
* Return -EAGAIN to inform caller that we need to re-search this block group * Return -EAGAIN to inform caller that we need to re-search this block group
*/ */
static int find_free_extent_unclustered(struct btrfs_block_group *bg, static int find_free_extent_unclustered(struct btrfs_block_group *bg,
struct btrfs_free_cluster *last_ptr, struct find_free_extent_ctl *ffe_ctl)
struct find_free_extent_ctl *ffe_ctl)
{ {
struct btrfs_free_cluster *last_ptr = ffe_ctl->last_ptr;
u64 offset; u64 offset;
/* /*
...@@ -3672,15 +3672,13 @@ static int do_allocation_clustered(struct btrfs_block_group *block_group, ...@@ -3672,15 +3672,13 @@ static int do_allocation_clustered(struct btrfs_block_group *block_group,
/* We want to try and use the cluster allocator, so lets look there */ /* We want to try and use the cluster allocator, so lets look there */
if (ffe_ctl->last_ptr && ffe_ctl->use_cluster) { if (ffe_ctl->last_ptr && ffe_ctl->use_cluster) {
ret = find_free_extent_clustered(block_group, ffe_ctl->last_ptr, ret = find_free_extent_clustered(block_group, ffe_ctl, bg_ret);
ffe_ctl, bg_ret);
if (ret >= 0 || ret == -EAGAIN) if (ret >= 0 || ret == -EAGAIN)
return ret; return ret;
/* ret == -ENOENT case falls through */ /* ret == -ENOENT case falls through */
} }
return find_free_extent_unclustered(block_group, ffe_ctl->last_ptr, return find_free_extent_unclustered(block_group, ffe_ctl);
ffe_ctl);
} }
static int do_allocation(struct btrfs_block_group *block_group, static int do_allocation(struct btrfs_block_group *block_group,
......
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