btrfs: don't opencode is_data_inode in end_bio_extent_readpage

Use the is_data_inode helper.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Nikolay Borisov 2020-09-18 16:34:36 +03:00 committed by David Sterba
parent cd0537449c
commit be17b3afc4

View File

@ -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",
@ -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
@ -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