projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9c6b1c4
)
btrfs: simplify btrfs_close_bdev
author
David Sterba
<
[email protected]
>
Mon, 19 Jun 2017 14:55:35 +0000
(16:55 +0200)
committer
David Sterba
<
[email protected]
>
Mon, 22 Jan 2018 15:08:12 +0000
(16:08 +0100)
Split the conditions a bit.
Signed-off-by: David Sterba <
[email protected]
>
fs/btrfs/volumes.c
patch
|
blob
|
history
diff --git
a/fs/btrfs/volumes.c
b/fs/btrfs/volumes.c
index 372f515808d1f7bf94e50e4c4398e3b9cd10e813..96c6c0fa15315a3b485bfd62e4f0783424b825dd 100644
(file)
--- a/
fs/btrfs/volumes.c
+++ b/
fs/btrfs/volumes.c
@@
-903,13
+903,15
@@
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);
+ blkdev_put(device->bdev, device->mode);
}
static void btrfs_prepare_close_one_device(struct btrfs_device *device)