mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-05 02:19:51 +00:00
btrfs: simplify btrfs_close_bdev
Split the conditions a bit. Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
9c6b1c4de1
commit
08ffcae8c9
1 changed files with 5 additions and 3 deletions
|
@ -903,12 +903,14 @@ static void free_device_rcu(struct rcu_head *head)
|
||||||
|
|
||||||
static void btrfs_close_bdev(struct btrfs_device *device)
|
static void btrfs_close_bdev(struct btrfs_device *device)
|
||||||
{
|
{
|
||||||
if (device->bdev && device->writeable) {
|
if (!device->bdev)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (device->writeable) {
|
||||||
sync_blockdev(device->bdev);
|
sync_blockdev(device->bdev);
|
||||||
invalidate_bdev(device->bdev);
|
invalidate_bdev(device->bdev);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (device->bdev)
|
|
||||||
blkdev_put(device->bdev, device->mode);
|
blkdev_put(device->bdev, device->mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue