btrfs: Make reada_tree_block_flagged private
PATCH 1/1 btrfs: Make reada_tree_block_flagged private
This function is used only for the readahead machinery. It makes no sense to keep it external to reada.c file. Place it above its sole caller and make it static. No functional changes.
Signed-off-by Nikolay Borisov <[email protected]>
--- fs/btrfs/disk-io.c | 29 ----------------------------- fs/btrfs/disk-io.h | 2 -- fs/btrfs/reada.c | 29 +++++++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 31 deletions(-)
fs/btrfs/disk-io.c +0 -29
@@ -1038,35 +1038,6 @@ void readahead_tree_block(struct btrfs_fs_info *fs_info, u64 bytenr)free_extent_buffer (buf); } -int reada_tree_block_flagged (struct btrfs_fs_info *fs_info,u64 bytenr, -int mirror_num,struct extent_buffer **eb) -{ -struct extent_buffer *buf =NULL ; -int ret; - - buf =btrfs_find_create_tree_block (fs_info, bytenr); -if (IS_ERR (buf)) -return 0 ; - -set_bit (EXTENT_BUFFER_READAHEAD , &buf->bflags); - - ret =read_extent_buffer_pages (buf,WAIT_PAGE_LOCK , mirror_num); -if (ret) { -free_extent_buffer_stale (buf); -return ret; - } - -if (test_bit (EXTENT_BUFFER_CORRUPT , &buf->bflags)) { -free_extent_buffer_stale (buf); -return -EIO ; - }else if (extent_buffer_uptodate (buf)) { - *eb = buf; - }else { -free_extent_buffer (buf); - } -return 0 ; -} -struct extent_buffer *btrfs_find_create_tree_block (struct btrfs_fs_info *fs_info,u64 bytenr)
fs/btrfs/disk-io.h +0 -2
@@ -45,8 +45,6 @@ struct extent_buffer *read_tree_block(struct btrfs_fs_info *fs_info, u64 bytenr, u64 parent_transid, int level, struct btrfs_key *first_key);void readahead_tree_block (struct btrfs_fs_info *fs_info,u64 bytenr); -int reada_tree_block_flagged (struct btrfs_fs_info *fs_info,u64 bytenr, -int mirror_num,struct extent_buffer **eb);struct extent_buffer *btrfs_find_create_tree_block (struct btrfs_fs_info *fs_info,u64 bytenr);
fs/btrfs/reada.c +29 -0
@@ -639,6 +639,35 @@ static int reada_pick_zone(struct btrfs_device *dev)return 1 ; } +static int reada_tree_block_flagged (struct btrfs_fs_info *fs_info,u64 bytenr, +int mirror_num,struct extent_buffer **eb) +{ +struct extent_buffer *buf =NULL ; +int ret; + + buf =btrfs_find_create_tree_block (fs_info, bytenr); +if (IS_ERR (buf)) +return 0 ; + +set_bit (EXTENT_BUFFER_READAHEAD , &buf->bflags); + + ret =read_extent_buffer_pages (buf,WAIT_PAGE_LOCK , mirror_num); +if (ret) { +free_extent_buffer_stale (buf); +return ret; + } + +if (test_bit (EXTENT_BUFFER_CORRUPT , &buf->bflags)) { +free_extent_buffer_stale (buf); +return -EIO ; + }else if (extent_buffer_uptodate (buf)) { + *eb = buf; + }else { +free_extent_buffer (buf); + } +return 0 ; +} +static int reada_start_machine_dev (struct btrfs_device *dev) {struct btrfs_fs_info *fs_info = dev->fs_info;
Signature · 1 line
2.17.1
Looks good,
Reviewed-by Johannes Thumshirn <[email protected]>
Signature · 6 lines
Johannes Thumshirn SUSE Labs Filesystems [email protected] +49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Mary Higgins, Sri Rasiah HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Quoted 5 lines · Nikolay Borisov
This function is used only for the readahead machinery. It makes no sense to keep it external to
reada.cfile. Place it above its sole caller and make it static. No functional changes.Signed-off-by Nikolay Borisov <[email protected]>
Added to misc-next, thanks.