diff options
author | Pavel Begunkov <asml.silence@gmail.com> | 2023-01-09 14:46:04 +0000 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2023-01-29 15:17:40 -0700 |
commit | bd550173acc2dc782d9c57852f6b6e71f5d9a159 (patch) | |
tree | 0431701e41dc1d96e079bfdccdc2ab65fdb493e7 /io_uring | |
parent | dde40322ae20f2d6b0bcb781a9eedcfc7ca3aa73 (diff) |
io_uring: refactor io_wake_function
Remove a local variable ctx in io_wake_function(), we don't need it if
io_should_wake() triggers it to wake up.
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/e60eb1008aebe286aab7d34c772ed01c447bddb1.1673274244.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring')
-rw-r--r-- | io_uring/io_uring.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index fdea6fbc3fad..5e1a0845e4b6 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -2439,15 +2439,13 @@ static inline bool io_should_wake(struct io_wait_queue *iowq) static int io_wake_function(struct wait_queue_entry *curr, unsigned int mode, int wake_flags, void *key) { - struct io_wait_queue *iowq = container_of(curr, struct io_wait_queue, - wq); - struct io_ring_ctx *ctx = iowq->ctx; + struct io_wait_queue *iowq = container_of(curr, struct io_wait_queue, wq); /* * Cannot safely flush overflowed CQEs from here, ensure we wake up * the task, and the next invocation will do it. */ - if (io_should_wake(iowq) || io_has_work(ctx)) + if (io_should_wake(iowq) || io_has_work(iowq->ctx)) return autoremove_wake_function(curr, mode, wake_flags, key); return -1; } |