提交 3eb87d4e 编写于 作者: S Souptick Joarder 提交者: Greg Kroah-Hartman

char: mspec: change return type to vm_fault_t

Use new return type vm_fault_t for the fault handler
in struct vm_operations_struct.  For now, this is just
documenting that the function returns a VM_FAULT value
rather than an errno.  Once all instances are converted,
vm_fault_t will become a distinct type.

This driver failed to handle any error returned by
vm_insert_pfn. Use the new vmf_insert_pfn function
to return the correct value.
Signed-off-by: NSouptick Joarder <jrdr.linux@gmail.com>
Reviewed-by: NMatthew Wilcox <mawilcox@microsoft.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 851b4c14
...@@ -191,7 +191,7 @@ mspec_close(struct vm_area_struct *vma) ...@@ -191,7 +191,7 @@ mspec_close(struct vm_area_struct *vma)
* *
* Creates a mspec page and maps it to user space. * Creates a mspec page and maps it to user space.
*/ */
static int static vm_fault_t
mspec_fault(struct vm_fault *vmf) mspec_fault(struct vm_fault *vmf)
{ {
unsigned long paddr, maddr; unsigned long paddr, maddr;
...@@ -223,14 +223,7 @@ mspec_fault(struct vm_fault *vmf) ...@@ -223,14 +223,7 @@ mspec_fault(struct vm_fault *vmf)
pfn = paddr >> PAGE_SHIFT; pfn = paddr >> PAGE_SHIFT;
/* return vmf_insert_pfn(vmf->vma, vmf->address, pfn);
* vm_insert_pfn can fail with -EBUSY, but in that case it will
* be because another thread has installed the pte first, so it
* is no problem.
*/
vm_insert_pfn(vmf->vma, vmf->address, pfn);
return VM_FAULT_NOPAGE;
} }
static const struct vm_operations_struct mspec_vm_ops = { static const struct vm_operations_struct mspec_vm_ops = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册