Re: [PATCH v2 6/7] iomap: advance the iter directly on unshare range

Brian Foster
2025-01-28T13:55:19Z

On Mon, Jan 27, 2025 at 09:39:01PM -0800, Christoph Hellwig wrote:
> On Wed, Jan 22, 2025 at 08:34:33AM -0500, Brian Foster wrote:
> > + size_t bytes = iomap_length(iter);
>
> > + bytes = min_t(u64, SIZE_MAX, bytes);
>
> bytes needs to be a u64 for the min logic to work on 32-bit systems.
>

Ah, thanks. FYI, I also have the following change from followon work to
fold into this to completely remove advances via iter.processed:

- if (!iomap_want_unshare_iter(iter))
- return bytes;
+ if (!iomap_want_unshare_iter(iter)) {
+ iomap_iter_advance(iter, bytes);
+ return 0;
+ }

And the analogous change in the next patch for zero range (unwritten &&
!range_dirty) as well.

Finally, I'm still working through converting the rest of the ops to use
iomap_iter_advance(), but I was thinking about renaming iter.processed
to iter.status as a final step. Thoughts on a rename in general or on
the actual name?

Brian