path: root/block/genhd.c
diff options
authorMing Lei <>2022-03-04 21:08:03 -0500
committerMike Snitzer <>2022-03-09 12:21:35 -0500
commit69fe0f29892077f14b56e2a479b6bcf533209d53 (patch)
tree26b37dbcc06ed8b12ff07482eb2fe060b89d3e1d /block/genhd.c
parent168678d765d3659fddffe80a70668488066a9569 (diff)
block: add ->poll_bio to block_device_operations
Prepare for supporting IO polling for bio-based driver. Add ->poll_bio callback so that bio-based driver can provide their own logic for polling bio. Also fix ->submit_bio_bio typo in comment block above __submit_bio_noacct. Reviewed-by: Christoph Hellwig <> Reviewed-by: Jens Axboe <> Signed-off-by: Ming Lei <> Signed-off-by: Mike Snitzer <>
Diffstat (limited to 'block/genhd.c')
1 files changed, 4 insertions, 0 deletions
diff --git a/block/genhd.c b/block/genhd.c
index e351fac41bf2..1ed46a6f94f5 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -410,6 +410,10 @@ int __must_check device_add_disk(struct device *parent, struct gendisk *disk,
struct device *ddev = disk_to_dev(disk);
int ret;
+ /* Only makes sense for bio-based to set ->poll_bio */
+ if (queue_is_mq(disk->queue) && disk->fops->poll_bio)
+ return -EINVAL;
* The disk queue should now be all set with enough information about
* the device for the elevator code to pick an adequate default