diff options
Diffstat (limited to 'fs/ecryptfs/crypto.c')
-rw-r--r-- | fs/ecryptfs/crypto.c | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c index 8b65f289ee00..b91851f1cda3 100644 --- a/fs/ecryptfs/crypto.c +++ b/fs/ecryptfs/crypto.c | |||
@@ -483,15 +483,7 @@ int ecryptfs_encrypt_page(struct page *page) | |||
483 | ecryptfs_inode = page->mapping->host; | 483 | ecryptfs_inode = page->mapping->host; |
484 | crypt_stat = | 484 | crypt_stat = |
485 | &(ecryptfs_inode_to_private(ecryptfs_inode)->crypt_stat); | 485 | &(ecryptfs_inode_to_private(ecryptfs_inode)->crypt_stat); |
486 | if (!(crypt_stat->flags & ECRYPTFS_ENCRYPTED)) { | 486 | BUG_ON(!(crypt_stat->flags & ECRYPTFS_ENCRYPTED)); |
487 | rc = ecryptfs_write_lower_page_segment(ecryptfs_inode, page, | ||
488 | 0, PAGE_CACHE_SIZE); | ||
489 | if (rc) | ||
490 | printk(KERN_ERR "%s: Error attempting to copy " | ||
491 | "page at index [%ld]\n", __func__, | ||
492 | page->index); | ||
493 | goto out; | ||
494 | } | ||
495 | enc_extent_page = alloc_page(GFP_USER); | 487 | enc_extent_page = alloc_page(GFP_USER); |
496 | if (!enc_extent_page) { | 488 | if (!enc_extent_page) { |
497 | rc = -ENOMEM; | 489 | rc = -ENOMEM; |
@@ -620,16 +612,7 @@ int ecryptfs_decrypt_page(struct page *page) | |||
620 | ecryptfs_inode = page->mapping->host; | 612 | ecryptfs_inode = page->mapping->host; |
621 | crypt_stat = | 613 | crypt_stat = |
622 | &(ecryptfs_inode_to_private(ecryptfs_inode)->crypt_stat); | 614 | &(ecryptfs_inode_to_private(ecryptfs_inode)->crypt_stat); |
623 | if (!(crypt_stat->flags & ECRYPTFS_ENCRYPTED)) { | 615 | BUG_ON(!(crypt_stat->flags & ECRYPTFS_ENCRYPTED)); |
624 | rc = ecryptfs_read_lower_page_segment(page, page->index, 0, | ||
625 | PAGE_CACHE_SIZE, | ||
626 | ecryptfs_inode); | ||
627 | if (rc) | ||
628 | printk(KERN_ERR "%s: Error attempting to copy " | ||
629 | "page at index [%ld]\n", __func__, | ||
630 | page->index); | ||
631 | goto out; | ||
632 | } | ||
633 | enc_extent_page = alloc_page(GFP_USER); | 616 | enc_extent_page = alloc_page(GFP_USER); |
634 | if (!enc_extent_page) { | 617 | if (!enc_extent_page) { |
635 | rc = -ENOMEM; | 618 | rc = -ENOMEM; |