Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=27d54b398ec0edea0e7417f003171017300e0efc
Commit:     27d54b398ec0edea0e7417f003171017300e0efc
Parent:     02098feaa42b2e0087fbbe6c6ab9a23e4653b16a
Author:     Hugh Dickins <[EMAIL PROTECTED]>
AuthorDate: Mon Feb 4 22:28:43 2008 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue Feb 5 09:44:14 2008 -0800

    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 <[EMAIL PROTECTED]>
    Acked-by: Rik van Riel <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 mm/shmem.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/mm/shmem.c b/mm/shmem.c
index 55b696a..20cefe1 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -78,11 +78,9 @@
 
 /* Flag allocation requirements to shmem_getpage and shmem_swp_alloc */
 enum sgp_type {
-       SGP_QUICK,      /* don't try more than file page cache lookup */
        SGP_READ,       /* don't exceed i_size, don't allocate page */
        SGP_CACHE,      /* don't exceed i_size, may allocate page */
        SGP_WRITE,      /* may exceed i_size, may allocate page */
-       SGP_FAULT,      /* same as SGP_CACHE, return with page locked */
 };
 
 static int shmem_getpage(struct inode *inode, unsigned long idx,
@@ -1116,8 +1114,6 @@ repeat:
        if (filepage && PageUptodate(filepage))
                goto done;
        error = 0;
-       if (sgp == SGP_QUICK)
-               goto failed;
        gfp = mapping_gfp_mask(mapping);
 
        spin_lock(&info->lock);
@@ -1292,7 +1288,7 @@ repeat:
 done:
        if (*pagep != filepage) {
                *pagep = filepage;
-               if (sgp != SGP_FAULT)
+               if (sgp != SGP_CACHE)
                        unlock_page(filepage);
 
        }
@@ -1315,7 +1311,7 @@ static int shmem_fault(struct vm_area_struct *vma, struct 
vm_fault *vmf)
        if (((loff_t)vmf->pgoff << PAGE_CACHE_SHIFT) >= i_size_read(inode))
                return VM_FAULT_SIGBUS;
 
-       error = shmem_getpage(inode, vmf->pgoff, &vmf->page, SGP_FAULT, &ret);
+       error = shmem_getpage(inode, vmf->pgoff, &vmf->page, SGP_CACHE, &ret);
        if (error)
                return ((error == -ENOMEM) ? VM_FAULT_OOM : VM_FAULT_SIGBUS);
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to