Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 83051
b: refs/heads/master
c: d360244
h: refs/heads/master
i:
  83049: 7c02ee2
  83047: be435b4
v: v3
  • Loading branch information
Hugh Dickins authored and Linus Torvalds committed Feb 5, 2008
1 parent ee6a6ee commit 892bbec
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 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: 27d54b398ec0edea0e7417f003171017300e0efc
refs/heads/master: d3602444e1e3485890eea5f61366e19a287c00c4
22 changes: 13 additions & 9 deletions trunk/mm/shmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,8 @@ static int shmem_notify_change(struct dentry *dentry, struct iattr *attr)
(void) shmem_getpage(inode,
attr->ia_size>>PAGE_CACHE_SHIFT,
&page, SGP_READ, NULL);
if (page)
unlock_page(page);
}
/*
* Reset SHMEM_PAGEIN flag so that shmem_truncate can
Expand Down Expand Up @@ -1286,12 +1288,7 @@ static int shmem_getpage(struct inode *inode, unsigned long idx,
SetPageUptodate(filepage);
}
done:
if (*pagep != filepage) {
*pagep = filepage;
if (sgp != SGP_CACHE)
unlock_page(filepage);

}
*pagep = filepage;
return 0;

failed:
Expand Down Expand Up @@ -1469,12 +1466,13 @@ shmem_write_end(struct file *file, struct address_space *mapping,
{
struct inode *inode = mapping->host;

if (pos + copied > inode->i_size)
i_size_write(inode, pos + copied);

unlock_page(page);
set_page_dirty(page);
page_cache_release(page);

if (pos+copied > inode->i_size)
i_size_write(inode, pos+copied);

return copied;
}

Expand Down Expand Up @@ -1529,6 +1527,7 @@ shmem_file_write(struct file *file, const char __user *buf, size_t count, loff_t
if (err)
break;

unlock_page(page);
left = bytes;
if (PageHighMem(page)) {
volatile unsigned char dummy;
Expand Down Expand Up @@ -1610,6 +1609,8 @@ static void do_shmem_file_read(struct file *filp, loff_t *ppos, read_descriptor_
desc->error = 0;
break;
}
if (page)
unlock_page(page);

/*
* We must evaluate after, since reads (unlike writes)
Expand Down Expand Up @@ -1899,6 +1900,7 @@ static int shmem_symlink(struct inode *dir, struct dentry *dentry, const char *s
iput(inode);
return error;
}
unlock_page(page);
inode->i_op = &shmem_symlink_inode_operations;
kaddr = kmap_atomic(page, KM_USER0);
memcpy(kaddr, symname, len);
Expand Down Expand Up @@ -1926,6 +1928,8 @@ static void *shmem_follow_link(struct dentry *dentry, struct nameidata *nd)
struct page *page = NULL;
int res = shmem_getpage(dentry->d_inode, 0, &page, SGP_READ, NULL);
nd_set_link(nd, res ? ERR_PTR(res) : kmap(page));
if (page)
unlock_page(page);
return page;
}

Expand Down

0 comments on commit 892bbec

Please sign in to comment.