summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2017-06-06 19:22:55 +0200
committerDavid Sterba <dsterba@suse.com>2018-03-31 01:26:52 +0200
commit5c2b1fd7531d837bb9a6079d4e730a889b0e303d (patch)
tree5da44460121702c48d1f93478eaa91dd8e85148c
parent6ca1765b366e3a678e143de0decc3d1d39c15429 (diff)
downloadlinux-stable-5c2b1fd7531d837bb9a6079d4e730a889b0e303d.tar.gz
linux-stable-5c2b1fd7531d837bb9a6079d4e730a889b0e303d.tar.bz2
linux-stable-5c2b1fd7531d837bb9a6079d4e730a889b0e303d.zip
btrfs: assume that bio_ret is always valid in submit_extent_page
All callers pass a valid pointer so we can drop the redundant checks. The call to submit_one_bio never happend and can be removed. Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r--fs/btrfs/extent_io.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index da46e9372262..cf6253bc5126 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -2758,6 +2758,7 @@ static int merge_bio(struct extent_io_tree *tree, struct page *page,
/*
* @opf: bio REQ_OP_* and REQ_* flags as one value
+ * @bio_ret: must be valid pointer, newly allocated bio will be stored there
*/
static int submit_extent_page(unsigned int opf, struct extent_io_tree *tree,
struct writeback_control *wbc,
@@ -2778,7 +2779,9 @@ static int submit_extent_page(unsigned int opf, struct extent_io_tree *tree,
size_t page_size = min_t(size_t, size, PAGE_SIZE);
sector_t sector = offset >> 9;
- if (bio_ret && *bio_ret) {
+ ASSERT(bio_ret);
+
+ if (*bio_ret) {
bio = *bio_ret;
if (old_compressed)
contig = bio->bi_iter.bi_sector == sector;
@@ -2813,10 +2816,7 @@ static int submit_extent_page(unsigned int opf, struct extent_io_tree *tree,
wbc_account_io(wbc, page, page_size);
}
- if (bio_ret)
- *bio_ret = bio;
- else
- ret = submit_one_bio(bio, mirror_num, bio_flags);
+ *bio_ret = bio;
return ret;
}