Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/fs/ecryptfs/mmap.c b/fs/ecryptfs/mmap.c
- index 10ec695..a4be0e9 100644
- --- a/fs/ecryptfs/mmap.c
- +++ b/fs/ecryptfs/mmap.c
- @@ -65,6 +65,32 @@ struct page *ecryptfs_get_locked_page(struct inode *inode, loff_t index)
- static int ecryptfs_writepage(struct page *page, struct writeback_control *wbc)
- {
- int rc;
- + struct inode *inode;
- + struct ecryptfs_crypt_stat *crypt_stat;
- +
- + inode = page->mapping->host;
- + crypt_stat = &ecryptfs_inode_to_private(inode)->crypt_stat;
- + if (!(crypt_stat->flags & ECRYPTFS_ENCRYPTED)) {
- + size_t size;
- + loff_t file_size = i_size_read(inode);
- + pgoff_t end_page_index = file_size >> PAGE_CACHE_SHIFT;
- +
- + if (end_page_index < page->index)
- + size = 0;
- + else if (end_page_index == page->index)
- + size = file_size & ~PAGE_CACHE_MASK;
- + else
- + size = PAGE_CACHE_SIZE;
- +
- + rc = ecryptfs_write_lower_page_segment(inode, page, 0, size);
- + if (unlikely(rc)) {
- + ecryptfs_printk(KERN_WARNING, "Error write "
- + "page (upper index [0x%.16lx])\n", page->index);
- + ClearPageUptodate(page);
- + } else
- + SetPageUptodate(page);
- + goto out;
- + }
- /*
- * Refuse to write the page out if we are called from reclaim context
- --
- 1.7.6.5
- --
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement