summaryrefslogtreecommitdiff
path: root/io_uring/io_uring.c
diff options
context:
space:
mode:
authorKanchan Joshi <joshi.k@samsung.com>2022-08-23 19:14:41 +0300
committerJens Axboe <axboe@kernel.dk>2022-09-21 19:30:42 +0300
commit5756a3a7e713bcab705a5f0c810a2b1f7f4ecfaa (patch)
tree1052175b9867cc3e94bb2ad5bfdee560dcc0ba72 /io_uring/io_uring.c
parentde27e18e86173b704beaa19f0ee376f3305c4794 (diff)
downloadlinux-5756a3a7e713bcab705a5f0c810a2b1f7f4ecfaa.tar.xz
io_uring: add iopoll infrastructure for io_uring_cmd
Put this up in the same way as iopoll is done for regular read/write IO. Make place for storing a cookie into struct io_uring_cmd on submission. Perform the completion using the ->uring_cmd_iopoll handler. Signed-off-by: Kanchan Joshi <joshi.k@samsung.com> Signed-off-by: Pankaj Raghav <p.raghav@samsung.com> Link: https://lore.kernel.org/r/20220823161443.49436-3-joshi.k@samsung.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/io_uring.c')
-rw-r--r--io_uring/io_uring.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index d99b31aa03ab..31ac87ee17b2 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -1433,6 +1433,12 @@ static int io_iopoll_check(struct io_ring_ctx *ctx, long min)
wq_list_empty(&ctx->iopoll_list))
break;
}
+
+ if (task_work_pending(current)) {
+ mutex_unlock(&ctx->uring_lock);
+ io_run_task_work();
+ mutex_lock(&ctx->uring_lock);
+ }
ret = io_do_iopoll(ctx, !min);
if (ret < 0)
break;