Commit a1119fb0 authored by Jens Axboe's avatar Jens Axboe
Browse files

io_uring: cleanly separate request types for iopoll



After the addition of iopoll support for passthrough, there's a bit of
a mixup here. Clean it up and get rid of the casting for the passthrough
command type.

Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 585079b6
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -1000,7 +1000,7 @@ int io_do_iopoll(struct io_ring_ctx *ctx, bool force_nonspin)

	wq_list_for_each(pos, start, &ctx->iopoll_list) {
		struct io_kiocb *req = container_of(pos, struct io_kiocb, comp_list);
		struct io_rw *rw = io_kiocb_to_cmd(req, struct io_rw);
		struct file *file = req->file;
		int ret;

		/*
@@ -1012,12 +1012,15 @@ int io_do_iopoll(struct io_ring_ctx *ctx, bool force_nonspin)
			break;

		if (req->opcode == IORING_OP_URING_CMD) {
			struct io_uring_cmd *ioucmd = (struct io_uring_cmd *)rw;
			struct io_uring_cmd *ioucmd;

			ioucmd = io_kiocb_to_cmd(req, struct io_uring_cmd);
			ret = file->f_op->uring_cmd_iopoll(ioucmd);
		} else {
			struct io_rw *rw = io_kiocb_to_cmd(req, struct io_rw);

			ret = req->file->f_op->uring_cmd_iopoll(ioucmd);
		} else
			ret = rw->kiocb.ki_filp->f_op->iopoll(&rw->kiocb, &iob,
							poll_flags);
			ret = file->f_op->iopoll(&rw->kiocb, &iob, poll_flags);
		}
		if (unlikely(ret < 0))
			return ret;
		else if (ret)