]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - include/linux/mm.h
mm: add orig_pte field into vm_fault
[mirror_ubuntu-bionic-kernel.git] / include / linux / mm.h
index a92c8d73aeafc5f5bafa551eacc284f86bad50d0..39c17a2efcea085a76a1296ec1ff1814fd680bc5 100644 (file)
@@ -292,10 +292,14 @@ extern pgprot_t protection_map[16];
  * pgoff should be used in favour of virtual_address, if possible.
  */
 struct vm_fault {
+       struct vm_area_struct *vma;     /* Target VMA */
        unsigned int flags;             /* FAULT_FLAG_xxx flags */
        gfp_t gfp_mask;                 /* gfp mask to be used for allocations */
        pgoff_t pgoff;                  /* Logical page offset based on vma */
-       void __user *virtual_address;   /* Faulting virtual address */
+       unsigned long address;          /* Faulting virtual address */
+       pmd_t *pmd;                     /* Pointer to pmd entry matching
+                                        * the 'address' */
+       pte_t orig_pte;                 /* Value of PTE at the time of fault */
 
        struct page *cow_page;          /* Handler may choose to COW */
        struct page *page;              /* ->fault handlers should return a
@@ -309,19 +313,7 @@ struct vm_fault {
                                         * VM_FAULT_DAX_LOCKED and fill in
                                         * entry here.
                                         */
-};
-
-/*
- * Page fault context: passes though page fault handler instead of endless list
- * of function arguments.
- */
-struct fault_env {
-       struct vm_area_struct *vma;     /* Target VMA */
-       unsigned long address;          /* Faulting virtual address */
-       unsigned int flags;             /* FAULT_FLAG_xxx flags */
-       pmd_t *pmd;                     /* Pointer to pmd entry matching
-                                        * the 'address'
-                                        */
+       /* These three entries are valid only while holding ptl lock */
        pte_t *pte;                     /* Pointer to pte entry matching
                                         * the 'address'. NULL if the page
                                         * table hasn't been allocated.
@@ -351,7 +343,7 @@ struct vm_operations_struct {
        int (*fault)(struct vm_area_struct *vma, struct vm_fault *vmf);
        int (*pmd_fault)(struct vm_area_struct *, unsigned long address,
                                                pmd_t *, unsigned int flags);
-       void (*map_pages)(struct fault_env *fe,
+       void (*map_pages)(struct vm_fault *vmf,
                        pgoff_t start_pgoff, pgoff_t end_pgoff);
 
        /* notification that a previously read-only page is about to become
@@ -625,7 +617,7 @@ static inline pte_t maybe_mkwrite(pte_t pte, struct vm_area_struct *vma)
        return pte;
 }
 
-int alloc_set_pte(struct fault_env *fe, struct mem_cgroup *memcg,
+int alloc_set_pte(struct vm_fault *vmf, struct mem_cgroup *memcg,
                struct page *page);
 #endif
 
@@ -1274,15 +1266,12 @@ extern int access_remote_vm(struct mm_struct *mm, unsigned long addr,
 long get_user_pages_remote(struct task_struct *tsk, struct mm_struct *mm,
                            unsigned long start, unsigned long nr_pages,
                            unsigned int gup_flags, struct page **pages,
-                           struct vm_area_struct **vmas);
+                           struct vm_area_struct **vmas, int *locked);
 long get_user_pages(unsigned long start, unsigned long nr_pages,
                            unsigned int gup_flags, struct page **pages,
                            struct vm_area_struct **vmas);
 long get_user_pages_locked(unsigned long start, unsigned long nr_pages,
                    unsigned int gup_flags, struct page **pages, int *locked);
-long __get_user_pages_unlocked(struct task_struct *tsk, struct mm_struct *mm,
-                              unsigned long start, unsigned long nr_pages,
-                              struct page **pages, unsigned int gup_flags);
 long get_user_pages_unlocked(unsigned long start, unsigned long nr_pages,
                    struct page **pages, unsigned int gup_flags);
 int get_user_pages_fast(unsigned long start, int nr_pages, int write,
@@ -2097,7 +2086,7 @@ extern void truncate_inode_pages_final(struct address_space *);
 
 /* generic vm_area_ops exported for stackable file systems */
 extern int filemap_fault(struct vm_area_struct *, struct vm_fault *);
-extern void filemap_map_pages(struct fault_env *fe,
+extern void filemap_map_pages(struct vm_fault *vmf,
                pgoff_t start_pgoff, pgoff_t end_pgoff);
 extern int filemap_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf);