io_uring: do grab_env() just before punting
authorPavel Begunkov <asml.silence@gmail.com>
Mon, 29 Jun 2020 16:18:43 +0000 (19:18 +0300)
committerJens Axboe <axboe@kernel.dk>
Tue, 30 Jun 2020 14:40:00 +0000 (08:40 -0600)
commitcbdcb4357c000861b77369c34e110fa893d23607
tree7c7a9d3417a5b5bb7f8129a7e55b91a109e3642c
parentdebb85f496c9cc70663eac31d3ad9153839c844c
io_uring: do grab_env() just before punting

Currently io_steal_work() is disabled, and every linked request should
go through task_work for initialisation. Do io_req_work_grab_env()
just before io-wq punting and for the whole link, so any request
reachable by io_steal_work() is prepared.

This is also interesting for another reason -- it localises
io_req_work_grab_env() into one place just before io-wq punting, helping
to to better manage req->work lifetime and add some neat
cleanup/optimisations later.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c