提交 157dc813 编写于 作者: J Jens Axboe

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: NJens Axboe <axboe@kernel.dk>
上级 fcde59fe
...@@ -4176,6 +4176,16 @@ static inline int io_rw_prep_async(struct io_kiocb *req, int rw) ...@@ -4176,6 +4176,16 @@ static inline int io_rw_prep_async(struct io_kiocb *req, int rw)
return 0; 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() * 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. * 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) ...@@ -8136,9 +8146,9 @@ static int io_req_prep_async(struct io_kiocb *req)
switch (req->opcode) { switch (req->opcode) {
case IORING_OP_READV: case IORING_OP_READV:
return io_rw_prep_async(req, READ); return io_readv_prep_async(req);
case IORING_OP_WRITEV: case IORING_OP_WRITEV:
return io_rw_prep_async(req, WRITE); return io_writev_prep_async(req);
case IORING_OP_SENDMSG: case IORING_OP_SENDMSG:
return io_sendmsg_prep_async(req); return io_sendmsg_prep_async(req);
case IORING_OP_RECVMSG: case IORING_OP_RECVMSG:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册