projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e71aa91
)
block: add async version of bio_set_polled
author
Pavel Begunkov
<asml.silence@gmail.com>
Wed, 27 Oct 2021 12:21:10 +0000
(13:21 +0100)
committer
Jens Axboe
<axboe@kernel.dk>
Wed, 27 Oct 2021 12:54:58 +0000
(06:54 -0600)
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>
block/fops.c
patch
|
blob
|
history
diff --git
a/block/fops.c
b/block/fops.c
index 8594852bd344b88cfb0bd5dd2c9b2e59114bfb11..a2f492e50782f221cd4db37699437c4ff8afa2d6 100644
(file)
--- 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;