diff options
author | Nikolay Borisov <nborisov@suse.com> | 2017-12-13 09:25:40 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2018-01-22 16:08:19 +0100 |
commit | 36f7894f66f286e454bf00d308b989c3423ba0da (patch) | |
tree | d1a62090f04f66a2df0a50b37b4d2306f98b18ff /fs/btrfs/inode.c | |
parent | btrfs: Remove redundant bio_get/bio_set pair from submit_one_bio (diff) | |
download | linux-36f7894f66f286e454bf00d308b989c3423ba0da.tar.xz linux-36f7894f66f286e454bf00d308b989c3423ba0da.zip |
btrfs: Remove redundant pair of bio_get/set in __btrfs_submit_dio_bio
The bio is not referenced after it has been submitted and the endio is
going to consume the sole reference on successful submission. On error,
the callers of __btrfs_submit_dio_bio do invoke bio_put so we don't
leak it either.
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 '')
-rw-r--r-- | fs/btrfs/inode.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index bacf71ccf0f2..0c0e61c6b927 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -8449,8 +8449,6 @@ __btrfs_submit_dio_bio(struct bio *bio, struct inode *inode, u64 file_offset, if (async_submit) async_submit = !atomic_read(&BTRFS_I(inode)->sync_writers); - bio_get(bio); - if (!write) { ret = btrfs_bio_wq_end_io(fs_info, bio, BTRFS_WQ_ENDIO_DATA); if (ret) @@ -8483,7 +8481,6 @@ __btrfs_submit_dio_bio(struct bio *bio, struct inode *inode, u64 file_offset, map: ret = btrfs_map_bio(fs_info, bio, 0, 0); err: - bio_put(bio); return ret; } |