Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] mm/readahead: add kerneldoc for read_pages
@ 2026-05-08  1:53 Frederick Mayle
  0 siblings, 0 replies; only message in thread
From: Frederick Mayle @ 2026-05-08  1:53 UTC (permalink / raw)
  Cc: android-mm, kernel-team, Frederick Mayle, Andrew Morton,
	Matthew Wilcox (Oracle), Jan Kara, linux-fsdevel, linux-mm,
	linux-kernel

Formalize one of the invariants provided by the current implementation
so that callers can depend on it, as discussed in [1].

Link: https://lore.kernel.org/all/20260501061146.6e61392d125cf1847d7cc181@linux-foundation.org/ [1]
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Frederick Mayle <fmayle@google.com>
---
 mm/readahead.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/mm/readahead.c b/mm/readahead.c
index 8c12b63ccd4a..23bec5497308 100644
--- a/mm/readahead.c
+++ b/mm/readahead.c
@@ -146,6 +146,17 @@ file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping)
 }
 EXPORT_SYMBOL_GPL(file_ra_state_init);
 
+/**
+ * read_pages() - Start IO for a contiguous range of allocated folios in the
+ *                page cache.
+ * @rac: Readahead control.
+ *
+ * When read_pages() returns, it is guaranteed that all of the folios will have
+ * been processed or removed so that ``readahead_count(rac) == 0``. However,
+ * that does not imply that ``readahead_index(rac)`` will be updated to point
+ * to the end of the originally requested range because, for example, the
+ * filesystem may expand the range upwards.
+ */
 static void read_pages(struct readahead_control *rac)
 {
 	const struct address_space_operations *aops = rac->mapping->a_ops;

base-commit: 2d565cbaafd43b10b75da56e43e5db9852a56afd
-- 
2.54.0.563.g4f69b47b94-goog



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-05-08  1:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-08  1:53 [PATCH 1/1] mm/readahead: add kerneldoc for read_pages Frederick Mayle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox