diff options
author | Jens Axboe <axboe@kernel.dk> | 2024-01-29 11:52:54 -0700 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2024-01-29 13:19:17 -0700 |
commit | e84b01a880f635e3084a361afba41f95ff500d12 (patch) | |
tree | 2168feea6559b15e0d02ab3f5832ea0280359733 /io_uring | |
parent | c79f52f0656eeb3e4a12f7f358f760077ae111b6 (diff) | |
download | lwn-e84b01a880f635e3084a361afba41f95ff500d12.tar.gz lwn-e84b01a880f635e3084a361afba41f95ff500d12.zip |
io_uring/poll: move poll execution helpers higher up
In preparation for calling __io_poll_execute() higher up, move the
functions to avoid forward declarations.
No functional changes in this patch.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring')
-rw-r--r-- | io_uring/poll.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/io_uring/poll.c b/io_uring/poll.c index d59b74a99d4e..785a5b191003 100644 --- a/io_uring/poll.c +++ b/io_uring/poll.c @@ -228,6 +228,26 @@ enum { IOU_POLL_REISSUE = 3, }; +static void __io_poll_execute(struct io_kiocb *req, int mask) +{ + unsigned flags = 0; + + io_req_set_res(req, mask, 0); + req->io_task_work.func = io_poll_task_func; + + trace_io_uring_task_add(req, mask); + + if (!(req->flags & REQ_F_POLL_NO_LAZY)) + flags = IOU_F_TWQ_LAZY_WAKE; + __io_req_task_work_add(req, flags); +} + +static inline void io_poll_execute(struct io_kiocb *req, int res) +{ + if (io_poll_get_ownership(req)) + __io_poll_execute(req, res); +} + /* * All poll tw should go through this. Checks for poll events, manages * references, does rewait, etc. @@ -364,26 +384,6 @@ void io_poll_task_func(struct io_kiocb *req, struct io_tw_state *ts) } } -static void __io_poll_execute(struct io_kiocb *req, int mask) -{ - unsigned flags = 0; - - io_req_set_res(req, mask, 0); - req->io_task_work.func = io_poll_task_func; - - trace_io_uring_task_add(req, mask); - - if (!(req->flags & REQ_F_POLL_NO_LAZY)) - flags = IOU_F_TWQ_LAZY_WAKE; - __io_req_task_work_add(req, flags); -} - -static inline void io_poll_execute(struct io_kiocb *req, int res) -{ - if (io_poll_get_ownership(req)) - __io_poll_execute(req, res); -} - static void io_poll_cancel_req(struct io_kiocb *req) { io_poll_mark_cancelled(req); |