summaryrefslogtreecommitdiffstats
path: root/block/bdev.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2024-04-12 07:21:45 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2024-05-03 02:00:37 +0200
commitac2b6f9dee8f41d5e9162959a8bbd2c8047ee382 (patch)
tree1f28cb4449ce1258e6b0b793607bce2383ea5d87 /block/bdev.c
parentbdev: move ->bd_write_holder into ->__bd_flags (diff)
downloadlinux-ac2b6f9dee8f41d5e9162959a8bbd2c8047ee382.tar.xz
linux-ac2b6f9dee8f41d5e9162959a8bbd2c8047ee382.zip
bdev: move ->bd_has_subit_bio to ->__bd_flags
In bdev_alloc() we have all flags initialized to false, so assignment to ->bh_has_submit_bio n there is a no-op unless we have partno != 0 and flag already set on entire device. In device_add_disk() we have just allocated the block_device in question and it had been a full-device one, so the flag is guaranteed to be still clear when we get to assignment. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'block/bdev.c')
-rw-r--r--block/bdev.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/block/bdev.c b/block/bdev.c
index 9df9a59f0900..fae30eae7741 100644
--- a/block/bdev.c
+++ b/block/bdev.c
@@ -414,10 +414,8 @@ struct block_device *bdev_alloc(struct gendisk *disk, u8 partno)
atomic_set(&bdev->__bd_flags, partno);
bdev->bd_inode = inode;
bdev->bd_queue = disk->queue;
- if (partno)
- bdev->bd_has_submit_bio = disk->part0->bd_has_submit_bio;
- else
- bdev->bd_has_submit_bio = false;
+ if (partno && bdev_test_flag(disk->part0, BD_HAS_SUBMIT_BIO))
+ bdev_set_flag(bdev, BD_HAS_SUBMIT_BIO);
bdev->bd_stats = alloc_percpu(struct disk_stats);
if (!bdev->bd_stats) {
iput(inode);