block: add a poll_fn callback to struct request_queue

That we we can also poll non blk-mq queues.  Mostly needed for
the NVMe multipath code, but could also be useful elsewhere.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Christoph Hellwig
2017-11-02 21:29:54 +03:00
committed by Jens Axboe
parent 8ddcd65325
commit ea435e1b93
8 changed files with 25 additions and 16 deletions

View File

@@ -407,7 +407,7 @@ int swap_readpage(struct page *page, bool do_poll)
if (!READ_ONCE(bio->bi_private))
break;
if (!blk_mq_poll(disk->queue, qc))
if (!blk_poll(disk->queue, qc))
break;
}
__set_current_state(TASK_RUNNING);