On Wed, Mar 1, 2023 at 9:38 AM Matthew Wilcox willy@infradead.org wrote:
The first caller was pagecache_read() in fs/ext4/verity.c. I think that's waiting for next merge window.
Ahh.
It does make sense in that context -- the caller genuinely wants to loop over multiple folios because its read may cross folio boundaries, so it makes sense.
Hmm. Can we make it a lot more obvious that you really have to do that some way?
Perhaps in the name ("partial" somewhere or something) or even with a __must_check on the return value or similar?
Because as-is, it really implies "copy to folio", and the natural reaction would be to loop over folios.
The ext4 code you quote doesn't loop over folios, it loops over bytes, so in that context the function does indeed make sense.
Linus