From: Nick Piggin Document fault_data fields and flags a bit better. Signed-off-by: Nick Piggin Signed-off-by: Andrew Morton --- include/linux/mm.h | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff -puN include/linux/mm.h~mm-document-fault_data-and-flags include/linux/mm.h --- a/include/linux/mm.h~mm-document-fault_data-and-flags +++ a/include/linux/mm.h @@ -199,8 +199,8 @@ extern unsigned int kobjsize(const void */ extern pgprot_t protection_map[16]; -#define FAULT_FLAG_WRITE 0x01 -#define FAULT_FLAG_NONLINEAR 0x02 +#define FAULT_FLAG_WRITE 0x01 /* Write fault (read fault if not set)*/ +#define FAULT_FLAG_NONLINEAR 0x02 /* Nonlinear pte fault */ /* * fault_data is filled in the the pagefault handler and passed to the @@ -208,15 +208,17 @@ extern pgprot_t protection_map[16]; * 'type', which is the type of fault if a page is returned, or the type * of error if NULL is returned. * - * pgoff should be used in favour of address, if possible. If pgoff is - * used, one may set VM_CAN_NONLINEAR in the vma->vm_flags to get - * nonlinear mapping support. + * pgoff should be used rather than address to find the page, if possible. + * If pgoff is used, one may set VM_CAN_NONLINEAR in the vma->vm_flags to get + * nonlinear mapping support (because nonlinear pgoffs are not based on + * address). Address could be used for auxiliary input (eg. for page coloring). */ struct fault_data { - unsigned long address; - pgoff_t pgoff; - unsigned int flags; - int type; + unsigned long address; /* Virtual address where the fault occurred */ + pgoff_t pgoff; /* Logical page offset, based on the vma */ + unsigned int flags; /* FAULT_FLAG_xxx flags, described above */ + + int type; /* VM_FAULT_xxx value, set by fault handler */ }; /* _