Re: [PATCH 09/10] iomap: remove unnecessary advance from iomap_iter()

Christoph Hellwig
2025-02-13T06:59:44Z

On Wed, Feb 12, 2025 at 08:57:11AM -0500, Brian Foster wrote:
> + ret = (iter->len > 0) ? 1 : 0;
> + if (iter->processed < 0)
> + ret = iter->processed;
> + else if (!advanced && !stale)
> ret = 0;

Maybe reshuffle this a bit as:

if (iter->processed < 0)
ret = iter->processed;
else if (iter->len == 0 || (!advanced && !stale))
ret = 0;
else
ret = 1;

Otherwise this looks great!