aboutsummaryrefslogtreecommitdiffstats
path: root/security/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'security/inode.c')
-rw-r--r--security/inode.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/security/inode.c b/security/inode.c
index 0e37e4fba8fa..16622aef9bde 100644
--- a/security/inode.c
+++ b/security/inode.c
@@ -25,11 +25,6 @@
25static struct vfsmount *mount; 25static struct vfsmount *mount;
26static int mount_count; 26static int mount_count;
27 27
28static inline int positive(struct dentry *dentry)
29{
30 return d_really_is_positive(dentry) && !d_unhashed(dentry);
31}
32
33static int fill_super(struct super_block *sb, void *data, int silent) 28static int fill_super(struct super_block *sb, void *data, int silent)
34{ 29{
35 static struct tree_descr files[] = {{""}}; 30 static struct tree_descr files[] = {{""}};
@@ -201,14 +196,12 @@ void securityfs_remove(struct dentry *dentry)
201 return; 196 return;
202 197
203 mutex_lock(&d_inode(parent)->i_mutex); 198 mutex_lock(&d_inode(parent)->i_mutex);
204 if (positive(dentry)) { 199 if (simple_positive(dentry)) {
205 if (d_really_is_positive(dentry)) { 200 if (d_is_dir(dentry))
206 if (d_is_dir(dentry)) 201 simple_rmdir(d_inode(parent), dentry);
207 simple_rmdir(d_inode(parent), dentry); 202 else
208 else 203 simple_unlink(d_inode(parent), dentry);
209 simple_unlink(d_inode(parent), dentry); 204 dput(dentry);
210 dput(dentry);
211 }
212 } 205 }
213 mutex_unlock(&d_inode(parent)->i_mutex); 206 mutex_unlock(&d_inode(parent)->i_mutex);
214 simple_release_fs(&mount, &mount_count); 207 simple_release_fs(&mount, &mount_count);