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>
Mon, 2 Mar 2020 21:04:24 +0000 (14:04 -0700)
commit5ea62161167eb8297249d3f4dc63741016f01413
treee5186a98a5ae86de4b79d59e13f366e3e0f48462
parente441d1cf20e1b9fc443e6130488d41e1941aae82
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