diff options
| author | Al Viro <viro@zeniv.linux.org.uk> | 2024-04-12 01:21:45 -0400 |
|---|---|---|
| committer | Al Viro <viro@zeniv.linux.org.uk> | 2024-05-02 20:00:37 -0400 |
| commit | ac2b6f9dee8f41d5e9162959a8bbd2c8047ee382 (patch) | |
| tree | 1f28cb4449ce1258e6b0b793607bce2383ea5d87 /block/genhd.c | |
| parent | 4c80105e3909b3aff634a40daa9c29059ce03d6a (diff) | |
| download | linux-ac2b6f9dee8f41d5e9162959a8bbd2c8047ee382.tar.gz linux-ac2b6f9dee8f41d5e9162959a8bbd2c8047ee382.tar.bz2 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/genhd.c')
| -rw-r--r-- | block/genhd.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/block/genhd.c b/block/genhd.c index bb29a68e1d67..19cd1a31fa80 100644 --- a/block/genhd.c +++ b/block/genhd.c @@ -413,7 +413,8 @@ int __must_check device_add_disk(struct device *parent, struct gendisk *disk, elevator_init_mq(disk->queue); /* Mark bdev as having a submit_bio, if needed */ - disk->part0->bd_has_submit_bio = disk->fops->submit_bio != NULL; + if (disk->fops->submit_bio) + bdev_set_flag(disk->part0, BD_HAS_SUBMIT_BIO); /* * If the driver provides an explicit major number it also must provide |
