Skip to content

Commit

Permalink
io_uring/poll: move poll execution helpers higher up
Browse files Browse the repository at this point in the history
commit e84b01a upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
axboe authored and gregkh committed Feb 16, 2024
1 parent 5f42b16 commit 995d020
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions io_uring/poll.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 995d020

Please sign in to comment.