btrfs: remove trivial wrapper btrfs_read_buffer()
The function btrfs_read_buffer() is useless, it just calls btree_read_extent_buffer_pages() with exactly the same arguments. So remove it and rename btree_read_extent_buffer_pages() to btrfs_read_extent_buffer(), which is a shorter name, has the "btrfs_" prefix (since it's used outside disk-io.c) and the name is clear enough about what it does. Reviewed-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
376a21d752
commit
6a2e9dc46f
@ -1450,7 +1450,7 @@ read_block_for_search(struct btrfs_root *root, struct btrfs_path *p,
|
||||
btrfs_unlock_up_safe(p, level + 1);
|
||||
|
||||
/* now we're allowed to do a blocking uptodate check */
|
||||
ret = btrfs_read_buffer(tmp, gen, parent_level - 1, &first_key);
|
||||
ret = btrfs_read_extent_buffer(tmp, gen, parent_level - 1, &first_key);
|
||||
if (ret) {
|
||||
free_extent_buffer(tmp);
|
||||
btrfs_release_path(p);
|
||||
|
@ -374,9 +374,9 @@ int btrfs_verify_level_key(struct extent_buffer *eb, int level,
|
||||
* @level: expected level, mandatory check
|
||||
* @first_key: expected key of first slot, skip check if NULL
|
||||
*/
|
||||
static int btree_read_extent_buffer_pages(struct extent_buffer *eb,
|
||||
u64 parent_transid, int level,
|
||||
struct btrfs_key *first_key)
|
||||
int btrfs_read_extent_buffer(struct extent_buffer *eb,
|
||||
u64 parent_transid, int level,
|
||||
struct btrfs_key *first_key)
|
||||
{
|
||||
struct btrfs_fs_info *fs_info = eb->fs_info;
|
||||
struct extent_io_tree *io_tree;
|
||||
@ -1118,8 +1118,7 @@ struct extent_buffer *read_tree_block(struct btrfs_fs_info *fs_info, u64 bytenr,
|
||||
if (IS_ERR(buf))
|
||||
return buf;
|
||||
|
||||
ret = btree_read_extent_buffer_pages(buf, parent_transid,
|
||||
level, first_key);
|
||||
ret = btrfs_read_extent_buffer(buf, parent_transid, level, first_key);
|
||||
if (ret) {
|
||||
free_extent_buffer_stale(buf);
|
||||
return ERR_PTR(ret);
|
||||
@ -4862,13 +4861,6 @@ void btrfs_btree_balance_dirty_nodelay(struct btrfs_fs_info *fs_info)
|
||||
__btrfs_btree_balance_dirty(fs_info, 0);
|
||||
}
|
||||
|
||||
int btrfs_read_buffer(struct extent_buffer *buf, u64 parent_transid, int level,
|
||||
struct btrfs_key *first_key)
|
||||
{
|
||||
return btree_read_extent_buffer_pages(buf, parent_transid,
|
||||
level, first_key);
|
||||
}
|
||||
|
||||
static void btrfs_error_commit_super(struct btrfs_fs_info *fs_info)
|
||||
{
|
||||
/* cleanup FS via transaction */
|
||||
|
@ -120,8 +120,8 @@ void btrfs_put_root(struct btrfs_root *root);
|
||||
void btrfs_mark_buffer_dirty(struct extent_buffer *buf);
|
||||
int btrfs_buffer_uptodate(struct extent_buffer *buf, u64 parent_transid,
|
||||
int atomic);
|
||||
int btrfs_read_buffer(struct extent_buffer *buf, u64 parent_transid, int level,
|
||||
struct btrfs_key *first_key);
|
||||
int btrfs_read_extent_buffer(struct extent_buffer *buf, u64 parent_transid,
|
||||
int level, struct btrfs_key *first_key);
|
||||
blk_status_t btrfs_bio_wq_end_io(struct btrfs_fs_info *info, struct bio *bio,
|
||||
enum btrfs_wq_endio_type metadata);
|
||||
blk_status_t btrfs_wq_submit_bio(struct inode *inode, struct bio *bio,
|
||||
|
@ -2290,7 +2290,7 @@ int btrfs_qgroup_trace_subtree(struct btrfs_trans_handle *trans,
|
||||
return 0;
|
||||
|
||||
if (!extent_buffer_uptodate(root_eb)) {
|
||||
ret = btrfs_read_buffer(root_eb, root_gen, root_level, NULL);
|
||||
ret = btrfs_read_extent_buffer(root_eb, root_gen, root_level, NULL);
|
||||
if (ret)
|
||||
goto out;
|
||||
}
|
||||
|
@ -333,7 +333,7 @@ static int process_one_buffer(struct btrfs_root *log,
|
||||
* pin down any logged extents, so we have to read the block.
|
||||
*/
|
||||
if (btrfs_fs_incompat(fs_info, MIXED_GROUPS)) {
|
||||
ret = btrfs_read_buffer(eb, gen, level, NULL);
|
||||
ret = btrfs_read_extent_buffer(eb, gen, level, NULL);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
@ -2575,7 +2575,7 @@ static int replay_one_buffer(struct btrfs_root *log, struct extent_buffer *eb,
|
||||
int i;
|
||||
int ret;
|
||||
|
||||
ret = btrfs_read_buffer(eb, gen, level, NULL);
|
||||
ret = btrfs_read_extent_buffer(eb, gen, level, NULL);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@ -2786,7 +2786,7 @@ static noinline int walk_down_log_tree(struct btrfs_trans_handle *trans,
|
||||
|
||||
path->slots[*level]++;
|
||||
if (wc->free) {
|
||||
ret = btrfs_read_buffer(next, ptr_gen,
|
||||
ret = btrfs_read_extent_buffer(next, ptr_gen,
|
||||
*level - 1, &first_key);
|
||||
if (ret) {
|
||||
free_extent_buffer(next);
|
||||
@ -2815,7 +2815,7 @@ static noinline int walk_down_log_tree(struct btrfs_trans_handle *trans,
|
||||
free_extent_buffer(next);
|
||||
continue;
|
||||
}
|
||||
ret = btrfs_read_buffer(next, ptr_gen, *level - 1, &first_key);
|
||||
ret = btrfs_read_extent_buffer(next, ptr_gen, *level - 1, &first_key);
|
||||
if (ret) {
|
||||
free_extent_buffer(next);
|
||||
return ret;
|
||||
|
Loading…
Reference in New Issue
Block a user