]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: Remove redundant bio_get/set calls in compressed read/write paths
authorNikolay Borisov <nborisov@suse.com>
Wed, 13 Dec 2017 08:25:37 +0000 (10:25 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 22 Jan 2018 15:08:19 +0000 (16:08 +0100)
commite56ef91b5fcd90d37926b32baac82696df46414b
treed52cb516e7cb6d17228872e6e7f3c3b690b5fef0
parentdc500216331a36eb0d7a1d4f97c30eb9db5d40b1
btrfs: Remove redundant bio_get/set calls in compressed read/write paths

bio_get/set is necessary only if the bio is going to be referenced
following submissions. In the code paths where such calls are made
we don't really need them since the bio is referenced only if
btrfs_map_bio returns an error. And this function can return an error
prior to submission only. So referencing the bio is safe. Furthermore
we do call bio_endio which will consume the last reference. So let's
remove the redundant calls.

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/compression.c