提交 cab55dd4 编写于 作者: P Pavel Begunkov 提交者: Xiaoguang Wang

io_uring: remove req->in_async

to #28170604

commit bcaec089c5b64953f96a59089598643911765a43 upstream

req->in_async is not really needed, it only prevents propagation of
@nxt for fast not-blocked submissions. Remove it.
Signed-off-by: NPavel Begunkov <asml.silence@gmail.com>
Signed-off-by: NJens Axboe <axboe@kernel.dk>
Acked-by: NJoseph Qi <joseph.qi@linux.alibaba.com>
Signed-off-by: NXiaoguang Wang <xiaoguang.wang@linux.alibaba.com>
上级 7de20989
......@@ -553,7 +553,6 @@ struct io_kiocb {
* llist_node is only used for poll deferred completions
*/
struct llist_node llist_node;
bool in_async;
bool needs_fixed_file;
u8 opcode;
......@@ -1978,14 +1977,13 @@ static inline void io_rw_done(struct kiocb *kiocb, ssize_t ret)
}
}
static void kiocb_done(struct kiocb *kiocb, ssize_t ret, struct io_kiocb **nxt,
bool in_async)
static void kiocb_done(struct kiocb *kiocb, ssize_t ret, struct io_kiocb **nxt)
{
struct io_kiocb *req = container_of(kiocb, struct io_kiocb, rw.kiocb);
if (req->flags & REQ_F_CUR_POS)
req->file->f_pos = kiocb->ki_pos;
if (in_async && ret >= 0 && kiocb->ki_complete == io_complete_rw)
if (ret >= 0 && kiocb->ki_complete == io_complete_rw)
*nxt = __io_complete_rw(kiocb, ret);
else
io_rw_done(kiocb, ret);
......@@ -2276,7 +2274,7 @@ static int io_read(struct io_kiocb *req, struct io_kiocb **nxt,
/* Catch -EAGAIN return for forced non-blocking submission */
if (!force_nonblock || ret2 != -EAGAIN) {
kiocb_done(kiocb, ret2, nxt, req->in_async);
kiocb_done(kiocb, ret2, nxt);
} else {
copy_iov:
ret = io_setup_async_rw(req, io_size, iovec,
......@@ -2390,7 +2388,7 @@ static int io_write(struct io_kiocb *req, struct io_kiocb **nxt,
if (ret2 == -EOPNOTSUPP && (kiocb->ki_flags & IOCB_NOWAIT))
ret2 = -EAGAIN;
if (!force_nonblock || ret2 != -EAGAIN) {
kiocb_done(kiocb, ret2, nxt, req->in_async);
kiocb_done(kiocb, ret2, nxt);
} else {
copy_iov:
ret = io_setup_async_rw(req, io_size, iovec,
......@@ -4547,7 +4545,6 @@ static void io_wq_submit_work(struct io_wq_work **workptr)
}
if (!ret) {
req->in_async = true;
do {
ret = io_issue_sqe(req, NULL, &nxt, false);
/*
......@@ -5094,7 +5091,6 @@ static int io_submit_sqes(struct io_ring_ctx *ctx, unsigned int nr,
*mm = ctx->sqo_mm;
}
req->in_async = async;
req->needs_fixed_file = async;
trace_io_uring_submit_sqe(ctx, req->opcode, req->user_data,
true, async);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册