]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: decrement number of open devices after closing the device not before
authorJohannes Thumshirn <jthumshirn@suse.de>
Tue, 26 Nov 2019 08:40:05 +0000 (09:40 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 20 Jan 2020 15:40:53 +0000 (16:40 +0100)
commitdc3f0a2fedf8cd29dc457aa29c2b5f71303d8329
tree059bbadcaddd1effd9ce17a411d289d0ce55e82e
parentfca57acad8a927811cb85dc2ba59eac8d164d638
btrfs: decrement number of open devices after closing the device not before

In btrfs_close_one_device we're decrementing the number of open devices
before we're calling btrfs_close_bdev().

As there is no intermediate exit between these points in this function it
is technically OK to do so, but it makes the code a bit harder to understand.

Move both operations closer together and move the decrement step after
btrfs_close_bdev().

Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/volumes.c