Skip to content

Commit

Permalink
btrfs: don't opencode is_data_inode in end_bio_extent_readpage
Browse files Browse the repository at this point in the history
Use the is_data_inode helper.

Signed-off-by: Nikolay Borisov <[email protected]>
Reviewed-by: David Sterba <[email protected]>
Signed-off-by: David Sterba <[email protected]>
  • Loading branch information
lorddoskias authored and kdave committed Oct 7, 2020
1 parent cd05374 commit be17b3a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions fs/btrfs/extent_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -2816,8 +2816,6 @@ static void end_bio_extent_readpage(struct bio *bio)
struct page *page = bvec->bv_page;
struct inode *inode = page->mapping->host;
struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
bool data_inode = btrfs_ino(BTRFS_I(inode))
!= BTRFS_BTREE_INODE_OBJECTID;

btrfs_debug(fs_info,
"end_bio_extent_readpage: bi_sector=%llu, err=%d, mirror=%u",
Expand Down Expand Up @@ -2848,7 +2846,7 @@ static void end_bio_extent_readpage(struct bio *bio)

mirror = io_bio->mirror_num;
if (likely(uptodate)) {
if (data_inode)
if (is_data_inode(inode))
ret = btrfs_verify_data_csum(io_bio, offset, page,
start, end, mirror);
else
Expand All @@ -2866,7 +2864,7 @@ static void end_bio_extent_readpage(struct bio *bio)
if (likely(uptodate))
goto readpage_ok;

if (data_inode) {
if (is_data_inode(inode)) {

/*
* The generic bio_readpage_error handles errors the
Expand Down

0 comments on commit be17b3a

Please sign in to comment.