diff options
author | Jens Axboe <axboe@kernel.dk> | 2022-05-23 17:16:21 -0600 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2022-05-31 02:50:06 -0600 |
commit | 157dc813b47ab2adb4bc8a08491887bc161284c2 (patch) | |
tree | c023e78dc06f3f4472577e7c756ea3746820d346 /fs/io_uring.c | |
parent | fcde59feb1affb6d56aecadc3868df4631480da5 (diff) | |
download | lwn-157dc813b47ab2adb4bc8a08491887bc161284c2.tar.gz lwn-157dc813b47ab2adb4bc8a08491887bc161284c2.zip |
io_uring: unify calling convention for async prep handling
Make them consistent in preparation for defining a req async prep
handler. The readv/writev requests share a prep handler, move it one
level down so the initial one is consistent with the others.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/io_uring.c')
-rw-r--r-- | fs/io_uring.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c index d5ef7b71e060..4d2bdcc9fd78 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -4176,6 +4176,16 @@ static inline int io_rw_prep_async(struct io_kiocb *req, int rw) return 0; } +static int io_readv_prep_async(struct io_kiocb *req) +{ + return io_rw_prep_async(req, READ); +} + +static int io_writev_prep_async(struct io_kiocb *req) +{ + return io_rw_prep_async(req, WRITE); +} + /* * This is our waitqueue callback handler, registered through __folio_lock_async() * when we initially tried to do the IO with the iocb armed our waitqueue. @@ -8136,9 +8146,9 @@ static int io_req_prep_async(struct io_kiocb *req) switch (req->opcode) { case IORING_OP_READV: - return io_rw_prep_async(req, READ); + return io_readv_prep_async(req); case IORING_OP_WRITEV: - return io_rw_prep_async(req, WRITE); + return io_writev_prep_async(req); case IORING_OP_SENDMSG: return io_sendmsg_prep_async(req); case IORING_OP_RECVMSG: |