Message ID | 20190212025632.28946-14-peterx@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | userfaultfd: write protection support | expand |
On Tue, Feb 12, 2019 at 10:56:19AM +0800, Peter Xu wrote: > Export this function for usages outside page fault handlers. > > Signed-off-by: Peter Xu <peterx@redhat.com> Reviewed-by: Jérôme Glisse <jglisse@redhat.com> > --- > include/linux/mm.h | 2 ++ > mm/memory.c | 2 +- > 2 files changed, 3 insertions(+), 1 deletion(-) > > diff --git a/include/linux/mm.h b/include/linux/mm.h > index f38fbe9c8bc9..2fd14a62324b 100644 > --- a/include/linux/mm.h > +++ b/include/linux/mm.h > @@ -405,6 +405,8 @@ struct vm_fault { > */ > }; > > +vm_fault_t wp_page_copy(struct vm_fault *vmf); > + > /* page entry size for vm->huge_fault() */ > enum page_entry_size { > PE_SIZE_PTE = 0, > diff --git a/mm/memory.c b/mm/memory.c > index f8d83ae16eff..32d32b6e6339 100644 > --- a/mm/memory.c > +++ b/mm/memory.c > @@ -2239,7 +2239,7 @@ static inline void wp_page_reuse(struct vm_fault *vmf) > * held to the old page, as well as updating the rmap. > * - In any case, unlock the PTL and drop the reference we took to the old page. > */ > -static vm_fault_t wp_page_copy(struct vm_fault *vmf) > +vm_fault_t wp_page_copy(struct vm_fault *vmf) > { > struct vm_area_struct *vma = vmf->vma; > struct mm_struct *mm = vma->vm_mm; > -- > 2.17.1 >
diff --git a/include/linux/mm.h b/include/linux/mm.h index f38fbe9c8bc9..2fd14a62324b 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -405,6 +405,8 @@ struct vm_fault { */ }; +vm_fault_t wp_page_copy(struct vm_fault *vmf); + /* page entry size for vm->huge_fault() */ enum page_entry_size { PE_SIZE_PTE = 0, diff --git a/mm/memory.c b/mm/memory.c index f8d83ae16eff..32d32b6e6339 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -2239,7 +2239,7 @@ static inline void wp_page_reuse(struct vm_fault *vmf) * held to the old page, as well as updating the rmap. * - In any case, unlock the PTL and drop the reference we took to the old page. */ -static vm_fault_t wp_page_copy(struct vm_fault *vmf) +vm_fault_t wp_page_copy(struct vm_fault *vmf) { struct vm_area_struct *vma = vmf->vma; struct mm_struct *mm = vma->vm_mm;
Export this function for usages outside page fault handlers. Signed-off-by: Peter Xu <peterx@redhat.com> --- include/linux/mm.h | 2 ++ mm/memory.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-)