io_uring: don't call work.func from sync ctx
authorPavel Begunkov <asml.silence@gmail.com>
Mon, 24 Feb 2020 08:30:16 +0000 (11:30 +0300)
committerJens Axboe <axboe@kernel.dk>
Thu, 27 Feb 2020 21:21:00 +0000 (14:21 -0700)
commita8132e9a320df75fbb87bc4fec8ba0375c9f557d
tree1301434ba76bf747354bda64a0c428545dee22d8
parent27ecb0374c807c823b6c3a2ed1bf841881891418
io_uring: don't call work.func from sync ctx

Many operations define custom work.func before getting into an io-wq.
There are several points against:
- it calls io_wq_assign_next() from outside io-wq, that may be confusing
- sync context would go unnecessary through io_req_cancelled()
- prototypes are quite different, so work!=old_work looks strange
- makes async/sync responsibilities fuzzy
- adds extra overhead

Don't call generic path and io-wq handlers from each other, but use
helpers instead

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