diff options
author | David Sterba <dsterba@suse.com> | 2017-02-17 09:59:35 -0500 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2017-02-28 08:29:24 -0500 |
commit | 20c9801d393d9f077c476f40440b481daaccb9d6 (patch) | |
tree | c7dbce8b7c6908bcfde03baee494d9aa44ddade8 | |
parent | 4d53dddbec671bcb64a936a3d2b7bf1ce2252ed0 (diff) |
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 <dsterba@suse.com>
-rw-r--r-- | fs/btrfs/extent_io.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 94beb758e8aa..0786985a8cc5 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c | |||
@@ -2567,8 +2567,7 @@ static void end_bio_extent_readpage(struct bio *bio) | |||
2567 | len = bvec->bv_len; | 2567 | len = bvec->bv_len; |
2568 | 2568 | ||
2569 | mirror = io_bio->mirror_num; | 2569 | mirror = io_bio->mirror_num; |
2570 | if (likely(uptodate && tree->ops && | 2570 | if (likely(uptodate && tree->ops)) { |
2571 | tree->ops->readpage_end_io_hook)) { | ||
2572 | ret = tree->ops->readpage_end_io_hook(io_bio, offset, | 2571 | ret = tree->ops->readpage_end_io_hook(io_bio, offset, |
2573 | page, start, end, | 2572 | page, start, end, |
2574 | mirror); | 2573 | mirror); |
@@ -2731,7 +2730,7 @@ static int __must_check submit_one_bio(struct bio *bio, int mirror_num, | |||
2731 | bio->bi_private = NULL; | 2730 | bio->bi_private = NULL; |
2732 | bio_get(bio); | 2731 | bio_get(bio); |
2733 | 2732 | ||
2734 | if (tree->ops && tree->ops->submit_bio_hook) | 2733 | if (tree->ops) |
2735 | ret = tree->ops->submit_bio_hook(page->mapping->host, bio, | 2734 | ret = tree->ops->submit_bio_hook(page->mapping->host, bio, |
2736 | mirror_num, bio_flags, start); | 2735 | mirror_num, bio_flags, start); |
2737 | else | 2736 | else |
@@ -2746,7 +2745,7 @@ static int merge_bio(struct extent_io_tree *tree, struct page *page, | |||
2746 | unsigned long bio_flags) | 2745 | unsigned long bio_flags) |
2747 | { | 2746 | { |
2748 | int ret = 0; | 2747 | int ret = 0; |
2749 | if (tree->ops && tree->ops->merge_bio_hook) | 2748 | if (tree->ops) |
2750 | ret = tree->ops->merge_bio_hook(page, offset, size, bio, | 2749 | ret = tree->ops->merge_bio_hook(page, offset, size, bio, |
2751 | bio_flags); | 2750 | bio_flags); |
2752 | return ret; | 2751 | return ret; |