aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2015-02-19 05:47:02 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2015-04-15 15:06:57 -0400
commitce0b16ddf18df35026164fda4a642ef10c01f442 (patch)
treef1253eacda202bd3dfae647cc5d646af02d4d10a
parentc6f493d631c4d40cea5c36055f9148f547b200af (diff)
VFS: security/: d_inode() annotations
... except where that code acts as a filesystem driver, rather than working with dentries given to it. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--security/apparmor/apparmorfs.c2
-rw-r--r--security/inode.c18
-rw-r--r--security/selinux/selinuxfs.c2
-rw-r--r--security/smack/smackfs.c2
4 files changed, 12 insertions, 12 deletions
diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c
index 7db9954f1af2..ad4fa49ad1db 100644
--- a/security/apparmor/apparmorfs.c
+++ b/security/apparmor/apparmorfs.c
@@ -365,7 +365,7 @@ void __aa_fs_profile_rmdir(struct aa_profile *profile)
365 if (!profile->dents[i]) 365 if (!profile->dents[i])
366 continue; 366 continue;
367 367
368 r = profile->dents[i]->d_inode->i_private; 368 r = d_inode(profile->dents[i])->i_private;
369 securityfs_remove(profile->dents[i]); 369 securityfs_remove(profile->dents[i]);
370 aa_put_replacedby(r); 370 aa_put_replacedby(r);
371 profile->dents[i] = NULL; 371 profile->dents[i] = NULL;
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
28static inline int positive(struct dentry *dentry) 28static 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
33static int fill_super(struct super_block *sb, void *data, int silent) 33static 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}
216EXPORT_SYMBOL_GPL(securityfs_remove); 216EXPORT_SYMBOL_GPL(securityfs_remove);
diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c
index 5fde34326dcf..d2787cca1fcb 100644
--- a/security/selinux/selinuxfs.c
+++ b/security/selinux/selinuxfs.c
@@ -1737,7 +1737,7 @@ static struct dentry *sel_make_dir(struct dentry *dir, const char *name,
1737 inc_nlink(inode); 1737 inc_nlink(inode);
1738 d_add(dentry, inode); 1738 d_add(dentry, inode);
1739 /* bump link count on parent directory, too */ 1739 /* bump link count on parent directory, too */
1740 inc_nlink(dir->d_inode); 1740 inc_nlink(d_inode(dir));
1741 1741
1742 return dentry; 1742 return dentry;
1743} 1743}
diff --git a/security/smack/smackfs.c b/security/smack/smackfs.c
index bce4e8f1b267..2611a651c344 100644
--- a/security/smack/smackfs.c
+++ b/security/smack/smackfs.c
@@ -2395,7 +2395,7 @@ static int smk_fill_super(struct super_block *sb, void *data, int silent)
2395 return rc; 2395 return rc;
2396 } 2396 }
2397 2397
2398 root_inode = sb->s_root->d_inode; 2398 root_inode = d_inode(sb->s_root);
2399 2399
2400 return 0; 2400 return 0;
2401} 2401}