OSDN Git Service

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)
commit06b76d44ba25e52711dc7cc4fc75b50907bc6b8e
tree105eebc6a575f6372402598dab9ca50a47e59ddd
parent26a61679f10c6f041726411964b172565021c2eb
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