io_uring: remove definite false if expression
PATCH 1/1 io_uring: remove definite false if expression
if file->f_flags has O_NONBLOCK, io_file_supports_nowait() returns true which means the if condition in this patch isn't necessary.
Signed-off-by Hao Xu <[email protected]>
--- fs/io_uring.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
fs/io_uring.c +3 -5
@@ -3034,12 +3034,10 @@ static int io_prep_rw(struct io_kiocb *req, const struct io_uring_sqe *sqe)return ret;/* -* If the file is marked O_NONBLOCK, still allow retry for it if it -* supports async. Otherwise it's impossible to use O_NONBLOCK files -* reliably. If not, or it IOCB_NOWAIT is set, don't retry. +* If the file is marked O_NONBLOCK, still allow retry for it. +* If IOCB_NOWAIT is set, don't retry. */ -if ((kiocb->ki_flags &IOCB_NOWAIT ) || - ((file->f_flags &O_NONBLOCK ) && !io_file_supports_nowait (req))) +if (kiocb->ki_flags &IOCB_NOWAIT ) req->flags |=REQ_F_NOWAIT ;if (ctx->flags &IORING_SETUP_IOPOLL ) {
base-commit: 9e9d83faa9f59266aa772148e32c265c8ad194d3
Signature · 1 line
2.25.1