mirror of
https://github.com/lkl/linux.git
synced 2025-12-19 16:13:19 +09:00
mm: remove enum page_entry_size
Remove the unnecessary encoding of page order into an enum and pass the page order directly. That lets us get rid of pe_order(). The switch constructs have to be changed to if/else constructs to prevent GCC from warning on builds with 3-level page tables where PMD_ORDER and PUD_ORDER have the same value. If you are looking at this commit because your driver stopped compiling, look at the previous commit as well and audit your driver to be sure it doesn't depend on mmap_lock being held in its ->huge_fault method. [willy@infradead.org: use "order %u" to match the (non dev_t) style] Link: https://lkml.kernel.org/r/ZOUYekbtTv+n8hYf@casper.infradead.org Link: https://lkml.kernel.org/r/20230818202335.2739663-4-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
committed by
Andrew Morton
parent
40d49a3c9e
commit
1d024e7a8d
@@ -532,13 +532,6 @@ struct vm_fault {
|
||||
*/
|
||||
};
|
||||
|
||||
/* page entry size for vm->huge_fault() */
|
||||
enum page_entry_size {
|
||||
PE_SIZE_PTE = 0,
|
||||
PE_SIZE_PMD,
|
||||
PE_SIZE_PUD,
|
||||
};
|
||||
|
||||
/*
|
||||
* These are the virtual MM functions - opening of an area, closing and
|
||||
* unmapping it (needed to keep files on disk up-to-date etc), pointer
|
||||
@@ -562,8 +555,7 @@ struct vm_operations_struct {
|
||||
int (*mprotect)(struct vm_area_struct *vma, unsigned long start,
|
||||
unsigned long end, unsigned long newflags);
|
||||
vm_fault_t (*fault)(struct vm_fault *vmf);
|
||||
vm_fault_t (*huge_fault)(struct vm_fault *vmf,
|
||||
enum page_entry_size pe_size);
|
||||
vm_fault_t (*huge_fault)(struct vm_fault *vmf, unsigned int order);
|
||||
vm_fault_t (*map_pages)(struct vm_fault *vmf,
|
||||
pgoff_t start_pgoff, pgoff_t end_pgoff);
|
||||
unsigned long (*pagesize)(struct vm_area_struct * area);
|
||||
|
||||
Reference in New Issue
Block a user