aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ecryptfs/crypto.c
diff options
context:
space:
mode:
authorMichael Halcrow <mhalcrow@us.ibm.com>2007-10-16 01:28:14 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-16 09:43:12 -0700
commit16a72c455a67bb23eed7292a31c6ba17729e78e6 (patch)
treed2cc7d116730348375ce0d06ad45e24744cd0b5f /fs/ecryptfs/crypto.c
parenteCryptfs: replace magic numbers (diff)
downloadlinux-dev-16a72c455a67bb23eed7292a31c6ba17729e78e6.tar.xz
linux-dev-16a72c455a67bb23eed7292a31c6ba17729e78e6.zip
ecryptfs: clean up page flag handling
The functions that eventually call down to ecryptfs_read_lower(), ecryptfs_decrypt_page(), and ecryptfs_copy_up_encrypted_with_header() should have the responsibility of managing the page Uptodate status. This patch gets rid of some of the ugliness that resulted from trying to push some of the page flag setting too far down the stack. Signed-off-by: Michael Halcrow <mhalcrow@us.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ecryptfs/crypto.c')
-rw-r--r--fs/ecryptfs/crypto.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c
index e890d596da7e..1ae90ef2c74d 100644
--- a/fs/ecryptfs/crypto.c
+++ b/fs/ecryptfs/crypto.c
@@ -605,14 +605,14 @@ int ecryptfs_decrypt_page(struct page *page)
printk(KERN_ERR "%s: Error attempting to copy "
"page at index [%ld]\n", __FUNCTION__,
page->index);
- goto out_clear_uptodate;
+ goto out;
}
enc_extent_virt = kmalloc(PAGE_CACHE_SIZE, GFP_USER);
if (!enc_extent_virt) {
rc = -ENOMEM;
ecryptfs_printk(KERN_ERR, "Error allocating memory for "
"encrypted extent\n");
- goto out_clear_uptodate;
+ goto out;
}
enc_extent_page = virt_to_page(enc_extent_virt);
for (extent_offset = 0;
@@ -631,21 +631,17 @@ int ecryptfs_decrypt_page(struct page *page)
ecryptfs_printk(KERN_ERR, "Error attempting "
"to read lower page; rc = [%d]"
"\n", rc);
- goto out_clear_uptodate;
+ goto out;
}
rc = ecryptfs_decrypt_extent(page, crypt_stat, enc_extent_page,
extent_offset);
if (rc) {
printk(KERN_ERR "%s: Error encrypting extent; "
"rc = [%d]\n", __FUNCTION__, rc);
- goto out_clear_uptodate;
+ goto out;
}
extent_offset++;
}
- SetPageUptodate(page);
- goto out;
-out_clear_uptodate:
- ClearPageUptodate(page);
out:
kfree(enc_extent_virt);
return rc;