diff options
author | Nick Piggin <npiggin@kernel.dk> | 2011-01-07 01:49:57 -0500 |
---|---|---|
committer | Nick Piggin <npiggin@kernel.dk> | 2011-01-07 01:50:29 -0500 |
commit | 34286d6662308d82aed891852d04c7c3a2649b16 (patch) | |
tree | c4b7311404d302e7cb94df7a4690298e1059910a /fs/nfs/dir.c | |
parent | 44a7d7a878c9cbb74f236ea755b25b6b2e26a9a9 (diff) |
fs: rcu-walk aware d_revalidate method
Require filesystems be aware of .d_revalidate being called in rcu-walk
mode (nd->flags & LOOKUP_RCU). For now do a simple push down, returning
-ECHILD from all implementations.
Signed-off-by: Nick Piggin <npiggin@kernel.dk>
Diffstat (limited to 'fs/nfs/dir.c')
-rw-r--r-- | fs/nfs/dir.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 37e0a8bb077e..58beace14b19 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c | |||
@@ -938,7 +938,8 @@ static int nfs_check_verifier(struct inode *dir, struct dentry *dentry) | |||
938 | * component of the path. | 938 | * component of the path. |
939 | * We check for this using LOOKUP_CONTINUE and LOOKUP_PARENT. | 939 | * We check for this using LOOKUP_CONTINUE and LOOKUP_PARENT. |
940 | */ | 940 | */ |
941 | static inline unsigned int nfs_lookup_check_intent(struct nameidata *nd, unsigned int mask) | 941 | static inline unsigned int nfs_lookup_check_intent(struct nameidata *nd, |
942 | unsigned int mask) | ||
942 | { | 943 | { |
943 | if (nd->flags & (LOOKUP_CONTINUE|LOOKUP_PARENT)) | 944 | if (nd->flags & (LOOKUP_CONTINUE|LOOKUP_PARENT)) |
944 | return 0; | 945 | return 0; |
@@ -1018,7 +1019,7 @@ int nfs_neg_need_reval(struct inode *dir, struct dentry *dentry, | |||
1018 | * If the parent directory is seen to have changed, we throw out the | 1019 | * If the parent directory is seen to have changed, we throw out the |
1019 | * cached dentry and do a new lookup. | 1020 | * cached dentry and do a new lookup. |
1020 | */ | 1021 | */ |
1021 | static int nfs_lookup_revalidate(struct dentry * dentry, struct nameidata *nd) | 1022 | static int nfs_lookup_revalidate(struct dentry *dentry, struct nameidata *nd) |
1022 | { | 1023 | { |
1023 | struct inode *dir; | 1024 | struct inode *dir; |
1024 | struct inode *inode; | 1025 | struct inode *inode; |
@@ -1027,6 +1028,9 @@ static int nfs_lookup_revalidate(struct dentry * dentry, struct nameidata *nd) | |||
1027 | struct nfs_fattr *fattr = NULL; | 1028 | struct nfs_fattr *fattr = NULL; |
1028 | int error; | 1029 | int error; |
1029 | 1030 | ||
1031 | if (nd->flags & LOOKUP_RCU) | ||
1032 | return -ECHILD; | ||
1033 | |||
1030 | parent = dget_parent(dentry); | 1034 | parent = dget_parent(dentry); |
1031 | dir = parent->d_inode; | 1035 | dir = parent->d_inode; |
1032 | nfs_inc_stats(dir, NFSIOS_DENTRYREVALIDATE); | 1036 | nfs_inc_stats(dir, NFSIOS_DENTRYREVALIDATE); |