Skip to content

Commit e8c4077

Browse files
isilenceaxboe
authored andcommitted
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>
1 parent d381099 commit e8c4077

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

io_uring/io_uring.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1304,16 +1304,16 @@ static inline void io_req_local_work_add(struct io_kiocb *req, unsigned flags)
13041304
{
13051305
struct io_ring_ctx *ctx = req->ctx;
13061306
unsigned nr_wait, nr_tw, nr_tw_prev;
1307-
struct llist_node *first;
1307+
struct llist_node *head;
13081308

13091309
if (req->flags & (REQ_F_LINK | REQ_F_HARDLINK))
13101310
flags &= ~IOU_F_TWQ_LAZY_WAKE;
13111311

1312-
first = READ_ONCE(ctx->work_llist.first);
1312+
head = READ_ONCE(ctx->work_llist.first);
13131313
do {
13141314
nr_tw_prev = 0;
1315-
if (first) {
1316-
struct io_kiocb *first_req = container_of(first,
1315+
if (head) {
1316+
struct io_kiocb *first_req = container_of(head,
13171317
struct io_kiocb,
13181318
io_task_work.node);
13191319
/*
@@ -1328,8 +1328,8 @@ static inline void io_req_local_work_add(struct io_kiocb *req, unsigned flags)
13281328
nr_tw = INT_MAX;
13291329

13301330
req->nr_tw = nr_tw;
1331-
req->io_task_work.node.next = first;
1332-
} while (!try_cmpxchg(&ctx->work_llist.first, &first,
1331+
req->io_task_work.node.next = head;
1332+
} while (!try_cmpxchg(&ctx->work_llist.first, &head,
13331333
&req->io_task_work.node));
13341334

13351335
/*
@@ -1340,7 +1340,7 @@ static inline void io_req_local_work_add(struct io_kiocb *req, unsigned flags)
13401340
* is similar to the wait/wawke task state sync.
13411341
*/
13421342

1343-
if (!first) {
1343+
if (!head) {
13441344
if (ctx->flags & IORING_SETUP_TASKRUN_FLAG)
13451345
atomic_or(IORING_SQ_TASKRUN, &ctx->rings->sq_flags);
13461346
if (ctx->has_evfd)

0 commit comments

Comments
 (0)