diff options
author | Pavel Begunkov <asml.silence@gmail.com> | 2020-10-18 10:17:43 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2020-10-19 13:29:29 -0600 |
commit | 4d52f338992bfc9f494e5a7eb55f4249ab11cd66 (patch) | |
tree | 0d4184e805383561029ae2d27494df0d1f7a8131 /fs | |
parent | dd221f46f68ad9df2c1daf7a7626c75fa9bd0bf0 (diff) | |
download | linux-4d52f338992bfc9f494e5a7eb55f4249ab11cd66.tar.gz linux-4d52f338992bfc9f494e5a7eb55f4249ab11cd66.tar.bz2 linux-4d52f338992bfc9f494e5a7eb55f4249ab11cd66.zip |
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>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/io_uring.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c index 4ca8b2aeb0bd..bcd443970082 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -5097,6 +5097,7 @@ static __poll_t __io_arm_poll_handler(struct io_kiocb *req, struct io_ring_ctx *ctx = req->ctx; bool cancel = false; + INIT_HLIST_NODE(&req->hash_node); io_init_poll_iocb(poll, mask, wake_func); poll->file = req->file; poll->wait.private = req; @@ -5158,7 +5159,6 @@ static bool io_arm_poll_handler(struct io_kiocb *req) req->flags |= REQ_F_POLLED; req->apoll = apoll; - INIT_HLIST_NODE(&req->hash_node); mask = 0; if (def->pollin) @@ -5357,7 +5357,6 @@ static int io_poll_add(struct io_kiocb *req) struct io_poll_table ipt; __poll_t mask; - INIT_HLIST_NODE(&req->hash_node); ipt.pt._qproc = io_poll_queue_proc; mask = __io_arm_poll_handler(req, &req->poll, &ipt, poll->events, |