Commit b6c7db32 authored by Hao Xu's avatar Hao Xu Committed by Jens Axboe

io_uring: better to use REQ_F_IO_DRAIN for req->flags

It's better to use REQ_F_IO_DRAIN for req->flags rather than
IOSQE_IO_DRAIN though they have same value.
Signed-off-by: default avatarHao Xu <haoxu@linux.alibaba.com>
Link: https://lore.kernel.org/r/20211125092103.224502-3-haoxu@linux.alibaba.comSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent e302f104
...@@ -7095,10 +7095,10 @@ static void io_init_req_drain(struct io_kiocb *req) ...@@ -7095,10 +7095,10 @@ static void io_init_req_drain(struct io_kiocb *req)
* If we need to drain a request in the middle of a link, drain * If we need to drain a request in the middle of a link, drain
* the head request and the next request/link after the current * the head request and the next request/link after the current
* link. Considering sequential execution of links, * link. Considering sequential execution of links,
* IOSQE_IO_DRAIN will be maintained for every request of our * REQ_F_IO_DRAIN will be maintained for every request of our
* link. * link.
*/ */
head->flags |= IOSQE_IO_DRAIN | REQ_F_FORCE_ASYNC; head->flags |= REQ_F_IO_DRAIN | REQ_F_FORCE_ASYNC;
ctx->drain_next = true; ctx->drain_next = true;
} }
} }
...@@ -7149,7 +7149,7 @@ static int io_init_req(struct io_ring_ctx *ctx, struct io_kiocb *req, ...@@ -7149,7 +7149,7 @@ static int io_init_req(struct io_ring_ctx *ctx, struct io_kiocb *req,
if (unlikely(ctx->drain_next) && !ctx->submit_state.link.head) { if (unlikely(ctx->drain_next) && !ctx->submit_state.link.head) {
ctx->drain_next = false; ctx->drain_next = false;
ctx->drain_active = true; ctx->drain_active = true;
req->flags |= IOSQE_IO_DRAIN | REQ_F_FORCE_ASYNC; req->flags |= REQ_F_IO_DRAIN | REQ_F_FORCE_ASYNC;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment