Skip to content

Commit 20c9801

Browse files
committed
btrfs: drop checks for mandatory extent_io_ops callbacks
We know that eadpage_end_io_hook, submit_bio_hook and merge_bio_hook are always defined so we can drop the checks before we call them. Signed-off-by: David Sterba <[email protected]>
1 parent 4d53ddd commit 20c9801

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

fs/btrfs/extent_io.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2567,8 +2567,7 @@ static void end_bio_extent_readpage(struct bio *bio)
25672567
len = bvec->bv_len;
25682568

25692569
mirror = io_bio->mirror_num;
2570-
if (likely(uptodate && tree->ops &&
2571-
tree->ops->readpage_end_io_hook)) {
2570+
if (likely(uptodate && tree->ops)) {
25722571
ret = tree->ops->readpage_end_io_hook(io_bio, offset,
25732572
page, start, end,
25742573
mirror);
@@ -2731,7 +2730,7 @@ static int __must_check submit_one_bio(struct bio *bio, int mirror_num,
27312730
bio->bi_private = NULL;
27322731
bio_get(bio);
27332732

2734-
if (tree->ops && tree->ops->submit_bio_hook)
2733+
if (tree->ops)
27352734
ret = tree->ops->submit_bio_hook(page->mapping->host, bio,
27362735
mirror_num, bio_flags, start);
27372736
else
@@ -2746,7 +2745,7 @@ static int merge_bio(struct extent_io_tree *tree, struct page *page,
27462745
unsigned long bio_flags)
27472746
{
27482747
int ret = 0;
2749-
if (tree->ops && tree->ops->merge_bio_hook)
2748+
if (tree->ops)
27502749
ret = tree->ops->merge_bio_hook(page, offset, size, bio,
27512750
bio_flags);
27522751
return ret;

0 commit comments

Comments
 (0)