mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 02:24:24 +02:00
btrfs: reduce parameters of btrfs_pin_reserved_extent
There is only one caller of btrfs_pin_reserved_extent that expands the parameters to extent buffer members. We can simply pass the extent buffer instead. Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
203f6a8772
commit
f863c50277
|
|
@ -4562,20 +4562,20 @@ int btrfs_free_reserved_extent(struct btrfs_fs_info *fs_info,
|
|||
return 0;
|
||||
}
|
||||
|
||||
int btrfs_pin_reserved_extent(struct btrfs_trans_handle *trans, u64 start,
|
||||
u64 len)
|
||||
int btrfs_pin_reserved_extent(struct btrfs_trans_handle *trans,
|
||||
const struct extent_buffer *eb)
|
||||
{
|
||||
struct btrfs_block_group *cache;
|
||||
int ret = 0;
|
||||
|
||||
cache = btrfs_lookup_block_group(trans->fs_info, start);
|
||||
cache = btrfs_lookup_block_group(trans->fs_info, eb->start);
|
||||
if (!cache) {
|
||||
btrfs_err(trans->fs_info, "unable to find block group for %llu",
|
||||
start);
|
||||
eb->start);
|
||||
return -ENOSPC;
|
||||
}
|
||||
|
||||
ret = pin_down_extent(trans, cache, start, len, 1);
|
||||
ret = pin_down_extent(trans, cache, eb->start, eb->len, 1);
|
||||
btrfs_put_block_group(cache);
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -139,7 +139,8 @@ int btrfs_free_extent(struct btrfs_trans_handle *trans, struct btrfs_ref *ref);
|
|||
|
||||
int btrfs_free_reserved_extent(struct btrfs_fs_info *fs_info,
|
||||
u64 start, u64 len, int delalloc);
|
||||
int btrfs_pin_reserved_extent(struct btrfs_trans_handle *trans, u64 start, u64 len);
|
||||
int btrfs_pin_reserved_extent(struct btrfs_trans_handle *trans,
|
||||
const struct extent_buffer *eb);
|
||||
int btrfs_finish_extent_commit(struct btrfs_trans_handle *trans);
|
||||
int btrfs_inc_extent_ref(struct btrfs_trans_handle *trans, struct btrfs_ref *generic_ref);
|
||||
int btrfs_drop_snapshot(struct btrfs_root *root, int update_ref,
|
||||
|
|
|
|||
|
|
@ -2574,7 +2574,7 @@ static int clean_log_buffer(struct btrfs_trans_handle *trans,
|
|||
btrfs_tree_unlock(eb);
|
||||
|
||||
if (trans) {
|
||||
ret = btrfs_pin_reserved_extent(trans, eb->start, eb->len);
|
||||
ret = btrfs_pin_reserved_extent(trans, eb);
|
||||
if (ret)
|
||||
return ret;
|
||||
btrfs_redirty_list_add(trans->transaction, eb);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user