diff options
author | Pavel Begunkov <asml.silence@gmail.com> | 2020-03-04 14:14:12 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2020-03-04 19:39:07 +0100 |
commit | e9fd939654f17651ff65e7e55aa6934d29eb4335 (patch) | |
tree | 7593c9acafd221b91bc1b746828f545c0350223a /fs/io-wq.h | |
parent | io-wq: optimise out *next_work() double lock (diff) | |
download | linux-e9fd939654f17651ff65e7e55aa6934d29eb4335.tar.xz linux-e9fd939654f17651ff65e7e55aa6934d29eb4335.zip |
io_uring/io-wq: forward submission ref to async
First it changes io-wq interfaces. It replaces {get,put}_work() with
free_work(), which guaranteed to be called exactly once. It also enforces
free_work() callback to be non-NULL.
io_uring follows the changes and instead of putting a submission reference
in io_put_req_async_completion(), it will be done in io_free_work(). As
removes io_get_work() with corresponding refcount_inc(), the ref balance
is maintained.
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/io-wq.h')
-rw-r--r-- | fs/io-wq.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/io-wq.h b/fs/io-wq.h index a0978d6958f0..2117b9a4f161 100644 --- a/fs/io-wq.h +++ b/fs/io-wq.h @@ -81,14 +81,12 @@ struct io_wq_work { *(work) = (struct io_wq_work){ .func = _func }; \ } while (0) \ -typedef void (get_work_fn)(struct io_wq_work *); -typedef void (put_work_fn)(struct io_wq_work *); +typedef void (free_work_fn)(struct io_wq_work *); struct io_wq_data { struct user_struct *user; - get_work_fn *get_work; - put_work_fn *put_work; + free_work_fn *free_work; }; struct io_wq *io_wq_create(unsigned bounded, struct io_wq_data *data); |