[PATCH 4/5] mm: Make pgoff non-const in struct vm_fault

From: Vishal Moola (Oracle)
Date: Mon Mar 25 2024 - 18:35:19 EST


Hugetlb calculates addresses and page offsets differently from the rest of
mm. In order to pass struct vm_fault through the fault pathway we will let
hugetlb_fault() and __handle_mm_fault() set those variables themselves
instead.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@xxxxxxxxx>
---
include/linux/mm.h | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/linux/mm.h b/include/linux/mm.h
index f5a97dec5169..c6874aa7b7f0 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -507,10 +507,11 @@ struct vm_fault {
const struct {
struct vm_area_struct *vma; /* Target VMA */
gfp_t gfp_mask; /* gfp mask to be used for allocations */
- pgoff_t pgoff; /* Logical page offset based on vma */
- unsigned long address; /* Faulting virtual address - masked */
unsigned long real_address; /* Faulting virtual address - unmasked */
};
+ unsigned long address; /* Faulting virtual address - masked */
+ pgoff_t pgoff; /* Logical page offset based on vma */
+
enum fault_flag flags; /* FAULT_FLAG_xxx flags
* XXX: should really be 'const' */
pmd_t *pmd; /* Pointer to pmd entry matching
--
2.43.0