diff options
author | Hugh Dickins <hugh@veritas.com> | 2008-02-05 01:28:43 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-05 12:44:14 -0500 |
commit | 27d54b398ec0edea0e7417f003171017300e0efc (patch) | |
tree | 2167c058ab0734bbb424ec27b2dc19d58fa7befd /mm/shmem.c | |
parent | 02098feaa42b2e0087fbbe6c6ab9a23e4653b16a (diff) |
shmem: SGP_QUICK and SGP_FAULT redundant
Remove SGP_QUICK from the sgp_type enum: it was for shmem_populate and has no
users now. Remove SGP_FAULT from the enum: SGP_CACHE does just as well (and
shmem_getpage is about to return with page always locked).
Signed-off-by: Hugh Dickins <hugh@veritas.com>
Acked-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/shmem.c')
-rw-r--r-- | mm/shmem.c | 8 |
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 */ |
80 | enum sgp_type { | 80 | enum 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 | ||
88 | static int shmem_getpage(struct inode *inode, unsigned long idx, | 86 | static 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: | |||
1292 | done: | 1288 | done: |
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 | ||