[PATCH 9/11] eCryptfs: Initialize persistent lower file on inode create

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <akpm@...>
Cc: <linux-kernel@...>, <linux-fsdevel@...>, <ecryptfs-devel@...>
Date: Monday, September 17, 2007 - 5:50 pm

Initialize persistent lower file on inode create.

Signed-off-by: Michael Halcrow <mhalcrow@us.ibm.com>
---
 fs/ecryptfs/super.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/fs/ecryptfs/super.c b/fs/ecryptfs/super.c
index b97e210..f8cdab2 100644
--- a/fs/ecryptfs/super.c
+++ b/fs/ecryptfs/super.c
@@ -47,15 +47,16 @@ struct kmem_cache *ecryptfs_inode_info_cache;
  */
 static struct inode *ecryptfs_alloc_inode(struct super_block *sb)
 {
-	struct ecryptfs_inode_info *ecryptfs_inode;
+	struct ecryptfs_inode_info *inode_info;
 	struct inode *inode = NULL;
 
-	ecryptfs_inode = kmem_cache_alloc(ecryptfs_inode_info_cache,
-					  GFP_KERNEL);
-	if (unlikely(!ecryptfs_inode))
+	inode_info = kmem_cache_alloc(ecryptfs_inode_info_cache, GFP_KERNEL);
+	if (unlikely(!inode_info))
 		goto out;
-	ecryptfs_init_crypt_stat(&ecryptfs_inode->crypt_stat);
-	inode = &ecryptfs_inode->vfs_inode;
+	ecryptfs_init_crypt_stat(&inode_info->crypt_stat);
+	mutex_init(&inode_info->lower_file_mutex);
+	inode_info->lower_file = NULL;
+	inode = &inode_info->vfs_inode;
 out:
 	return inode;
 }
-- 
1.5.1.6

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 9/11] eCryptfs: Initialize persistent lower file on i..., Michael Halcrow, (Mon Sep 17, 5:50 pm)
[PATCH 11/11] eCryptfs: Replace magic numbers, Michael Halcrow, (Mon Sep 17, 5:52 pm)
[PATCH 6/11] eCryptfs: Update metadata read/write functions, Michael Halcrow, (Mon Sep 17, 5:48 pm)
[PATCH 2/11] eCryptfs: Remove assignments in if-statements, Michael Halcrow, (Mon Sep 17, 5:45 pm)
[PATCH 3/11] eCryptfs: read_write.c routines, Michael Halcrow, (Mon Sep 17, 5:46 pm)
Re: [PATCH 3/11] eCryptfs: read_write.c routines, Andrew Morton, (Thu Sep 20, 1:38 am)
Re: [PATCH 3/11] eCryptfs: read_write.c routines, Michael Halcrow, (Mon Sep 24, 6:12 pm)
Re: [PATCH 3/11] eCryptfs: read_write.c routines, Andrew Morton, (Thu Sep 20, 1:25 am)
[PATCH 1/11] eCryptfs: Remove header_extent_size, Michael Halcrow, (Mon Sep 17, 5:45 pm)