Loading io_uring/opdef.c +2 −2 Original line number Diff line number Diff line Loading @@ -66,7 +66,7 @@ const struct io_issue_def io_issue_defs[] = { .iopoll = 1, .iopoll_queue = 1, .vectored = 1, .prep = io_prep_rw, .prep = io_prep_rwv, .issue = io_read, }, [IORING_OP_WRITEV] = { Loading @@ -80,7 +80,7 @@ const struct io_issue_def io_issue_defs[] = { .iopoll = 1, .iopoll_queue = 1, .vectored = 1, .prep = io_prep_rw, .prep = io_prep_rwv, .issue = io_write, }, [IORING_OP_FSYNC] = { Loading io_uring/rw.c +15 −7 Original line number Diff line number Diff line Loading @@ -110,15 +110,23 @@ int io_prep_rw(struct io_kiocb *req, const struct io_uring_sqe *sqe) rw->addr = READ_ONCE(sqe->addr); rw->len = READ_ONCE(sqe->len); rw->flags = READ_ONCE(sqe->rw_flags); return 0; } /* Have to do this validation here, as this is in io_read() rw->len might * have chanaged due to buffer selection */ if (req->opcode == IORING_OP_READV && req->flags & REQ_F_BUFFER_SELECT) { ret = io_iov_buffer_select_prep(req); if (ret) int io_prep_rwv(struct io_kiocb *req, const struct io_uring_sqe *sqe) { int ret; ret = io_prep_rw(req, sqe); if (unlikely(ret)) return ret; } /* * Have to do this validation here, as this is in io_read() rw->len * might have chanaged due to buffer selection */ if (req->flags & REQ_F_BUFFER_SELECT) return io_iov_buffer_select_prep(req); return 0; } Loading io_uring/rw.h +1 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ struct io_async_rw { }; int io_prep_rw(struct io_kiocb *req, const struct io_uring_sqe *sqe); int io_prep_rwv(struct io_kiocb *req, const struct io_uring_sqe *sqe); int io_read(struct io_kiocb *req, unsigned int issue_flags); int io_readv_prep_async(struct io_kiocb *req); int io_write(struct io_kiocb *req, unsigned int issue_flags); Loading Loading
io_uring/opdef.c +2 −2 Original line number Diff line number Diff line Loading @@ -66,7 +66,7 @@ const struct io_issue_def io_issue_defs[] = { .iopoll = 1, .iopoll_queue = 1, .vectored = 1, .prep = io_prep_rw, .prep = io_prep_rwv, .issue = io_read, }, [IORING_OP_WRITEV] = { Loading @@ -80,7 +80,7 @@ const struct io_issue_def io_issue_defs[] = { .iopoll = 1, .iopoll_queue = 1, .vectored = 1, .prep = io_prep_rw, .prep = io_prep_rwv, .issue = io_write, }, [IORING_OP_FSYNC] = { Loading
io_uring/rw.c +15 −7 Original line number Diff line number Diff line Loading @@ -110,15 +110,23 @@ int io_prep_rw(struct io_kiocb *req, const struct io_uring_sqe *sqe) rw->addr = READ_ONCE(sqe->addr); rw->len = READ_ONCE(sqe->len); rw->flags = READ_ONCE(sqe->rw_flags); return 0; } /* Have to do this validation here, as this is in io_read() rw->len might * have chanaged due to buffer selection */ if (req->opcode == IORING_OP_READV && req->flags & REQ_F_BUFFER_SELECT) { ret = io_iov_buffer_select_prep(req); if (ret) int io_prep_rwv(struct io_kiocb *req, const struct io_uring_sqe *sqe) { int ret; ret = io_prep_rw(req, sqe); if (unlikely(ret)) return ret; } /* * Have to do this validation here, as this is in io_read() rw->len * might have chanaged due to buffer selection */ if (req->flags & REQ_F_BUFFER_SELECT) return io_iov_buffer_select_prep(req); return 0; } Loading
io_uring/rw.h +1 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ struct io_async_rw { }; int io_prep_rw(struct io_kiocb *req, const struct io_uring_sqe *sqe); int io_prep_rwv(struct io_kiocb *req, const struct io_uring_sqe *sqe); int io_read(struct io_kiocb *req, unsigned int issue_flags); int io_readv_prep_async(struct io_kiocb *req); int io_write(struct io_kiocb *req, unsigned int issue_flags); Loading