summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent_io.c
diff options
context:
space:
mode:
authorNikolay Borisov2018-11-27 19:57:58 +0100
committerDavid Sterba2018-12-17 14:51:42 +0100
commitda12fe5414f922d896289f037515096f189c66da (patch)
tree09e8347a8723697fd480bd8d44285481d36f06c1 /fs/btrfs/extent_io.c
parentbtrfs: cleanup the useless DEFINE_WAIT in cleanup_transaction (diff)
downloadkernel-qcow2-linux-da12fe5414f922d896289f037515096f189c66da.tar.gz
kernel-qcow2-linux-da12fe5414f922d896289f037515096f189c66da.tar.xz
kernel-qcow2-linux-da12fe5414f922d896289f037515096f189c66da.zip
btrfs: Refactor btrfs_merge_bio_hook
This function really checks whether adding more data to the bio will straddle a stripe/chunk. So first let's give it a more appropraite name - btrfs_bio_fits_in_stripe. Secondly, the offset parameter was never used to just remove it. Thirdly, pages are submitted to either btree or data inodes so it's guaranteed that tree->ops is set so replace the check with an ASSERT. Finally, document the parameters of the function. No functional changes. Signed-off-by: Nikolay Borisov <nborisov@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/extent_io.c')
-rw-r--r--fs/btrfs/extent_io.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 7aafdec49dc3..b2769e92b556 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -2759,8 +2759,8 @@ static int submit_extent_page(unsigned int opf, struct extent_io_tree *tree,
else
contig = bio_end_sector(bio) == sector;
- if (tree->ops && btrfs_merge_bio_hook(page, offset, page_size,
- bio, bio_flags))
+ ASSERT(tree->ops);
+ if (btrfs_bio_fits_in_stripe(page, page_size, bio, bio_flags))
can_merge = false;
if (prev_bio_flags != bio_flags || !contig || !can_merge ||