diff options
Diffstat (limited to 'security/inode.c')
-rw-r--r-- | security/inode.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/security/inode.c b/security/inode.c index 131a3c49f766..91503b79c5f8 100644 --- a/security/inode.c +++ b/security/inode.c | |||
@@ -27,7 +27,7 @@ static int mount_count; | |||
27 | 27 | ||
28 | static inline int positive(struct dentry *dentry) | 28 | static inline int positive(struct dentry *dentry) |
29 | { | 29 | { |
30 | return dentry->d_inode && !d_unhashed(dentry); | 30 | return d_really_is_positive(dentry) && !d_unhashed(dentry); |
31 | } | 31 | } |
32 | 32 | ||
33 | static int fill_super(struct super_block *sb, void *data, int silent) | 33 | static int fill_super(struct super_block *sb, void *data, int silent) |
@@ -102,14 +102,14 @@ struct dentry *securityfs_create_file(const char *name, umode_t mode, | |||
102 | if (!parent) | 102 | if (!parent) |
103 | parent = mount->mnt_root; | 103 | parent = mount->mnt_root; |
104 | 104 | ||
105 | dir = parent->d_inode; | 105 | dir = d_inode(parent); |
106 | 106 | ||
107 | mutex_lock(&dir->i_mutex); | 107 | mutex_lock(&dir->i_mutex); |
108 | dentry = lookup_one_len(name, parent, strlen(name)); | 108 | dentry = lookup_one_len(name, parent, strlen(name)); |
109 | if (IS_ERR(dentry)) | 109 | if (IS_ERR(dentry)) |
110 | goto out; | 110 | goto out; |
111 | 111 | ||
112 | if (dentry->d_inode) { | 112 | if (d_really_is_positive(dentry)) { |
113 | error = -EEXIST; | 113 | error = -EEXIST; |
114 | goto out1; | 114 | goto out1; |
115 | } | 115 | } |
@@ -197,20 +197,20 @@ void securityfs_remove(struct dentry *dentry) | |||
197 | return; | 197 | return; |
198 | 198 | ||
199 | parent = dentry->d_parent; | 199 | parent = dentry->d_parent; |
200 | if (!parent || !parent->d_inode) | 200 | if (!parent || d_really_is_negative(parent)) |
201 | return; | 201 | return; |
202 | 202 | ||
203 | mutex_lock(&parent->d_inode->i_mutex); | 203 | mutex_lock(&d_inode(parent)->i_mutex); |
204 | if (positive(dentry)) { | 204 | if (positive(dentry)) { |
205 | if (dentry->d_inode) { | 205 | if (d_really_is_positive(dentry)) { |
206 | if (d_is_dir(dentry)) | 206 | if (d_is_dir(dentry)) |
207 | simple_rmdir(parent->d_inode, dentry); | 207 | simple_rmdir(d_inode(parent), dentry); |
208 | else | 208 | else |
209 | simple_unlink(parent->d_inode, dentry); | 209 | simple_unlink(d_inode(parent), dentry); |
210 | dput(dentry); | 210 | dput(dentry); |
211 | } | 211 | } |
212 | } | 212 | } |
213 | mutex_unlock(&parent->d_inode->i_mutex); | 213 | mutex_unlock(&d_inode(parent)->i_mutex); |
214 | simple_release_fs(&mount, &mount_count); | 214 | simple_release_fs(&mount, &mount_count); |
215 | } | 215 | } |
216 | EXPORT_SYMBOL_GPL(securityfs_remove); | 216 | EXPORT_SYMBOL_GPL(securityfs_remove); |