diff options
| author | Lorenzo Stoakes (ARM) <ljs@kernel.org> | 2026-07-20 15:38:34 +0100 |
|---|---|---|
| committer | Andrew Morton <akpm@linux-foundation.org> | 2026-07-26 22:50:23 -0700 |
| commit | a4ca924b33d5e948bfae64c6f7d6aced2655239d (patch) | |
| tree | 22d3f63f60c2f455f272fb07b9c06546e91c417b /include | |
| parent | 883db4d8b3f4b5e21ae43c4667252b002b8c6cb7 (diff) | |
| download | linux-next-a4ca924b33d5e948bfae64c6f7d6aced2655239d.tar.gz linux-next-a4ca924b33d5e948bfae64c6f7d6aced2655239d.zip | |
mm: introduce and use linear_folio_page_index()
This function is, for now, a placeholder; it will be used in future to
determine whether to use the virtual page index or not, based on whether
the folio is anonymous or not.
Currently it simply wraps linear_page_index(), so this does not change
behaviour.
We update callers that will, once the change is introduced to track
anonymous folios by virtual page offset if MAP_PRIVATE file-backed, need
to determine which index to use based on folio type.
No functional change intended.
Link: https://lore.kernel.org/20260720-b4-scalable-cow-virt-pgoff-v2-8-2d549757a76f@kernel.org
Signed-off-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Cc: Alistair Popple <apopple@nvidia.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: Barry Song <baohua@kernel.org>
Cc: Byungchul Park <byungchul@sk.com>
Cc: Chengming Zhou <chengming.zhou@linux.dev>
Cc: David Hildenbrand <david@kernel.org>
Cc: Dev Jain <dev.jain@arm.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Gregory Price <gourry@gourry.net>
Cc: Harry Yoo <harry@kernel.org>
Cc: "Huang, Ying" <ying.huang@linux.alibaba.com>
Cc: Jan Kara <jack@suse.cz>
Cc: Jann Horn <jannh@google.com>
Cc: Joshua Hahn <joshua.hahnjy@gmail.com>
Cc: Kees Cook <kees@kernel.org>
Cc: Lance Yang <lance.yang@linux.dev>
Cc: Liam R. Howlett <liam@infradead.org>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Miaohe Lin <linmiaohe@huawei.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Naoya Horiguchi <nao.horiguchi@gmail.com>
Cc: Nico Pache <npache@redhat.com>
Cc: Pedro Falcato <pfalcato@suse.de>
Cc: Peter Xu <peterx@redhat.com>
Cc: Rakie Kim <rakie.kim@sk.com>
Cc: Rik van Riel <riel@surriel.com>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@kernel.org>
Cc: xu xin <xu.xin16@zte.com.cn>
Cc: Zi Yan <ziy@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/pagemap.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index c9c65ba60ab3..c635c3237f52 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -1143,6 +1143,24 @@ static inline pgoff_t linear_virt_page_index(const struct vm_area_struct *vma, return pgoff; } +/** + * linear_folio_page_index() - Determine the absolute page offset of + * @address within @vma from @folio. + * @folio: The folio whose linear page index is sought. + * @vma: The VMA in which @address resides. + * @address: The address whose absolute page offset is required. + * + * For compatibility, currently identical to linear_page_index(). + * + * Returns: The absolute page offset of @address within @vma. + */ +static inline pgoff_t linear_folio_page_index(const struct folio *folio, + const struct vm_area_struct *vma, + const unsigned long address) +{ + return linear_page_index(vma, address); +} + struct wait_page_key { struct folio *folio; int bit_nr; |
