main.c (97eb3f24352ec6632c2127b35d8087d2a809a9b9) | main.c (57db4e8d73ef2b5e94a3f412108dff2576670a8a) |
---|---|
1/** 2 * eCryptfs: Linux filesystem encryption layer 3 * 4 * Copyright (C) 1997-2003 Erez Zadok 5 * Copyright (C) 2001-2003 Stony Brook University 6 * Copyright (C) 2004-2007 International Business Machines Corp. 7 * Author(s): Michael A. Halcrow <mahalcro@us.ibm.com> 8 * Michael C. Thompson <mcthomps@us.ibm.com> --- 108 unchanged lines hidden (view full) --- 117 */ 118int ecryptfs_init_persistent_file(struct dentry *ecryptfs_dentry) 119{ 120 const struct cred *cred = current_cred(); 121 struct ecryptfs_inode_info *inode_info = 122 ecryptfs_inode_to_private(ecryptfs_dentry->d_inode); 123 int rc = 0; 124 | 1/** 2 * eCryptfs: Linux filesystem encryption layer 3 * 4 * Copyright (C) 1997-2003 Erez Zadok 5 * Copyright (C) 2001-2003 Stony Brook University 6 * Copyright (C) 2004-2007 International Business Machines Corp. 7 * Author(s): Michael A. Halcrow <mahalcro@us.ibm.com> 8 * Michael C. Thompson <mcthomps@us.ibm.com> --- 108 unchanged lines hidden (view full) --- 117 */ 118int ecryptfs_init_persistent_file(struct dentry *ecryptfs_dentry) 119{ 120 const struct cred *cred = current_cred(); 121 struct ecryptfs_inode_info *inode_info = 122 ecryptfs_inode_to_private(ecryptfs_dentry->d_inode); 123 int rc = 0; 124 |
125 mutex_lock(&inode_info->lower_file_mutex); | |
126 if (!inode_info->lower_file) { 127 struct dentry *lower_dentry; 128 struct vfsmount *lower_mnt = 129 ecryptfs_dentry_to_lower_mnt(ecryptfs_dentry); 130 131 lower_dentry = ecryptfs_dentry_to_lower(ecryptfs_dentry); 132 rc = ecryptfs_privileged_open(&inode_info->lower_file, 133 lower_dentry, lower_mnt, cred); 134 if (rc) { 135 printk(KERN_ERR "Error opening lower persistent file " 136 "for lower_dentry [0x%p] and lower_mnt [0x%p]; " 137 "rc = [%d]\n", lower_dentry, lower_mnt, rc); 138 inode_info->lower_file = NULL; 139 } 140 } | 125 if (!inode_info->lower_file) { 126 struct dentry *lower_dentry; 127 struct vfsmount *lower_mnt = 128 ecryptfs_dentry_to_lower_mnt(ecryptfs_dentry); 129 130 lower_dentry = ecryptfs_dentry_to_lower(ecryptfs_dentry); 131 rc = ecryptfs_privileged_open(&inode_info->lower_file, 132 lower_dentry, lower_mnt, cred); 133 if (rc) { 134 printk(KERN_ERR "Error opening lower persistent file " 135 "for lower_dentry [0x%p] and lower_mnt [0x%p]; " 136 "rc = [%d]\n", lower_dentry, lower_mnt, rc); 137 inode_info->lower_file = NULL; 138 } 139 } |
141 mutex_unlock(&inode_info->lower_file_mutex); | |
142 return rc; 143} 144 145static struct inode *ecryptfs_get_inode(struct inode *lower_inode, 146 struct super_block *sb) 147{ 148 struct inode *inode; 149 int rc = 0; --- 745 unchanged lines hidden --- | 140 return rc; 141} 142 143static struct inode *ecryptfs_get_inode(struct inode *lower_inode, 144 struct super_block *sb) 145{ 146 struct inode *inode; 147 int rc = 0; --- 745 unchanged lines hidden --- |