Commit cb8d8633 authored by David Hildenbrand's avatar David Hildenbrand Committed by Andrew Morton

mm: remove VM_FAULT_WRITE

All users -- GUP and KSM -- are gone, let's just remove it.

Link: https://lkml.kernel.org/r/20221021101141.84170-4-david@redhat.comSigned-off-by: default avatarDavid Hildenbrand <david@redhat.com>
Acked-by: default avatarPeter Xu <peterx@redhat.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Jason Gunthorpe <jgg@nvidia.com>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 58f595c6
...@@ -929,7 +929,6 @@ typedef __bitwise unsigned int vm_fault_t; ...@@ -929,7 +929,6 @@ typedef __bitwise unsigned int vm_fault_t;
* @VM_FAULT_OOM: Out Of Memory * @VM_FAULT_OOM: Out Of Memory
* @VM_FAULT_SIGBUS: Bad access * @VM_FAULT_SIGBUS: Bad access
* @VM_FAULT_MAJOR: Page read from storage * @VM_FAULT_MAJOR: Page read from storage
* @VM_FAULT_WRITE: Special case for get_user_pages
* @VM_FAULT_HWPOISON: Hit poisoned small page * @VM_FAULT_HWPOISON: Hit poisoned small page
* @VM_FAULT_HWPOISON_LARGE: Hit poisoned large page. Index encoded * @VM_FAULT_HWPOISON_LARGE: Hit poisoned large page. Index encoded
* in upper bits * in upper bits
...@@ -950,7 +949,6 @@ enum vm_fault_reason { ...@@ -950,7 +949,6 @@ enum vm_fault_reason {
VM_FAULT_OOM = (__force vm_fault_t)0x000001, VM_FAULT_OOM = (__force vm_fault_t)0x000001,
VM_FAULT_SIGBUS = (__force vm_fault_t)0x000002, VM_FAULT_SIGBUS = (__force vm_fault_t)0x000002,
VM_FAULT_MAJOR = (__force vm_fault_t)0x000004, VM_FAULT_MAJOR = (__force vm_fault_t)0x000004,
VM_FAULT_WRITE = (__force vm_fault_t)0x000008,
VM_FAULT_HWPOISON = (__force vm_fault_t)0x000010, VM_FAULT_HWPOISON = (__force vm_fault_t)0x000010,
VM_FAULT_HWPOISON_LARGE = (__force vm_fault_t)0x000020, VM_FAULT_HWPOISON_LARGE = (__force vm_fault_t)0x000020,
VM_FAULT_SIGSEGV = (__force vm_fault_t)0x000040, VM_FAULT_SIGSEGV = (__force vm_fault_t)0x000040,
...@@ -976,7 +974,6 @@ enum vm_fault_reason { ...@@ -976,7 +974,6 @@ enum vm_fault_reason {
{ VM_FAULT_OOM, "OOM" }, \ { VM_FAULT_OOM, "OOM" }, \
{ VM_FAULT_SIGBUS, "SIGBUS" }, \ { VM_FAULT_SIGBUS, "SIGBUS" }, \
{ VM_FAULT_MAJOR, "MAJOR" }, \ { VM_FAULT_MAJOR, "MAJOR" }, \
{ VM_FAULT_WRITE, "WRITE" }, \
{ VM_FAULT_HWPOISON, "HWPOISON" }, \ { VM_FAULT_HWPOISON, "HWPOISON" }, \
{ VM_FAULT_HWPOISON_LARGE, "HWPOISON_LARGE" }, \ { VM_FAULT_HWPOISON_LARGE, "HWPOISON_LARGE" }, \
{ VM_FAULT_SIGSEGV, "SIGSEGV" }, \ { VM_FAULT_SIGSEGV, "SIGSEGV" }, \
......
...@@ -1376,7 +1376,7 @@ vm_fault_t do_huge_pmd_wp_page(struct vm_fault *vmf) ...@@ -1376,7 +1376,7 @@ vm_fault_t do_huge_pmd_wp_page(struct vm_fault *vmf)
if (pmdp_set_access_flags(vma, haddr, vmf->pmd, entry, 1)) if (pmdp_set_access_flags(vma, haddr, vmf->pmd, entry, 1))
update_mmu_cache_pmd(vma, vmf->address, vmf->pmd); update_mmu_cache_pmd(vma, vmf->address, vmf->pmd);
spin_unlock(vmf->ptl); spin_unlock(vmf->ptl);
return VM_FAULT_WRITE; return 0;
} }
unlock_fallback: unlock_fallback:
......
...@@ -3213,7 +3213,7 @@ static vm_fault_t wp_page_copy(struct vm_fault *vmf) ...@@ -3213,7 +3213,7 @@ static vm_fault_t wp_page_copy(struct vm_fault *vmf)
} }
delayacct_wpcopy_end(); delayacct_wpcopy_end();
return (page_copied && !unshare) ? VM_FAULT_WRITE : 0; return 0;
oom_free_new: oom_free_new:
put_page(new_page); put_page(new_page);
oom: oom:
...@@ -3277,14 +3277,14 @@ static vm_fault_t wp_pfn_shared(struct vm_fault *vmf) ...@@ -3277,14 +3277,14 @@ static vm_fault_t wp_pfn_shared(struct vm_fault *vmf)
return finish_mkwrite_fault(vmf); return finish_mkwrite_fault(vmf);
} }
wp_page_reuse(vmf); wp_page_reuse(vmf);
return VM_FAULT_WRITE; return 0;
} }
static vm_fault_t wp_page_shared(struct vm_fault *vmf) static vm_fault_t wp_page_shared(struct vm_fault *vmf)
__releases(vmf->ptl) __releases(vmf->ptl)
{ {
struct vm_area_struct *vma = vmf->vma; struct vm_area_struct *vma = vmf->vma;
vm_fault_t ret = VM_FAULT_WRITE; vm_fault_t ret = 0;
get_page(vmf->page); get_page(vmf->page);
...@@ -3430,7 +3430,7 @@ static vm_fault_t do_wp_page(struct vm_fault *vmf) ...@@ -3430,7 +3430,7 @@ static vm_fault_t do_wp_page(struct vm_fault *vmf)
return 0; return 0;
} }
wp_page_reuse(vmf); wp_page_reuse(vmf);
return VM_FAULT_WRITE; return 0;
} }
copy: copy:
/* /*
...@@ -3944,7 +3944,6 @@ vm_fault_t do_swap_page(struct vm_fault *vmf) ...@@ -3944,7 +3944,6 @@ vm_fault_t do_swap_page(struct vm_fault *vmf)
if (vmf->flags & FAULT_FLAG_WRITE) { if (vmf->flags & FAULT_FLAG_WRITE) {
pte = maybe_mkwrite(pte_mkdirty(pte), vma); pte = maybe_mkwrite(pte_mkdirty(pte), vma);
vmf->flags &= ~FAULT_FLAG_WRITE; vmf->flags &= ~FAULT_FLAG_WRITE;
ret |= VM_FAULT_WRITE;
} }
rmap_flags |= RMAP_EXCLUSIVE; rmap_flags |= RMAP_EXCLUSIVE;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment