On Wed, Apr 01, 2020 at 12:20:38PM -0700, Matthew Wilcox wrote: > On Wed, Apr 01, 2020 at 08:42:48AM -0700, Christoph Hellwig wrote: > > OTOH the len argument / return value seems like something that would > > seems useful in the iter structure. That would require renaming the > > current len to something like total_len.. > > Ah, I remembered why I didn't do it that way. For more complicated > users (eg readahead ...), we want to be able to pass an errno here. > Then iomap_iter() will call ops->iomap_end() and return the errno > you passed in, and we can terminate the loop. Once we have the iter struct we can and should separate the written counter from the errno, as that is a much cleaner interface. The prime reason I avoided that earlier was to keep the number of arguments down, and even that was a bad reason in retrospective.