On Wed, Jan 08, 2025 at 11:10:48PM -0800, Christoph Hellwig wrote: > On Fri, Dec 13, 2024 at 09:36:08AM -0500, Brian Foster wrote: > > + loff_t pos = iter->pos; > > + loff_t length = iomap_length(iter); > > AFAICS we could just do away with these local variables as they should > never get out of sync with the values in the iter. If so I'd love to see > that one. If they can get out of sync and we actually need them, that > would warrant a comment. > > Otherwise this looks good to me, and the same applies to the next two > patches. > Hmm.. they should not get out of sync, but that wasn't necessarily the point here. For one, this is trying to be incremental and highlight the actual logic changes, but also I didn't want to just go and replace every usage of pos with iter->pos when it only needs to be read at a certain point. This might be a little more clear after the (non-squashed) fbatch patches which move where pos is sampled (to handle that it can change at that point) and drop some of the pos function params, but if we still want to clean that up at the end I'd rather do it as a standalone patch at that point. All that said, length is only used for the bytes check so I can probably kill that one off here. Brian