]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: standardize the prep methods
authorJens Axboe <axboe@kernel.dk>
Thu, 19 Dec 2019 21:44:26 +0000 (14:44 -0700)
committerJens Axboe <axboe@kernel.dk>
Fri, 20 Dec 2019 17:04:22 +0000 (10:04 -0700)
commitfb1a8d60d3645780e4698eb8be6cbc0ce4343e54
tree105eebc6a575f6372402598dab9ca50a47e59ddd
parentafca7d2f68b9f2218d249b795d94b2339d4878b3
io_uring: standardize the prep methods

We currently have a mix of use cases. Most of the newer ones are pretty
uniform, but we have some older ones that use different calling
calling conventions. This is confusing.

For the opcodes that currently rely on the req->io->sqe copy saving
them from reuse, add a request type struct in the io_kiocb command
union to store the data they need.

Prepare for all opcodes having a standard prep method, so we can call
it in a uniform fashion and outside of the opcode handler. This is in
preparation for passing in the 'sqe' pointer, rather than storing it
in the io_kiocb. Once we have uniform prep handlers, we can leave all
the prep work to that part, and not even pass in the sqe to the opcode
handler. This ensures that we don't reuse sqe data inadvertently.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c