io_uring: use blk_queue_nowait() to check if NOWAIT supported
authorJeffle Xu <jefflexu@linux.alibaba.com>
Mon, 19 Oct 2020 08:59:42 +0000 (16:59 +0800)
committerJens Axboe <axboe@kernel.dk>
Mon, 19 Oct 2020 13:32:36 +0000 (07:32 -0600)
commit 021a24460dc2 ("block: add QUEUE_FLAG_NOWAIT") adds a new helper
function blk_queue_nowait() to check if the bdev supports handling of
REQ_NOWAIT or not. Since then bio-based dm device can also support
REQ_NOWAIT, and currently only dm-linear supports that since
commit 6abc49468eea ("dm: add support for REQ_NOWAIT and enable it for
linear target").

Signed-off-by: Jeffle Xu <jefflexu@linux.alibaba.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c

index e1726f45746148c4e3eee65a32bdebc1166a262b..0f4a9c45061d92af0e77cb2928b053f5dd3ba5e5 100644 (file)
@@ -2693,7 +2693,7 @@ static struct file *__io_file_get(struct io_submit_state *state, int fd)
 static bool io_bdev_nowait(struct block_device *bdev)
 {
 #ifdef CONFIG_BLOCK
-       return !bdev || queue_is_mq(bdev_get_queue(bdev));
+       return !bdev || blk_queue_nowait(bdev_get_queue(bdev));
 #else
        return true;
 #endif