Skip to content

Commit aac56c7

Browse files
committed
Merge branch 'for-7.1/io_uring' into for-next
* for-7.1/io_uring: io_uring/rw: clean up __io_read() obsolete comment and early returns
2 parents 60936f5 + c3196f8 commit aac56c7

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

io_uring/rw.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -962,21 +962,21 @@ static int __io_read(struct io_kiocb *req, struct io_br_sel *sel,
962962
if (ret == -EAGAIN) {
963963
/* If we can poll, just do that. */
964964
if (io_file_can_poll(req))
965-
return -EAGAIN;
965+
return ret;
966966
/* IOPOLL retry should happen for io-wq threads */
967967
if (!force_nonblock && !(req->flags & REQ_F_IOPOLL))
968-
goto done;
968+
return ret;
969969
/* no retry on NONBLOCK nor RWF_NOWAIT */
970970
if (req->flags & REQ_F_NOWAIT)
971-
goto done;
971+
return ret;
972972
ret = 0;
973973
} else if (ret == -EIOCBQUEUED) {
974974
return IOU_ISSUE_SKIP_COMPLETE;
975975
} else if (ret == req->cqe.res || ret <= 0 || !force_nonblock ||
976976
(req->flags & REQ_F_NOWAIT) || !need_complete_io(req) ||
977977
(issue_flags & IO_URING_F_MULTISHOT)) {
978978
/* read all, failed, already did sync or don't want to retry */
979-
goto done;
979+
return ret;
980980
}
981981

982982
/*
@@ -1019,8 +1019,7 @@ static int __io_read(struct io_kiocb *req, struct io_br_sel *sel,
10191019
kiocb->ki_flags &= ~IOCB_WAITQ;
10201020
iov_iter_restore(&io->iter, &io->iter_state);
10211021
} while (ret > 0);
1022-
done:
1023-
/* it's faster to check here than delegate to kfree */
1022+
10241023
return ret;
10251024
}
10261025

0 commit comments

Comments
 (0)