提交 62ef7316 编写于 作者: P Pavel Begunkov 提交者: Jens Axboe

io_uring: remove setting REQ_F_MUST_PUNT in rw

io_{read,write}() {
	...
copy_iov: // prep async
  	if (!(flags & REQ_F_NOWAIT) && !file_can_poll(file))
		flags |= REQ_F_MUST_PUNT;
}

REQ_F_MUST_PUNT there is pointless, because if it happens then
REQ_F_NOWAIT is known to be _not_ set, and the request will go
async path in __io_queue_sqe() anyway. file_can_poll() check
is also repeated in arm_poll*(), so don't need it.

Remove the mentioned assignment REQ_F_MUST_PUNT in preparation
for killing the flag.
Signed-off-by: NPavel Begunkov <asml.silence@gmail.com>
Signed-off-by: NJens Axboe <axboe@kernel.dk>
上级 895aa7b1
...@@ -2920,10 +2920,6 @@ static int io_read(struct io_kiocb *req, bool force_nonblock) ...@@ -2920,10 +2920,6 @@ static int io_read(struct io_kiocb *req, bool force_nonblock)
inline_vecs, &iter); inline_vecs, &iter);
if (ret) if (ret)
goto out_free; goto out_free;
/* any defer here is final, must blocking retry */
if (!(req->flags & REQ_F_NOWAIT) &&
!file_can_poll(req->file))
req->flags |= REQ_F_MUST_PUNT;
/* if we can retry, do so with the callbacks armed */ /* if we can retry, do so with the callbacks armed */
if (io_rw_should_retry(req)) { if (io_rw_should_retry(req)) {
ret2 = io_iter_do_read(req, &iter); ret2 = io_iter_do_read(req, &iter);
...@@ -3057,10 +3053,6 @@ static int io_write(struct io_kiocb *req, bool force_nonblock) ...@@ -3057,10 +3053,6 @@ static int io_write(struct io_kiocb *req, bool force_nonblock)
inline_vecs, &iter); inline_vecs, &iter);
if (ret) if (ret)
goto out_free; goto out_free;
/* any defer here is final, must blocking retry */
if (!(req->flags & REQ_F_NOWAIT) &&
!file_can_poll(req->file))
req->flags |= REQ_F_MUST_PUNT;
return -EAGAIN; return -EAGAIN;
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册