Commit 6a2e9dc4 authored by Filipe Manana's avatar Filipe Manana Committed by David Sterba

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: default avatarJosef Bacik <josef@toxicpanda.com>
Signed-off-by: default avatarFilipe Manana <fdmanana@suse.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 376a21d7
...@@ -1450,7 +1450,7 @@ read_block_for_search(struct btrfs_root *root, struct btrfs_path *p, ...@@ -1450,7 +1450,7 @@ read_block_for_search(struct btrfs_root *root, struct btrfs_path *p,
btrfs_unlock_up_safe(p, level + 1); btrfs_unlock_up_safe(p, level + 1);
/* now we're allowed to do a blocking uptodate check */ /* 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) { if (ret) {
free_extent_buffer(tmp); free_extent_buffer(tmp);
btrfs_release_path(p); btrfs_release_path(p);
......
...@@ -374,9 +374,9 @@ int btrfs_verify_level_key(struct extent_buffer *eb, int level, ...@@ -374,9 +374,9 @@ int btrfs_verify_level_key(struct extent_buffer *eb, int level,
* @level: expected level, mandatory check * @level: expected level, mandatory check
* @first_key: expected key of first slot, skip check if NULL * @first_key: expected key of first slot, skip check if NULL
*/ */
static int btree_read_extent_buffer_pages(struct extent_buffer *eb, int btrfs_read_extent_buffer(struct extent_buffer *eb,
u64 parent_transid, int level, u64 parent_transid, int level,
struct btrfs_key *first_key) struct btrfs_key *first_key)
{ {
struct btrfs_fs_info *fs_info = eb->fs_info; struct btrfs_fs_info *fs_info = eb->fs_info;
struct extent_io_tree *io_tree; struct extent_io_tree *io_tree;
...@@ -1118,8 +1118,7 @@ struct extent_buffer *read_tree_block(struct btrfs_fs_info *fs_info, u64 bytenr, ...@@ -1118,8 +1118,7 @@ struct extent_buffer *read_tree_block(struct btrfs_fs_info *fs_info, u64 bytenr,
if (IS_ERR(buf)) if (IS_ERR(buf))
return buf; return buf;
ret = btree_read_extent_buffer_pages(buf, parent_transid, ret = btrfs_read_extent_buffer(buf, parent_transid, level, first_key);
level, first_key);
if (ret) { if (ret) {
free_extent_buffer_stale(buf); free_extent_buffer_stale(buf);
return ERR_PTR(ret); return ERR_PTR(ret);
...@@ -4862,13 +4861,6 @@ void btrfs_btree_balance_dirty_nodelay(struct btrfs_fs_info *fs_info) ...@@ -4862,13 +4861,6 @@ void btrfs_btree_balance_dirty_nodelay(struct btrfs_fs_info *fs_info)
__btrfs_btree_balance_dirty(fs_info, 0); __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) static void btrfs_error_commit_super(struct btrfs_fs_info *fs_info)
{ {
/* cleanup FS via transaction */ /* cleanup FS via transaction */
......
...@@ -120,8 +120,8 @@ void btrfs_put_root(struct btrfs_root *root); ...@@ -120,8 +120,8 @@ void btrfs_put_root(struct btrfs_root *root);
void btrfs_mark_buffer_dirty(struct extent_buffer *buf); void btrfs_mark_buffer_dirty(struct extent_buffer *buf);
int btrfs_buffer_uptodate(struct extent_buffer *buf, u64 parent_transid, int btrfs_buffer_uptodate(struct extent_buffer *buf, u64 parent_transid,
int atomic); int atomic);
int btrfs_read_buffer(struct extent_buffer *buf, u64 parent_transid, int level, int btrfs_read_extent_buffer(struct extent_buffer *buf, u64 parent_transid,
struct btrfs_key *first_key); int level, struct btrfs_key *first_key);
blk_status_t btrfs_bio_wq_end_io(struct btrfs_fs_info *info, struct bio *bio, blk_status_t btrfs_bio_wq_end_io(struct btrfs_fs_info *info, struct bio *bio,
enum btrfs_wq_endio_type metadata); enum btrfs_wq_endio_type metadata);
blk_status_t btrfs_wq_submit_bio(struct inode *inode, struct bio *bio, 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, ...@@ -2290,7 +2290,7 @@ int btrfs_qgroup_trace_subtree(struct btrfs_trans_handle *trans,
return 0; return 0;
if (!extent_buffer_uptodate(root_eb)) { 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) if (ret)
goto out; goto out;
} }
......
...@@ -333,7 +333,7 @@ static int process_one_buffer(struct btrfs_root *log, ...@@ -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. * pin down any logged extents, so we have to read the block.
*/ */
if (btrfs_fs_incompat(fs_info, MIXED_GROUPS)) { 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) if (ret)
return ret; return ret;
} }
...@@ -2575,7 +2575,7 @@ static int replay_one_buffer(struct btrfs_root *log, struct extent_buffer *eb, ...@@ -2575,7 +2575,7 @@ static int replay_one_buffer(struct btrfs_root *log, struct extent_buffer *eb,
int i; int i;
int ret; int ret;
ret = btrfs_read_buffer(eb, gen, level, NULL); ret = btrfs_read_extent_buffer(eb, gen, level, NULL);
if (ret) if (ret)
return ret; return ret;
...@@ -2786,7 +2786,7 @@ static noinline int walk_down_log_tree(struct btrfs_trans_handle *trans, ...@@ -2786,7 +2786,7 @@ static noinline int walk_down_log_tree(struct btrfs_trans_handle *trans,
path->slots[*level]++; path->slots[*level]++;
if (wc->free) { if (wc->free) {
ret = btrfs_read_buffer(next, ptr_gen, ret = btrfs_read_extent_buffer(next, ptr_gen,
*level - 1, &first_key); *level - 1, &first_key);
if (ret) { if (ret) {
free_extent_buffer(next); free_extent_buffer(next);
...@@ -2815,7 +2815,7 @@ static noinline int walk_down_log_tree(struct btrfs_trans_handle *trans, ...@@ -2815,7 +2815,7 @@ static noinline int walk_down_log_tree(struct btrfs_trans_handle *trans,
free_extent_buffer(next); free_extent_buffer(next);
continue; 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) { if (ret) {
free_extent_buffer(next); free_extent_buffer(next);
return ret; return ret;
......
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