On Mon, 29 Jun 2026 13:23:27 +0100 Lorenzo Stoakes [off-list ref] wrote:
There are many instances in which linear_page_index() (as well as
linear_page_delta()) is open-coded, which is confusing and inconsistent.
Additionally, vma->vm_pgoff doesn't necessarily make it clear that this is
the page offset of the start of the VMA range.
Doing so also aids greppability.
So use vma_start_pgoff() in favour of directly accessing vma->vm_pgoff, and
linear_page_index() where we can.
This also lays the ground for future changes which will add an anonymous
page offset in order to be able to index MAP_PRIVATE-file backed anon
folios in terms of their virtual page offset.
No functional change intended.
Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
---
include/linux/huge_mm.h | 1 +
include/linux/hugetlb.h | 3 +--
include/linux/pagemap.h | 2 +-
mm/damon/vaddr.c | 5 +++--
I quickly looked only the DAMON part. Looks nice and cleaner, thank you!
Reviewed-by: SJ Park <sj@kernel.org>
Thanks,
SJ
[...]