Re: [PATCH v3 03/15] mm: abstract vma_address() and introduce vma_anon_address()

From: David Hildenbrand (Arm)

Date: Mon Aug 03 2026 - 05:46:06 EST


On 7/29/26 18:48, Lorenzo Stoakes (ARM) wrote:
> Introduce __vma_address() which abstracts the VMA start page offset field
> as pgoff_start, then update vma_address() to use it.
>
> Then introduce vma_anon_address() which does the equivalent of
> vma_address(), only using the anonymous page offset of the VMA rather than
> the file-backed one.
>
> Also add an assert to ensure that the function is not called for mappings
> which are file-backed but not MAP_PRIVATE to ensure it is only used in the
> correct places.
>
> This will be necessary for determining the address of a folio's index
> within a VMA when the folio belongs to a MAP_PRIVATE file-backed VMA but
> has been CoW'd, and thus is anonymous, once the anonymous VMA page offset
> field is used for the reverse mapping.
>
> No callers are updated, so no functional change intended.
>
> Signed-off-by: Lorenzo Stoakes (ARM) <ljs@xxxxxxxxxx>
> ---

Acked-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>

--
Cheers,

David