Thread (389 messages) 389 messages, 13 authors, 2021-08-21

Re: [PATCH v14 014/138] mm/filemap: Add folio_next_index()

From: Matthew Wilcox <willy@infradead.org>
Date: 2021-07-20 17:56:04
Also in: linux-fsdevel, lkml

On Tue, Jul 20, 2021 at 01:42:11PM +0300, Mike Rapoport wrote:
quoted
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index f7c165b5991f..bd0e7e91bfd4 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -406,6 +406,17 @@ static inline pgoff_t folio_index(struct folio *folio)
         return folio->index;
 }
 
+/**
+ * folio_next_index - Get the index of the next folio.
+ * @folio: The current folio.
+ *
+ * Return: The index of the folio which follows this folio in the file.
+ */
Maybe note that index is in units of pages?
I don't think this is the place to explain that.  Remember, we already
have:

 * @index: Offset within the file, in units of pages.  For anonymous pages,
 *    this is the index from the beginning of the mmap.

and I don't want to explain every term of art in every function
description.  I think if you're reading this, you can follow the
link to the struct folio description and see what an index is.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help