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

btrfs: simplify btrfs_close_bdev



Split the conditions a bit.

Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 9c6b1c4d
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -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);
}