ecryptfs: modify write path to encrypt page in writepage
Change the write path to encrypt the data only when the page is written to disk in ecryptfs_writepage. Previously, ecryptfs encrypts the page in ecryptfs_write_end which means that if there are multiple write requests to the same page, ecryptfs ends up re-encrypting that page over and over again. This patch minimizes the number of encryptions needed. Signed-off-by: Thieu Le <thieule@chromium.org> [tyhicks: Changed NULL .drop_inode sop pointer to generic_drop_inode] Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
This commit is contained in:
@@ -122,7 +122,6 @@ int ecryptfs_init_persistent_file(struct dentry *ecryptfs_dentry)
|
||||
ecryptfs_inode_to_private(ecryptfs_dentry->d_inode);
|
||||
int rc = 0;
|
||||
|
||||
mutex_lock(&inode_info->lower_file_mutex);
|
||||
if (!inode_info->lower_file) {
|
||||
struct dentry *lower_dentry;
|
||||
struct vfsmount *lower_mnt =
|
||||
@@ -138,7 +137,6 @@ int ecryptfs_init_persistent_file(struct dentry *ecryptfs_dentry)
|
||||
inode_info->lower_file = NULL;
|
||||
}
|
||||
}
|
||||
mutex_unlock(&inode_info->lower_file_mutex);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user