Commit 20c9801d authored by David Sterba's avatar David Sterba

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: default avatarDavid Sterba <dsterba@suse.com>
parent 4d53dddb
...@@ -2567,8 +2567,7 @@ static void end_bio_extent_readpage(struct bio *bio) ...@@ -2567,8 +2567,7 @@ static void end_bio_extent_readpage(struct bio *bio)
len = bvec->bv_len; len = bvec->bv_len;
mirror = io_bio->mirror_num; mirror = io_bio->mirror_num;
if (likely(uptodate && tree->ops && if (likely(uptodate && tree->ops)) {
tree->ops->readpage_end_io_hook)) {
ret = tree->ops->readpage_end_io_hook(io_bio, offset, ret = tree->ops->readpage_end_io_hook(io_bio, offset,
page, start, end, page, start, end,
mirror); mirror);
...@@ -2731,7 +2730,7 @@ static int __must_check submit_one_bio(struct bio *bio, int mirror_num, ...@@ -2731,7 +2730,7 @@ static int __must_check submit_one_bio(struct bio *bio, int mirror_num,
bio->bi_private = NULL; bio->bi_private = NULL;
bio_get(bio); bio_get(bio);
if (tree->ops && tree->ops->submit_bio_hook) if (tree->ops)
ret = tree->ops->submit_bio_hook(page->mapping->host, bio, ret = tree->ops->submit_bio_hook(page->mapping->host, bio,
mirror_num, bio_flags, start); mirror_num, bio_flags, start);
else else
...@@ -2746,7 +2745,7 @@ static int merge_bio(struct extent_io_tree *tree, struct page *page, ...@@ -2746,7 +2745,7 @@ static int merge_bio(struct extent_io_tree *tree, struct page *page,
unsigned long bio_flags) unsigned long bio_flags)
{ {
int ret = 0; int ret = 0;
if (tree->ops && tree->ops->merge_bio_hook) if (tree->ops)
ret = tree->ops->merge_bio_hook(page, offset, size, bio, ret = tree->ops->merge_bio_hook(page, offset, size, bio,
bio_flags); bio_flags);
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