aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
Diffstat (limited to 'mm')
-rw-r--r--mm/shmem.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/mm/shmem.c b/mm/shmem.c
index 55b696aa3ddd..20cefe16eafb 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -78,11 +78,9 @@
78 78
79/* Flag allocation requirements to shmem_getpage and shmem_swp_alloc */ 79/* Flag allocation requirements to shmem_getpage and shmem_swp_alloc */
80enum sgp_type { 80enum sgp_type {
81 SGP_QUICK, /* don't try more than file page cache lookup */
82 SGP_READ, /* don't exceed i_size, don't allocate page */ 81 SGP_READ, /* don't exceed i_size, don't allocate page */
83 SGP_CACHE, /* don't exceed i_size, may allocate page */ 82 SGP_CACHE, /* don't exceed i_size, may allocate page */
84 SGP_WRITE, /* may exceed i_size, may allocate page */ 83 SGP_WRITE, /* may exceed i_size, may allocate page */
85 SGP_FAULT, /* same as SGP_CACHE, return with page locked */
86}; 84};
87 85
88static int shmem_getpage(struct inode *inode, unsigned long idx, 86static int shmem_getpage(struct inode *inode, unsigned long idx,
@@ -1116,8 +1114,6 @@ repeat:
1116 if (filepage && PageUptodate(filepage)) 1114 if (filepage && PageUptodate(filepage))
1117 goto done; 1115 goto done;
1118 error = 0; 1116 error = 0;
1119 if (sgp == SGP_QUICK)
1120 goto failed;
1121 gfp = mapping_gfp_mask(mapping); 1117 gfp = mapping_gfp_mask(mapping);
1122 1118
1123 spin_lock(&info->lock); 1119 spin_lock(&info->lock);
@@ -1292,7 +1288,7 @@ repeat:
1292done: 1288done:
1293 if (*pagep != filepage) { 1289 if (*pagep != filepage) {
1294 *pagep = filepage; 1290 *pagep = filepage;
1295 if (sgp != SGP_FAULT) 1291 if (sgp != SGP_CACHE)
1296 unlock_page(filepage); 1292 unlock_page(filepage);
1297 1293
1298 } 1294 }
@@ -1315,7 +1311,7 @@ static int shmem_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
1315 if (((loff_t)vmf->pgoff << PAGE_CACHE_SHIFT) >= i_size_read(inode)) 1311 if (((loff_t)vmf->pgoff << PAGE_CACHE_SHIFT) >= i_size_read(inode))
1316 return VM_FAULT_SIGBUS; 1312 return VM_FAULT_SIGBUS;
1317 1313
1318 error = shmem_getpage(inode, vmf->pgoff, &vmf->page, SGP_FAULT, &ret); 1314 error = shmem_getpage(inode, vmf->pgoff, &vmf->page, SGP_CACHE, &ret);
1319 if (error) 1315 if (error)
1320 return ((error == -ENOMEM) ? VM_FAULT_OOM : VM_FAULT_SIGBUS); 1316 return ((error == -ENOMEM) ? VM_FAULT_OOM : VM_FAULT_SIGBUS);
1321 1317