summaryrefslogtreecommitdiff
path: root/fs/ecryptfs/kthread.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ecryptfs/kthread.c')
-rw-r--r--fs/ecryptfs/kthread.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/fs/ecryptfs/kthread.c b/fs/ecryptfs/kthread.c
index c7d199dc7d24..809e67d05ca3 100644
--- a/fs/ecryptfs/kthread.c
+++ b/fs/ecryptfs/kthread.c
@@ -29,8 +29,7 @@
struct ecryptfs_open_req {
struct file **lower_file;
- struct dentry *lower_dentry;
- struct vfsmount *lower_mnt;
+ struct path path;
struct completion done;
struct list_head kthread_ctl_list;
};
@@ -74,10 +73,7 @@ static int ecryptfs_threadfn(void *ignored)
struct ecryptfs_open_req,
kthread_ctl_list);
list_del(&req->kthread_ctl_list);
- dget(req->lower_dentry);
- mntget(req->lower_mnt);
- (*req->lower_file) = dentry_open(
- req->lower_dentry, req->lower_mnt,
+ *req->lower_file = dentry_open(&req->path,
(O_RDWR | O_LARGEFILE), current_cred());
complete(&req->done);
}
@@ -140,23 +136,22 @@ int ecryptfs_privileged_open(struct file **lower_file,
int flags = O_LARGEFILE;
int rc = 0;
+ init_completion(&req.done);
+ req.lower_file = lower_file;
+ req.path.dentry = lower_dentry;
+ req.path.mnt = lower_mnt;
+
/* Corresponding dput() and mntput() are done when the
* lower file is fput() when all eCryptfs files for the inode are
* released. */
- dget(lower_dentry);
- mntget(lower_mnt);
flags |= IS_RDONLY(lower_dentry->d_inode) ? O_RDONLY : O_RDWR;
- (*lower_file) = dentry_open(lower_dentry, lower_mnt, flags, cred);
+ (*lower_file) = dentry_open(&req.path, flags, cred);
if (!IS_ERR(*lower_file))
goto out;
if ((flags & O_ACCMODE) == O_RDONLY) {
rc = PTR_ERR((*lower_file));
goto out;
}
- init_completion(&req.done);
- req.lower_file = lower_file;
- req.lower_dentry = lower_dentry;
- req.lower_mnt = lower_mnt;
mutex_lock(&ecryptfs_kthread_ctl.mux);
if (ecryptfs_kthread_ctl.flags & ECRYPTFS_KTHREAD_ZOMBIE) {
rc = -EIO;