Thread (2 messages) 2 messages, 2 authors, 2019-01-29

Re: [PATCH 07/18] io_uring: support for IO polling

From: Jeff Moyer <hidden>
Date: 2019-01-29 20:35:33
Also in: linux-block, linux-man

Jens Axboe [off-list ref] writes:
On 1/29/19 11:31 AM, Jens Axboe wrote:
quoted
quoted
The code looks a little clumsy to me.  Why not:

	while (!list_empty(&ctx->poll_list)) {
		int ret = io_do_iopoll(ctx, nr_events, min);
		if (ret)
			return ret;

		if (!min || *nr_events >= min)
			return 0;
	}

	return 1;
I think you messed up the 0/1 here, how about this:

	while (!list_empty(&ctx->poll_list)) {
		int ret;

		ret = io_do_iopoll(ctx, nr_events, min);
		if (ret < 0)
			return ret;
		if (!min || *nr_events >= min)
			return 1;
	}

	return 0;
Or I did... I think yours is correct.
maybe document the return code?  ;-)

-Jeff

--
To unsubscribe, send a message with 'unsubscribe linux-aio' in
the body to majordomo@kvack.org.  For more info on Linux AIO,
see: http://www.kvack.org/aio/
Don't email: <a href=mailto:"aart@kvack.org">aart@kvack.org</a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help