On Thu, Apr 10, 2025 at 01:42:23PM +0800, Gou Hao wrote:Thank you, i will change the log in next patch.
prior to the loop, $i is either the first !uptodate block, orCapitalize the first word in the sentence and use up the 73 characters
it's past $last. Assuming there's no overflow (there's no combination
of huge folios and tiny blksize) then yeah, there's no point in
retesting that the same block $i is uptodate since we hold the folio
lock so nobody else could have set uptodate.
available for the commit log:
In iomap_adjust_read_range, i is either the first !uptodate block, or it
is past last for the second loop looking for trailing uptodate blocks.
Assuming there's no overflow (there's no combination of huge folios and
tiny blksize) then yeah, there is no point in retesting that the same
block pointed to by i is uptodate since we hold the folio lock so nobody
else could have set it uptodate.
Yes, it is better. I will test this./* truncate len if we find any trailing uptodate block(s) */A bit nitpicky, but I find a i++ in the initialization condition of a
- for ( ; i <= last; i++) {
+ for (i++; i <= last; i++) {
for loop a bit odd.
What about turning this into a:
while (++i <= last) {
?