Skip to content

Commit 4d52f33

Browse files
isilenceaxboe
authored andcommitted
io_uring: do poll's hash_node init in common code
Move INIT_HLIST_NODE(&req->hash_node) into __io_arm_poll_handler(), so that it doesn't duplicated and common poll code would be responsible for it. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent dd221f4 commit 4d52f33

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

fs/io_uring.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5097,6 +5097,7 @@ static __poll_t __io_arm_poll_handler(struct io_kiocb *req,
50975097
struct io_ring_ctx *ctx = req->ctx;
50985098
bool cancel = false;
50995099

5100+
INIT_HLIST_NODE(&req->hash_node);
51005101
io_init_poll_iocb(poll, mask, wake_func);
51015102
poll->file = req->file;
51025103
poll->wait.private = req;
@@ -5158,7 +5159,6 @@ static bool io_arm_poll_handler(struct io_kiocb *req)
51585159

51595160
req->flags |= REQ_F_POLLED;
51605161
req->apoll = apoll;
5161-
INIT_HLIST_NODE(&req->hash_node);
51625162

51635163
mask = 0;
51645164
if (def->pollin)
@@ -5357,7 +5357,6 @@ static int io_poll_add(struct io_kiocb *req)
53575357
struct io_poll_table ipt;
53585358
__poll_t mask;
53595359

5360-
INIT_HLIST_NODE(&req->hash_node);
53615360
ipt.pt._qproc = io_poll_queue_proc;
53625361

53635362
mask = __io_arm_poll_handler(req, &req->poll, &ipt, poll->events,

0 commit comments

Comments
 (0)