diff options
Diffstat (limited to 'fs/gfs2/dentry.c')
-rw-r--r-- | fs/gfs2/dentry.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/fs/gfs2/dentry.c b/fs/gfs2/dentry.c index 6798755b3858..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; |
@@ -100,13 +109,14 @@ fail: | |||
100 | return 0; | 109 | return 0; |
101 | } | 110 | } |
102 | 111 | ||
103 | static int gfs2_dhash(struct dentry *dentry, struct qstr *str) | 112 | static int gfs2_dhash(const struct dentry *dentry, const struct inode *inode, |
113 | struct qstr *str) | ||
104 | { | 114 | { |
105 | str->hash = gfs2_disk_hash(str->name, str->len); | 115 | str->hash = gfs2_disk_hash(str->name, str->len); |
106 | return 0; | 116 | return 0; |
107 | } | 117 | } |
108 | 118 | ||
109 | static int gfs2_dentry_delete(struct dentry *dentry) | 119 | static int gfs2_dentry_delete(const struct dentry *dentry) |
110 | { | 120 | { |
111 | struct gfs2_inode *ginode; | 121 | struct gfs2_inode *ginode; |
112 | 122 | ||