diff options
author | Michael Halcrow <mhalcrow@us.ibm.com> | 2008-02-06 01:38:32 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-06 10:41:12 -0800 |
commit | cc11beffdf80ca31dff21422fa2a5e54d25f1494 (patch) | |
tree | 3b0e28d18f493a7c59b089c4c6fc59c79945937e /fs/ecryptfs/inode.c | |
parent | 7896b631823c6e8f1a520d89390624a51445840e (diff) | |
download | kernel_samsung_tuna-cc11beffdf80ca31dff21422fa2a5e54d25f1494.zip kernel_samsung_tuna-cc11beffdf80ca31dff21422fa2a5e54d25f1494.tar.gz kernel_samsung_tuna-cc11beffdf80ca31dff21422fa2a5e54d25f1494.tar.bz2 |
eCryptfs: track header bytes rather than extents
Remove internal references to header extents; just keep track of header bytes
instead. Headers can easily span multiple pages with the recent persistent
file changes.
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/inode.c')
-rw-r--r-- | fs/ecryptfs/inode.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c index ed0ed84..a2bc9df 100644 --- a/fs/ecryptfs/inode.c +++ b/fs/ecryptfs/inode.c @@ -365,8 +365,7 @@ static struct dentry *ecryptfs_lookup(struct inode *dir, struct dentry *dentry, dentry->d_sb)->mount_crypt_stat; if (mount_crypt_stat->flags & ECRYPTFS_ENCRYPTED_VIEW_ENABLED) { if (crypt_stat->flags & ECRYPTFS_METADATA_IN_XATTR) - file_size = ((crypt_stat->extent_size - * crypt_stat->num_header_extents_at_front) + file_size = (crypt_stat->num_header_bytes_at_front + i_size_read(lower_dentry->d_inode)); else file_size = i_size_read(lower_dentry->d_inode); @@ -685,7 +684,7 @@ ecryptfs_put_link(struct dentry *dentry, struct nameidata *nd, void *ptr) * @crypt_stat: Crypt_stat associated with file * @upper_size: Size of the upper file * - * Calculate the requried size of the lower file based on the + * Calculate the required size of the lower file based on the * specified size of the upper file. This calculation is based on the * number of headers in the underlying file and the extent size. * @@ -697,8 +696,7 @@ upper_size_to_lower_size(struct ecryptfs_crypt_stat *crypt_stat, { loff_t lower_size; - lower_size = (crypt_stat->extent_size - * crypt_stat->num_header_extents_at_front); + lower_size = crypt_stat->num_header_bytes_at_front; if (upper_size != 0) { loff_t num_extents; |