diff options
author | Pavel Begunkov <asml.silence@gmail.com> | 2021-10-27 13:21:10 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-10-27 06:54:58 -0600 |
commit | 842e39b013465a279fb60348427b9309427a29de (patch) | |
tree | 6beb6b210c8d5ab8936ae4159be1b34eb4a76d73 | |
parent | e71aa913e26543768d5acaef50abe14913c6c496 (diff) |
block: add async version of bio_set_polled
If we know that a iocb is async we can optimise bio_set_polled() a bit,
add a new helper bio_set_polled_async().
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/8fa137885164a5d05fadcff4c3521da8d5a83d00.1635337135.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r-- | block/fops.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/block/fops.c b/block/fops.c index 8594852bd344..a2f492e50782 100644 --- a/block/fops.c +++ b/block/fops.c @@ -358,14 +358,13 @@ static ssize_t __blkdev_direct_IO_async(struct kiocb *iocb, task_io_account_write(bio->bi_iter.bi_size); } - if (iocb->ki_flags & IOCB_NOWAIT) - bio->bi_opf |= REQ_NOWAIT; - if (iocb->ki_flags & IOCB_HIPRI) { - bio_set_polled(bio, iocb); + bio->bi_opf |= REQ_POLLED | REQ_NOWAIT; submit_bio(bio); WRITE_ONCE(iocb->private, bio); } else { + if (iocb->ki_flags & IOCB_NOWAIT) + bio->bi_opf |= REQ_NOWAIT; submit_bio(bio); } return -EIOCBQUEUED; |