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/gfs2 | |
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/gfs2')
-rw-r--r-- | fs/gfs2/dentry.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/fs/gfs2/dentry.c b/fs/gfs2/dentry.c index 50497f65763b..4a456338b873 100644 --- a/fs/gfs2/dentry.c +++ b/fs/gfs2/dentry.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/completion.h> | 11 | #include <linux/completion.h> |
12 | #include <linux/buffer_head.h> | 12 | #include <linux/buffer_head.h> |
13 | #include <linux/gfs2_ondisk.h> | 13 | #include <linux/gfs2_ondisk.h> |
14 | #include <linux/namei.h> | ||
14 | #include <linux/crc32.h> | 15 | #include <linux/crc32.h> |
15 | 16 | ||
16 | #include "gfs2.h" | 17 | #include "gfs2.h" |
@@ -34,15 +35,23 @@ | |||
34 | 35 | ||
35 | static int gfs2_drevalidate(struct dentry *dentry, struct nameidata *nd) | 36 | static int gfs2_drevalidate(struct dentry *dentry, struct nameidata *nd) |
36 | { | 37 | { |
37 | struct dentry *parent = dget_parent(dentry); | 38 | struct dentry *parent; |
38 | struct gfs2_sbd *sdp = GFS2_SB(parent->d_inode); | 39 | struct gfs2_sbd *sdp; |
39 | struct gfs2_inode *dip = GFS2_I(parent->d_inode); | 40 | struct gfs2_inode *dip; |
40 | struct inode *inode = dentry->d_inode; | 41 | struct inode *inode; |
41 | struct gfs2_holder d_gh; | 42 | struct gfs2_holder d_gh; |
42 | struct gfs2_inode *ip = NULL; | 43 | struct gfs2_inode *ip = NULL; |
43 | int error; | 44 | int error; |
44 | int had_lock = 0; | 45 | int had_lock = 0; |
45 | 46 | ||
47 | if (nd->flags & LOOKUP_RCU) | ||
48 | return -ECHILD; | ||
49 | |||
50 | parent = dget_parent(dentry); | ||
51 | sdp = GFS2_SB(parent->d_inode); | ||
52 | dip = GFS2_I(parent->d_inode); | ||
53 | inode = dentry->d_inode; | ||
54 | |||
46 | if (inode) { | 55 | if (inode) { |
47 | if (is_bad_inode(inode)) | 56 | if (is_bad_inode(inode)) |
48 | goto invalid; | 57 | goto invalid; |