Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 56533
b: refs/heads/master
c: c9f2875
h: refs/heads/master
i:
  56531: 6734f3a
v: v3
  • Loading branch information
Nate Diller authored and Linus Torvalds committed May 17, 2007
1 parent 24d12aa commit 7124364
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 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: 71ce92f3fa442069670a52fa6230a6064c4517b3
refs/heads/master: c9f2875b7968453a852e1de5d3504fd2241e8989
14 changes: 3 additions & 11 deletions trunk/fs/ecryptfs/mmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -364,18 +364,14 @@ static int fill_zeros_to_end_of_page(struct page *page, unsigned int to)
{
struct inode *inode = page->mapping->host;
int end_byte_in_page;
char *page_virt;

if ((i_size_read(inode) / PAGE_CACHE_SIZE) != page->index)
goto out;
end_byte_in_page = i_size_read(inode) % PAGE_CACHE_SIZE;
if (to > end_byte_in_page)
end_byte_in_page = to;
page_virt = kmap_atomic(page, KM_USER0);
memset((page_virt + end_byte_in_page), 0,
(PAGE_CACHE_SIZE - end_byte_in_page));
kunmap_atomic(page_virt, KM_USER0);
flush_dcache_page(page);
zero_user_page(page, end_byte_in_page,
PAGE_CACHE_SIZE - end_byte_in_page, KM_USER0);
out:
return 0;
}
Expand Down Expand Up @@ -740,7 +736,6 @@ int write_zeros(struct file *file, pgoff_t index, int start, int num_zeros)
{
int rc = 0;
struct page *tmp_page;
char *tmp_page_virt;

tmp_page = ecryptfs_get1page(file, index);
if (IS_ERR(tmp_page)) {
Expand All @@ -757,10 +752,7 @@ int write_zeros(struct file *file, pgoff_t index, int start, int num_zeros)
page_cache_release(tmp_page);
goto out;
}
tmp_page_virt = kmap_atomic(tmp_page, KM_USER0);
memset(((char *)tmp_page_virt + start), 0, num_zeros);
kunmap_atomic(tmp_page_virt, KM_USER0);
flush_dcache_page(tmp_page);
zero_user_page(tmp_page, start, num_zeros, KM_USER0);
rc = ecryptfs_commit_write(file, tmp_page, start, start + num_zeros);
if (rc < 0) {
ecryptfs_printk(KERN_ERR, "Error attempting to write zero's "
Expand Down

0 comments on commit 7124364

Please sign in to comment.