diff options
author | Pavel Begunkov <asml.silence@gmail.com> | 2021-08-09 13:04:13 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-08-23 13:07:59 -0600 |
commit | 6a290a1442b45afb55d6a87619b716e5031d7c3e (patch) | |
tree | 0aab095abc79f42fe05994c5fb991b9879c686cc /fs/io_uring.c | |
parent | e73c5c7cd3e21bb95032a9ed3593c000f17f9ab8 (diff) | |
download | lwn-6a290a1442b45afb55d6a87619b716e5031d7c3e.tar.gz lwn-6a290a1442b45afb55d6a87619b716e5031d7c3e.zip |
io_uring: move io_put_task() definition
Move the function in the source file as it is to get rid of forward
declarations.
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/33d917d69e4206557c75a5b98fe22bcdf77ce47d.1628471125.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/io_uring.c')
-rw-r--r-- | fs/io_uring.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c index 03c32d392735..a536b2509d6d 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -1052,7 +1052,6 @@ static bool io_cqring_fill_event(struct io_ring_ctx *ctx, u64 user_data, static void io_put_req(struct io_kiocb *req); static void io_put_req_deferred(struct io_kiocb *req, int nr); static void io_dismantle_req(struct io_kiocb *req); -static void io_put_task(struct task_struct *task, int nr); static struct io_kiocb *io_prep_linked_timeout(struct io_kiocb *req); static void io_queue_linked_timeout(struct io_kiocb *req); static int __io_register_rsrc_update(struct io_ring_ctx *ctx, unsigned type, @@ -1571,6 +1570,17 @@ static inline void req_ref_get(struct io_kiocb *req) atomic_inc(&req->refs); } +/* must to be called somewhat shortly after putting a request */ +static inline void io_put_task(struct task_struct *task, int nr) +{ + struct io_uring_task *tctx = task->io_uring; + + percpu_counter_sub(&tctx->inflight, nr); + if (unlikely(atomic_read(&tctx->in_idle))) + wake_up(&tctx->wait); + put_task_struct_many(task, nr); +} + static bool io_cqring_event_overflow(struct io_ring_ctx *ctx, u64 user_data, long res, unsigned int cflags) { @@ -1809,17 +1819,6 @@ static void io_dismantle_req(struct io_kiocb *req) } } -/* must to be called somewhat shortly after putting a request */ -static inline void io_put_task(struct task_struct *task, int nr) -{ - struct io_uring_task *tctx = task->io_uring; - - percpu_counter_sub(&tctx->inflight, nr); - if (unlikely(atomic_read(&tctx->in_idle))) - wake_up(&tctx->wait); - put_task_struct_many(task, nr); -} - static void __io_free_req(struct io_kiocb *req) { struct io_ring_ctx *ctx = req->ctx; |