aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSouptick Joarder <jrdr.linux@gmail.com>2018-06-07 20:09:17 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-06-07 20:34:37 -0400
commit20acce679910fb6d30a89fa02586a3b4a134dfeb (patch)
tree0b3d8b90596946d27bf218b3f5c184412a4ea370
parent325d7d4a968669bec18c054db6b5de5f4fc82874 (diff)
mm/shmem.c: use new return type vm_fault_t
Use new return type vm_fault_t for fault handler. 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. See commit 1c8f422059ae ("mm: change return type to vm_fault_t") vmf_error() is the newly introduce inline function in 4.17-rc6. Link: http://lkml.kernel.org/r/20180521202410.GA17912@jordon-HP-15-Notebook-PC Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com> Reviewed-by: Matthew Wilcox <mawilcox@microsoft.com> Cc: Hugh Dickins <hughd@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--mm/shmem.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/mm/shmem.c b/mm/shmem.c
index 9a1b553e30e0..2b686e3f53ad 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -1947,14 +1947,14 @@ static int synchronous_wake_function(wait_queue_entry_t *wait, unsigned mode, in
1947 return ret; 1947 return ret;
1948} 1948}
1949 1949
1950static int shmem_fault(struct vm_fault *vmf) 1950static vm_fault_t shmem_fault(struct vm_fault *vmf)
1951{ 1951{
1952 struct vm_area_struct *vma = vmf->vma; 1952 struct vm_area_struct *vma = vmf->vma;
1953 struct inode *inode = file_inode(vma->vm_file); 1953 struct inode *inode = file_inode(vma->vm_file);
1954 gfp_t gfp = mapping_gfp_mask(inode->i_mapping); 1954 gfp_t gfp = mapping_gfp_mask(inode->i_mapping);
1955 enum sgp_type sgp; 1955 enum sgp_type sgp;
1956 int error; 1956 int err;
1957 int ret = VM_FAULT_LOCKED; 1957 vm_fault_t ret = VM_FAULT_LOCKED;
1958 1958
1959 /* 1959 /*
1960 * Trinity finds that probing a hole which tmpfs is punching can 1960 * Trinity finds that probing a hole which tmpfs is punching can
@@ -2022,10 +2022,10 @@ static int shmem_fault(struct vm_fault *vmf)
2022 else if (vma->vm_flags & VM_HUGEPAGE) 2022 else if (vma->vm_flags & VM_HUGEPAGE)
2023 sgp = SGP_HUGE; 2023 sgp = SGP_HUGE;
2024 2024
2025 error = shmem_getpage_gfp(inode, vmf->pgoff, &vmf->page, sgp, 2025 err = shmem_getpage_gfp(inode, vmf->pgoff, &vmf->page, sgp,
2026 gfp, vma, vmf, &ret); 2026 gfp, vma, vmf, &ret);
2027 if (error) 2027 if (err)
2028 return ((error == -ENOMEM) ? VM_FAULT_OOM : VM_FAULT_SIGBUS); 2028 return vmf_error(err);
2029 return ret; 2029 return ret;
2030} 2030}
2031 2031