Commit 4614de74 authored by Pavel Begunkov's avatar Pavel Begunkov Committed by Jens Axboe
Browse files

io_uring/rw: clean up mshot forced sync mode



Move code forcing synchronous execution of multishot read requests out
a more generic __io_read().

Signed-off-by: default avatarPavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/4ad7b928c776d1ad59addb9fff64ef2d1fc474d5.1739919038.git.asml.silence@gmail.com


Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 74f3e875
Loading
Loading
Loading
Loading
+3 −9
Original line number Diff line number Diff line
@@ -889,15 +889,7 @@ static int __io_read(struct io_kiocb *req, unsigned int issue_flags)
	if (unlikely(ret))
		return ret;

	if (unlikely(req->opcode == IORING_OP_READ_MULTISHOT)) {
		void *cb_copy = rw->kiocb.ki_complete;

		rw->kiocb.ki_complete = NULL;
		ret = io_iter_do_read(rw, &io->iter);
		rw->kiocb.ki_complete = cb_copy;
	} else {
	ret = io_iter_do_read(rw, &io->iter);
	}

	/*
	 * Some file systems like to return -EOPNOTSUPP for an IOCB_NOWAIT
@@ -995,6 +987,8 @@ int io_read_mshot(struct io_kiocb *req, unsigned int issue_flags)
	if (!io_file_can_poll(req))
		return -EBADFD;

	/* make it sync, multishot doesn't support async execution */
	rw->kiocb.ki_complete = NULL;
	ret = __io_read(req, issue_flags);

	/*