io_uring: clean *local_work_add var naming
if (!first) { ... } While it reads as do something if it's not the first entry, it does exactly the opposite because "first" here is a pointer to the first entry. Remove the confusion by renaming it into "head". Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/3b8be483b52f58a524185bb88694b8a268e7e85d.1705438669.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
d381099f98
commit
e8c407717b
@ -1304,16 +1304,16 @@ static inline void io_req_local_work_add(struct io_kiocb *req, unsigned flags)
|
|||||||
{
|
{
|
||||||
struct io_ring_ctx *ctx = req->ctx;
|
struct io_ring_ctx *ctx = req->ctx;
|
||||||
unsigned nr_wait, nr_tw, nr_tw_prev;
|
unsigned nr_wait, nr_tw, nr_tw_prev;
|
||||||
struct llist_node *first;
|
struct llist_node *head;
|
||||||
|
|
||||||
if (req->flags & (REQ_F_LINK | REQ_F_HARDLINK))
|
if (req->flags & (REQ_F_LINK | REQ_F_HARDLINK))
|
||||||
flags &= ~IOU_F_TWQ_LAZY_WAKE;
|
flags &= ~IOU_F_TWQ_LAZY_WAKE;
|
||||||
|
|
||||||
first = READ_ONCE(ctx->work_llist.first);
|
head = READ_ONCE(ctx->work_llist.first);
|
||||||
do {
|
do {
|
||||||
nr_tw_prev = 0;
|
nr_tw_prev = 0;
|
||||||
if (first) {
|
if (head) {
|
||||||
struct io_kiocb *first_req = container_of(first,
|
struct io_kiocb *first_req = container_of(head,
|
||||||
struct io_kiocb,
|
struct io_kiocb,
|
||||||
io_task_work.node);
|
io_task_work.node);
|
||||||
/*
|
/*
|
||||||
@ -1328,8 +1328,8 @@ static inline void io_req_local_work_add(struct io_kiocb *req, unsigned flags)
|
|||||||
nr_tw = INT_MAX;
|
nr_tw = INT_MAX;
|
||||||
|
|
||||||
req->nr_tw = nr_tw;
|
req->nr_tw = nr_tw;
|
||||||
req->io_task_work.node.next = first;
|
req->io_task_work.node.next = head;
|
||||||
} while (!try_cmpxchg(&ctx->work_llist.first, &first,
|
} while (!try_cmpxchg(&ctx->work_llist.first, &head,
|
||||||
&req->io_task_work.node));
|
&req->io_task_work.node));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1340,7 +1340,7 @@ static inline void io_req_local_work_add(struct io_kiocb *req, unsigned flags)
|
|||||||
* is similar to the wait/wawke task state sync.
|
* is similar to the wait/wawke task state sync.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!first) {
|
if (!head) {
|
||||||
if (ctx->flags & IORING_SETUP_TASKRUN_FLAG)
|
if (ctx->flags & IORING_SETUP_TASKRUN_FLAG)
|
||||||
atomic_or(IORING_SQ_TASKRUN, &ctx->rings->sq_flags);
|
atomic_or(IORING_SQ_TASKRUN, &ctx->rings->sq_flags);
|
||||||
if (ctx->has_evfd)
|
if (ctx->has_evfd)
|
||||||
|
Loading…
Reference in New Issue
Block a user