btrfs: merge end_write_bio and flush_write_bio
authorChristoph Hellwig <hch@lst.de>
Fri, 3 Jun 2022 07:11:02 +0000 (09:11 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 25 Jul 2022 15:45:34 +0000 (17:45 +0200)
commit9845e5ddcbfe160f4a668c51f38515729a3fb794
tree828fa4df7f3a4b533792bd2158d40f759e7c8f5b
parent2d5ac130fa498d66d91c3aa46c0f87e63664d9e9
btrfs: merge end_write_bio and flush_write_bio

Merge end_write_bio and flush_write_bio into a single submit_write_bio
helper, that either submits the bio or ends it if a negative errno was
passed in.  This consolidates a lot of duplicated checks in the callers.

Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent_io.c