aboutsummaryrefslogtreecommitdiffstats
path: root/mm/shmem.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/shmem.c')
-rw-r--r--mm/shmem.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/mm/shmem.c b/mm/shmem.c
index 69edb45a9f28..1acfb2687bfa 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -1305,12 +1305,10 @@ repeat:
1305 swappage = lookup_swap_cache(swap); 1305 swappage = lookup_swap_cache(swap);
1306 if (!swappage) { 1306 if (!swappage) {
1307 shmem_swp_unmap(entry); 1307 shmem_swp_unmap(entry);
1308 spin_unlock(&info->lock);
1308 /* here we actually do the io */ 1309 /* here we actually do the io */
1309 if (type && !(*type & VM_FAULT_MAJOR)) { 1310 if (type)
1310 __count_vm_event(PGMAJFAULT);
1311 *type |= VM_FAULT_MAJOR; 1311 *type |= VM_FAULT_MAJOR;
1312 }
1313 spin_unlock(&info->lock);
1314 swappage = shmem_swapin(swap, gfp, info, idx); 1312 swappage = shmem_swapin(swap, gfp, info, idx);
1315 if (!swappage) { 1313 if (!swappage) {
1316 spin_lock(&info->lock); 1314 spin_lock(&info->lock);
@@ -1549,7 +1547,10 @@ static int shmem_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
1549 error = shmem_getpage(inode, vmf->pgoff, &vmf->page, SGP_CACHE, &ret); 1547 error = shmem_getpage(inode, vmf->pgoff, &vmf->page, SGP_CACHE, &ret);
1550 if (error) 1548 if (error)
1551 return ((error == -ENOMEM) ? VM_FAULT_OOM : VM_FAULT_SIGBUS); 1549 return ((error == -ENOMEM) ? VM_FAULT_OOM : VM_FAULT_SIGBUS);
1552 1550 if (ret & VM_FAULT_MAJOR) {
1551 count_vm_event(PGMAJFAULT);
1552 mem_cgroup_count_vm_event(vma->vm_mm, PGMAJFAULT);
1553 }
1553 return ret | VM_FAULT_LOCKED; 1554 return ret | VM_FAULT_LOCKED;
1554} 1555}
1555 1556