|
32 | 32 | /** |
33 | 33 | * ecryptfs_d_revalidate - revalidate an ecryptfs dentry |
34 | 34 | * @dentry: The ecryptfs dentry |
35 | | - * @nd: The associated nameidata |
| 35 | + * @flags: lookup flags |
36 | 36 | * |
37 | 37 | * Called when the VFS needs to revalidate a dentry. This |
38 | 38 | * is called whenever a name lookup finds a dentry in the |
|
42 | 42 | * Returns 1 if valid, 0 otherwise. |
43 | 43 | * |
44 | 44 | */ |
45 | | -static int ecryptfs_d_revalidate(struct dentry *dentry, struct nameidata *nd) |
| 45 | +static int ecryptfs_d_revalidate(struct dentry *dentry, unsigned int flags) |
46 | 46 | { |
47 | 47 | struct dentry *lower_dentry; |
48 | 48 | struct vfsmount *lower_mnt; |
49 | | - struct dentry *dentry_save = NULL; |
50 | | - struct vfsmount *vfsmount_save = NULL; |
51 | 49 | int rc = 1; |
52 | 50 |
|
53 | | - if (nd && nd->flags & LOOKUP_RCU) |
| 51 | + if (flags & LOOKUP_RCU) |
54 | 52 | return -ECHILD; |
55 | 53 |
|
56 | 54 | lower_dentry = ecryptfs_dentry_to_lower(dentry); |
57 | 55 | lower_mnt = ecryptfs_dentry_to_lower_mnt(dentry); |
58 | 56 | if (!lower_dentry->d_op || !lower_dentry->d_op->d_revalidate) |
59 | 57 | goto out; |
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 | | - } |
| 58 | + rc = lower_dentry->d_op->d_revalidate(lower_dentry, flags); |
71 | 59 | if (dentry->d_inode) { |
72 | 60 | struct inode *lower_inode = |
73 | 61 | ecryptfs_inode_to_lower(dentry->d_inode); |
|
0 commit comments