io_uring/rw: split io_read() into a helper
Commita08d195b58upstream. Add __io_read() which does the grunt of the work, leaving the completion side to the new io_read(). No functional changes in this patch. Reviewed-by: Gabriel Krisman Bertazi <krisman@suse.de> Signed-off-by: Jens Axboe <axboe@kernel.dk> (cherry picked from commita08d195b58) Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
d9831a655e
commit
6c27fc6a78
+13
-2
@@ -712,7 +712,7 @@ static int io_rw_init_file(struct io_kiocb *req, fmode_t mode)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int io_read(struct io_kiocb *req, unsigned int issue_flags)
|
||||
static int __io_read(struct io_kiocb *req, unsigned int issue_flags)
|
||||
{
|
||||
struct io_rw *rw = io_kiocb_to_cmd(req, struct io_rw);
|
||||
struct io_rw_state __s, *s = &__s;
|
||||
@@ -857,7 +857,18 @@ done:
|
||||
/* it's faster to check here then delegate to kfree */
|
||||
if (iovec)
|
||||
kfree(iovec);
|
||||
return kiocb_done(req, ret, issue_flags);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int io_read(struct io_kiocb *req, unsigned int issue_flags)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = __io_read(req, issue_flags);
|
||||
if (ret >= 0)
|
||||
return kiocb_done(req, ret, issue_flags);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static bool io_kiocb_start_write(struct io_kiocb *req, struct kiocb *kiocb)
|
||||
|
||||
Reference in New Issue
Block a user