diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-17 16:15:55 -0500 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-17 16:15:55 -0500 |
commit | 8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch) | |
tree | a8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /fs/ecryptfs/dentry.c | |
parent | 406089d01562f1e2bf9f089fd7637009ebaad589 (diff) |
Patched in Tegra support.
Diffstat (limited to 'fs/ecryptfs/dentry.c')
-rw-r--r-- | fs/ecryptfs/dentry.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/fs/ecryptfs/dentry.c b/fs/ecryptfs/dentry.c index 1b5d9af937d..534c1d46e69 100644 --- a/fs/ecryptfs/dentry.c +++ b/fs/ecryptfs/dentry.c | |||
@@ -32,7 +32,7 @@ | |||
32 | /** | 32 | /** |
33 | * ecryptfs_d_revalidate - revalidate an ecryptfs dentry | 33 | * ecryptfs_d_revalidate - revalidate an ecryptfs dentry |
34 | * @dentry: The ecryptfs dentry | 34 | * @dentry: The ecryptfs dentry |
35 | * @flags: lookup flags | 35 | * @nd: The associated nameidata |
36 | * | 36 | * |
37 | * Called when the VFS needs to revalidate a dentry. This | 37 | * Called when the VFS needs to revalidate a dentry. This |
38 | * is called whenever a name lookup finds a dentry in the | 38 | * is called whenever a name lookup finds a dentry in the |
@@ -42,20 +42,32 @@ | |||
42 | * Returns 1 if valid, 0 otherwise. | 42 | * Returns 1 if valid, 0 otherwise. |
43 | * | 43 | * |
44 | */ | 44 | */ |
45 | static int ecryptfs_d_revalidate(struct dentry *dentry, unsigned int flags) | 45 | static int ecryptfs_d_revalidate(struct dentry *dentry, struct nameidata *nd) |
46 | { | 46 | { |
47 | struct dentry *lower_dentry; | 47 | struct dentry *lower_dentry; |
48 | struct vfsmount *lower_mnt; | 48 | struct vfsmount *lower_mnt; |
49 | struct dentry *dentry_save = NULL; | ||
50 | struct vfsmount *vfsmount_save = NULL; | ||
49 | int rc = 1; | 51 | int rc = 1; |
50 | 52 | ||
51 | if (flags & LOOKUP_RCU) | 53 | if (nd && nd->flags & LOOKUP_RCU) |
52 | return -ECHILD; | 54 | return -ECHILD; |
53 | 55 | ||
54 | lower_dentry = ecryptfs_dentry_to_lower(dentry); | 56 | lower_dentry = ecryptfs_dentry_to_lower(dentry); |
55 | lower_mnt = ecryptfs_dentry_to_lower_mnt(dentry); | 57 | lower_mnt = ecryptfs_dentry_to_lower_mnt(dentry); |
56 | if (!lower_dentry->d_op || !lower_dentry->d_op->d_revalidate) | 58 | if (!lower_dentry->d_op || !lower_dentry->d_op->d_revalidate) |
57 | goto out; | 59 | goto out; |
58 | rc = lower_dentry->d_op->d_revalidate(lower_dentry, flags); | 60 | if (nd) { |
61 | dentry_save = nd->path.dentry; | ||
62 | vfsmount_save = nd->path.mnt; | ||
63 | nd->path.dentry = lower_dentry; | ||
64 | nd->path.mnt = lower_mnt; | ||
65 | } | ||
66 | rc = lower_dentry->d_op->d_revalidate(lower_dentry, nd); | ||
67 | if (nd) { | ||
68 | nd->path.dentry = dentry_save; | ||
69 | nd->path.mnt = vfsmount_save; | ||
70 | } | ||
59 | if (dentry->d_inode) { | 71 | if (dentry->d_inode) { |
60 | struct inode *lower_inode = | 72 | struct inode *lower_inode = |
61 | ecryptfs_inode_to_lower(dentry->d_inode); | 73 | ecryptfs_inode_to_lower(dentry->d_inode); |