aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ecryptfs/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ecryptfs/inode.c')
-rw-r--r--fs/ecryptfs/inode.c29
1 files changed, 5 insertions, 24 deletions
diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c
index 32f90a3ae63e..19a8ca4ab1dd 100644
--- a/fs/ecryptfs/inode.c
+++ b/fs/ecryptfs/inode.c
@@ -144,24 +144,6 @@ static int ecryptfs_interpose(struct dentry *lower_dentry,
144} 144}
145 145
146/** 146/**
147 * ecryptfs_create_underlying_file
148 * @lower_dir_inode: inode of the parent in the lower fs of the new file
149 * @dentry: New file's dentry
150 * @mode: The mode of the new file
151 *
152 * Creates the file in the lower file system.
153 *
154 * Returns zero on success; non-zero on error condition
155 */
156static int
157ecryptfs_create_underlying_file(struct inode *lower_dir_inode,
158 struct dentry *dentry, int mode)
159{
160 struct dentry *lower_dentry = ecryptfs_dentry_to_lower(dentry);
161 return vfs_create(lower_dir_inode, lower_dentry, mode, NULL);
162}
163
164/**
165 * ecryptfs_do_create 147 * ecryptfs_do_create
166 * @directory_inode: inode of the new file's dentry's parent in ecryptfs 148 * @directory_inode: inode of the new file's dentry's parent in ecryptfs
167 * @ecryptfs_dentry: New file's dentry in ecryptfs 149 * @ecryptfs_dentry: New file's dentry in ecryptfs
@@ -176,7 +158,7 @@ ecryptfs_create_underlying_file(struct inode *lower_dir_inode,
176 */ 158 */
177static struct inode * 159static struct inode *
178ecryptfs_do_create(struct inode *directory_inode, 160ecryptfs_do_create(struct inode *directory_inode,
179 struct dentry *ecryptfs_dentry, int mode) 161 struct dentry *ecryptfs_dentry, umode_t mode)
180{ 162{
181 int rc; 163 int rc;
182 struct dentry *lower_dentry; 164 struct dentry *lower_dentry;
@@ -191,8 +173,7 @@ ecryptfs_do_create(struct inode *directory_inode,
191 inode = ERR_CAST(lower_dir_dentry); 173 inode = ERR_CAST(lower_dir_dentry);
192 goto out; 174 goto out;
193 } 175 }
194 rc = ecryptfs_create_underlying_file(lower_dir_dentry->d_inode, 176 rc = vfs_create(lower_dir_dentry->d_inode, lower_dentry, mode, NULL);
195 ecryptfs_dentry, mode);
196 if (rc) { 177 if (rc) {
197 printk(KERN_ERR "%s: Failure to create dentry in lower fs; " 178 printk(KERN_ERR "%s: Failure to create dentry in lower fs; "
198 "rc = [%d]\n", __func__, rc); 179 "rc = [%d]\n", __func__, rc);
@@ -267,7 +248,7 @@ out:
267 */ 248 */
268static int 249static int
269ecryptfs_create(struct inode *directory_inode, struct dentry *ecryptfs_dentry, 250ecryptfs_create(struct inode *directory_inode, struct dentry *ecryptfs_dentry,
270 int mode, struct nameidata *nd) 251 umode_t mode, struct nameidata *nd)
271{ 252{
272 struct inode *ecryptfs_inode; 253 struct inode *ecryptfs_inode;
273 int rc; 254 int rc;
@@ -559,7 +540,7 @@ out_lock:
559 return rc; 540 return rc;
560} 541}
561 542
562static int ecryptfs_mkdir(struct inode *dir, struct dentry *dentry, int mode) 543static int ecryptfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
563{ 544{
564 int rc; 545 int rc;
565 struct dentry *lower_dentry; 546 struct dentry *lower_dentry;
@@ -607,7 +588,7 @@ static int ecryptfs_rmdir(struct inode *dir, struct dentry *dentry)
607} 588}
608 589
609static int 590static int
610ecryptfs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t dev) 591ecryptfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t dev)
611{ 592{
612 int rc; 593 int rc;
613 struct dentry *lower_dentry; 594 struct dentry *lower_dentry;