diff options
| author | Frederick Mayle <fmayle@google.com> | 2026-05-12 23:31:36 +0300 |
|---|---|---|
| committer | Andrew Morton <akpm@linux-foundation.org> | 2026-06-03 01:22:15 +0300 |
| commit | 418bffb6ba2474f445305dd2a5173d8a9ce446b3 (patch) | |
| tree | e86f8a61052b3d156a49ae0c0a6b8e2400318ef6 /include/linux | |
| parent | c516c365d9915bafc3d2cdeac50a984da22729b5 (diff) | |
| download | linux-418bffb6ba2474f445305dd2a5173d8a9ce446b3.tar.xz | |
mm/readahead: simplify page_cache_ra_unbounded loop counter reset
Minor cleanup, no behavior change intended.
`read_pages` ensures that `ractl->_nr_pages` is zero before it returns, so
the `ractl->_nr_pages` term in these expressions contributes nothing.
This seems to have been true since the statements were introduced in
commit f615bd5c4725f ("mm/readahead: Handle ractl nr_pages being
modified").
The new expression has an intuitive explanation. When filesystems perform
readahead, they increment `ractl->_index` by the number of pages
processed, so, after `read_pages` returns, `ractl->_index` points to the
first page after those already processed. `index` points to the first
page considered in the loop. So, `ractl->_index - index` is the number of
pages processed by the loop so far.
Link: https://lore.kernel.org/20260512203154.754075-3-fmayle@google.com
Signed-off-by: Frederick Mayle <fmayle@google.com>
Cc: Jan Kara <jack@suse.cz>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions
