Loading fs/io_uring.c +11 −20 Original line number Diff line number Diff line Loading @@ -271,7 +271,7 @@ struct sqe_submit { unsigned short index; u32 sequence; bool has_user; bool needs_lock; bool in_async; bool needs_fixed_file; }; Loading Loading @@ -1474,13 +1474,9 @@ static int io_read(struct io_kiocb *req, const struct sqe_submit *s, ret2 = -EAGAIN; /* Catch -EAGAIN return for forced non-blocking submission */ if (!force_nonblock || ret2 != -EAGAIN) { kiocb_done(kiocb, ret2, nxt, s->needs_lock); kiocb_done(kiocb, ret2, nxt, s->in_async); } else { /* * If ->needs_lock is true, we're already in async * context. */ if (!s->needs_lock) if (!s->in_async) io_async_list_note(READ, req, iov_count); ret = -EAGAIN; } Loading Loading @@ -1518,8 +1514,7 @@ static int io_write(struct io_kiocb *req, const struct sqe_submit *s, ret = -EAGAIN; if (force_nonblock && !(kiocb->ki_flags & IOCB_DIRECT)) { /* If ->needs_lock is true, we're already in async context. */ if (!s->needs_lock) if (!s->in_async) io_async_list_note(WRITE, req, iov_count); goto out_free; } Loading Loading @@ -1548,13 +1543,9 @@ static int io_write(struct io_kiocb *req, const struct sqe_submit *s, else ret2 = loop_rw_iter(WRITE, file, kiocb, &iter); if (!force_nonblock || ret2 != -EAGAIN) { kiocb_done(kiocb, ret2, nxt, s->needs_lock); kiocb_done(kiocb, ret2, nxt, s->in_async); } else { /* * If ->needs_lock is true, we're already in async * context. */ if (!s->needs_lock) if (!s->in_async) io_async_list_note(WRITE, req, iov_count); ret = -EAGAIN; } Loading Loading @@ -2152,10 +2143,10 @@ static int __io_submit_sqe(struct io_ring_ctx *ctx, struct io_kiocb *req, return -EAGAIN; /* workqueue context doesn't hold uring_lock, grab it now */ if (s->needs_lock) if (s->in_async) mutex_lock(&ctx->uring_lock); io_iopoll_req_issued(req); if (s->needs_lock) if (s->in_async) mutex_unlock(&ctx->uring_lock); } Loading Loading @@ -2220,7 +2211,7 @@ static void io_sq_wq_submit_work(struct work_struct *work) if (!ret) { s->has_user = cur_mm != NULL; s->needs_lock = true; s->in_async = true; do { ret = __io_submit_sqe(ctx, req, s, &nxt, false); /* Loading Loading @@ -2696,7 +2687,7 @@ static int io_submit_sqes(struct io_ring_ctx *ctx, unsigned int nr, -EFAULT); } else { s.has_user = has_user; s.needs_lock = true; s.in_async = true; s.needs_fixed_file = true; io_submit_sqe(ctx, &s, statep, &link); submitted++; Loading Loading @@ -2883,7 +2874,7 @@ static int io_ring_submit(struct io_ring_ctx *ctx, unsigned int to_submit) out: s.has_user = true; s.needs_lock = false; s.in_async = false; s.needs_fixed_file = false; submit++; io_submit_sqe(ctx, &s, statep, &link); Loading Loading
fs/io_uring.c +11 −20 Original line number Diff line number Diff line Loading @@ -271,7 +271,7 @@ struct sqe_submit { unsigned short index; u32 sequence; bool has_user; bool needs_lock; bool in_async; bool needs_fixed_file; }; Loading Loading @@ -1474,13 +1474,9 @@ static int io_read(struct io_kiocb *req, const struct sqe_submit *s, ret2 = -EAGAIN; /* Catch -EAGAIN return for forced non-blocking submission */ if (!force_nonblock || ret2 != -EAGAIN) { kiocb_done(kiocb, ret2, nxt, s->needs_lock); kiocb_done(kiocb, ret2, nxt, s->in_async); } else { /* * If ->needs_lock is true, we're already in async * context. */ if (!s->needs_lock) if (!s->in_async) io_async_list_note(READ, req, iov_count); ret = -EAGAIN; } Loading Loading @@ -1518,8 +1514,7 @@ static int io_write(struct io_kiocb *req, const struct sqe_submit *s, ret = -EAGAIN; if (force_nonblock && !(kiocb->ki_flags & IOCB_DIRECT)) { /* If ->needs_lock is true, we're already in async context. */ if (!s->needs_lock) if (!s->in_async) io_async_list_note(WRITE, req, iov_count); goto out_free; } Loading Loading @@ -1548,13 +1543,9 @@ static int io_write(struct io_kiocb *req, const struct sqe_submit *s, else ret2 = loop_rw_iter(WRITE, file, kiocb, &iter); if (!force_nonblock || ret2 != -EAGAIN) { kiocb_done(kiocb, ret2, nxt, s->needs_lock); kiocb_done(kiocb, ret2, nxt, s->in_async); } else { /* * If ->needs_lock is true, we're already in async * context. */ if (!s->needs_lock) if (!s->in_async) io_async_list_note(WRITE, req, iov_count); ret = -EAGAIN; } Loading Loading @@ -2152,10 +2143,10 @@ static int __io_submit_sqe(struct io_ring_ctx *ctx, struct io_kiocb *req, return -EAGAIN; /* workqueue context doesn't hold uring_lock, grab it now */ if (s->needs_lock) if (s->in_async) mutex_lock(&ctx->uring_lock); io_iopoll_req_issued(req); if (s->needs_lock) if (s->in_async) mutex_unlock(&ctx->uring_lock); } Loading Loading @@ -2220,7 +2211,7 @@ static void io_sq_wq_submit_work(struct work_struct *work) if (!ret) { s->has_user = cur_mm != NULL; s->needs_lock = true; s->in_async = true; do { ret = __io_submit_sqe(ctx, req, s, &nxt, false); /* Loading Loading @@ -2696,7 +2687,7 @@ static int io_submit_sqes(struct io_ring_ctx *ctx, unsigned int nr, -EFAULT); } else { s.has_user = has_user; s.needs_lock = true; s.in_async = true; s.needs_fixed_file = true; io_submit_sqe(ctx, &s, statep, &link); submitted++; Loading Loading @@ -2883,7 +2874,7 @@ static int io_ring_submit(struct io_ring_ctx *ctx, unsigned int to_submit) out: s.has_user = true; s.needs_lock = false; s.in_async = false; s.needs_fixed_file = false; submit++; io_submit_sqe(ctx, &s, statep, &link); Loading