btrfs: Remove redundant bio_get/bio_set pair from submit_one_bio
authorNikolay Borisov <nborisov@suse.com>
Wed, 13 Dec 2017 08:25:39 +0000 (10:25 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 22 Jan 2018 15:08:19 +0000 (16:08 +0100)
The bio is never referenced after it has been submitted so there is no
point in getting an extra reference.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent_io.c

index eee9cc5db9ff217629d7b93a240a4b5490ec1dfc..c40591486f237ef0b58e883cf545612a4fc99800 100644 (file)
@@ -2733,7 +2733,6 @@ static int __must_check submit_one_bio(struct bio *bio, int mirror_num,
        start = page_offset(page) + bvec->bv_offset;
 
        bio->bi_private = NULL;
-       bio_get(bio);
 
        if (tree->ops)
                ret = tree->ops->submit_bio_hook(tree->private_data, bio,
@@ -2741,7 +2740,6 @@ static int __must_check submit_one_bio(struct bio *bio, int mirror_num,
        else
                btrfsic_submit_bio(bio);
 
-       bio_put(bio);
        return blk_status_to_errno(ret);
 }