Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 83050
b: refs/heads/master
c: 27d54b3
h: refs/heads/master
v: v3
  • Loading branch information
Hugh Dickins authored and Linus Torvalds committed Feb 5, 2008
1 parent 7c02ee2 commit ee6a6ee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 02098feaa42b2e0087fbbe6c6ab9a23e4653b16a
refs/heads/master: 27d54b398ec0edea0e7417f003171017300e0efc
8 changes: 2 additions & 6 deletions trunk/mm/shmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -1116,8 +1114,6 @@ static int shmem_getpage(struct inode *inode, unsigned long idx,
if (filepage && PageUptodate(filepage))
goto done;
error = 0;
if (sgp == SGP_QUICK)
goto failed;
gfp = mapping_gfp_mask(mapping);

spin_lock(&info->lock);
Expand Down Expand Up @@ -1292,7 +1288,7 @@ static int shmem_getpage(struct inode *inode, unsigned long idx,
done:
if (*pagep != filepage) {
*pagep = filepage;
if (sgp != SGP_FAULT)
if (sgp != SGP_CACHE)
unlock_page(filepage);

}
Expand All @@ -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);

Expand Down

0 comments on commit ee6a6ee

Please sign in to comment.