aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ecryptfs/crypto.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ecryptfs/crypto.c')
-rw-r--r--fs/ecryptfs/crypto.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c
index 96fa40a48b4f..44c2ec2e9e6a 100644
--- a/fs/ecryptfs/crypto.c
+++ b/fs/ecryptfs/crypto.c
@@ -1256,9 +1256,10 @@ out:
1256} 1256}
1257 1257
1258 1258
1259static void 1259void
1260write_header_metadata(char *virt, struct ecryptfs_crypt_stat *crypt_stat, 1260ecryptfs_write_header_metadata(char *virt,
1261 size_t *written) 1261 struct ecryptfs_crypt_stat *crypt_stat,
1262 size_t *written)
1262{ 1263{
1263 u32 header_extent_size; 1264 u32 header_extent_size;
1264 u16 num_header_extents_at_front; 1265 u16 num_header_extents_at_front;
@@ -1320,7 +1321,8 @@ static int ecryptfs_write_headers_virt(char *page_virt, size_t *size,
1320 offset += written; 1321 offset += written;
1321 write_ecryptfs_flags((page_virt + offset), crypt_stat, &written); 1322 write_ecryptfs_flags((page_virt + offset), crypt_stat, &written);
1322 offset += written; 1323 offset += written;
1323 write_header_metadata((page_virt + offset), crypt_stat, &written); 1324 ecryptfs_write_header_metadata((page_virt + offset), crypt_stat,
1325 &written);
1324 offset += written; 1326 offset += written;
1325 rc = ecryptfs_generate_key_packet_set((page_virt + offset), crypt_stat, 1327 rc = ecryptfs_generate_key_packet_set((page_virt + offset), crypt_stat,
1326 ecryptfs_dentry, &written, 1328 ecryptfs_dentry, &written,
@@ -1606,7 +1608,12 @@ int ecryptfs_read_metadata(struct dentry *ecryptfs_dentry,
1606 ssize_t bytes_read; 1608 ssize_t bytes_read;
1607 struct ecryptfs_crypt_stat *crypt_stat = 1609 struct ecryptfs_crypt_stat *crypt_stat =
1608 &ecryptfs_inode_to_private(ecryptfs_dentry->d_inode)->crypt_stat; 1610 &ecryptfs_inode_to_private(ecryptfs_dentry->d_inode)->crypt_stat;
1611 struct ecryptfs_mount_crypt_stat *mount_crypt_stat =
1612 &ecryptfs_superblock_to_private(
1613 ecryptfs_dentry->d_sb)->mount_crypt_stat;
1609 1614
1615 ecryptfs_copy_mount_wide_flags_to_inode_flags(crypt_stat,
1616 mount_crypt_stat);
1610 /* Read the first page from the underlying file */ 1617 /* Read the first page from the underlying file */
1611 page_virt = kmem_cache_alloc(ecryptfs_header_cache_1, GFP_USER); 1618 page_virt = kmem_cache_alloc(ecryptfs_header_cache_1, GFP_USER);
1612 if (!page_virt) { 1619 if (!page_virt) {