Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 308868
b: refs/heads/master
c: ec9516f
h: refs/heads/master
v: v3
  • Loading branch information
Hugh Dickins authored and Linus Torvalds committed May 29, 2012
1 parent 8945a8e commit 36aba67
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 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: 2f6e38f3cd17a7858112f538c1700c747170db1f
refs/heads/master: ec9516fbc5fa814014991e1ae7f8860127122105
20 changes: 17 additions & 3 deletions trunk/mm/shmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -1095,9 +1095,14 @@ static int shmem_getpage_gfp(struct inode *inode, pgoff_t index,
shmem_recalc_inode(inode);
spin_unlock(&info->lock);

clear_highpage(page);
flush_dcache_page(page);
SetPageUptodate(page);
/*
* Let SGP_WRITE caller clear ends if write does not fill page
*/
if (sgp != SGP_WRITE) {
clear_highpage(page);
flush_dcache_page(page);
SetPageUptodate(page);
}
if (sgp == SGP_DIRTY)
set_page_dirty(page);
}
Expand Down Expand Up @@ -1307,6 +1312,14 @@ shmem_write_end(struct file *file, struct address_space *mapping,
if (pos + copied > inode->i_size)
i_size_write(inode, pos + copied);

if (!PageUptodate(page)) {
if (copied < PAGE_CACHE_SIZE) {
unsigned from = pos & (PAGE_CACHE_SIZE - 1);
zero_user_segments(page, 0, from,
from + copied, PAGE_CACHE_SIZE);
}
SetPageUptodate(page);
}
set_page_dirty(page);
unlock_page(page);
page_cache_release(page);
Expand Down Expand Up @@ -1768,6 +1781,7 @@ static int shmem_symlink(struct inode *dir, struct dentry *dentry, const char *s
kaddr = kmap_atomic(page);
memcpy(kaddr, symname, len);
kunmap_atomic(kaddr);
SetPageUptodate(page);
set_page_dirty(page);
unlock_page(page);
page_cache_release(page);
Expand Down

0 comments on commit 36aba67

Please sign in to comment.