summaryrefslogtreecommitdiffstats
path: root/io_uring/rw.c
diff options
context:
space:
mode:
authorKanchan Joshi <joshi.k@samsung.com>2022-08-23 21:44:41 +0530
committerJens Axboe <axboe@kernel.dk>2022-09-21 10:30:42 -0600
commit5756a3a7e713bcab705a5f0c810a2b1f7f4ecfaa (patch)
tree1052175b9867cc3e94bb2ad5bfdee560dcc0ba72 /io_uring/rw.c
parentde27e18e86173b704beaa19f0ee376f3305c4794 (diff)
downloadlinux-5756a3a7e713bcab705a5f0c810a2b1f7f4ecfaa.tar.bz2
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/rw.c')
-rw-r--r--io_uring/rw.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/io_uring/rw.c b/io_uring/rw.c
index 76ebcfebc9a6..b6f9c756b7a1 100644
--- a/io_uring/rw.c
+++ b/io_uring/rw.c
@@ -1011,7 +1011,13 @@ int io_do_iopoll(struct io_ring_ctx *ctx, bool force_nonspin)
if (READ_ONCE(req->iopoll_completed))
break;
- ret = rw->kiocb.ki_filp->f_op->iopoll(&rw->kiocb, &iob, poll_flags);
+ if (req->opcode == IORING_OP_URING_CMD) {
+ struct io_uring_cmd *ioucmd = (struct io_uring_cmd *)rw;
+
+ ret = req->file->f_op->uring_cmd_iopoll(ioucmd);
+ } else
+ ret = rw->kiocb.ki_filp->f_op->iopoll(&rw->kiocb, &iob,
+ poll_flags);
if (unlikely(ret < 0))
return ret;
else if (ret)