Commit 08ffcae8 authored by David Sterba's avatar David Sterba

btrfs: simplify btrfs_close_bdev

Split the conditions a bit.
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 9c6b1c4d
......@@ -903,12 +903,14 @@ static void free_device_rcu(struct rcu_head *head)
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);
invalidate_bdev(device->bdev);
}
if (device->bdev)
blkdev_put(device->bdev, device->mode);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment