diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2013-01-23 17:07:38 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-02-22 23:31:31 -0500 |
commit | 496ad9aa8ef448058e36ca7a787c61f2e63f0f54 (patch) | |
tree | 8f4abde793cd7db5bb8fde6d27ebcacd0e54379a /security/smack/smack_lsm.c | |
parent | 57eccb830f1cc93d4b506ba306d8dfa685e0c88f (diff) |
new helper: file_inode(file)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'security/smack/smack_lsm.c')
-rw-r--r-- | security/smack/smack_lsm.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c index 38be92ce901e..fa64740abb59 100644 --- a/security/smack/smack_lsm.c +++ b/security/smack/smack_lsm.c | |||
@@ -456,7 +456,7 @@ static int smack_sb_umount(struct vfsmount *mnt, int flags) | |||
456 | */ | 456 | */ |
457 | static int smack_bprm_set_creds(struct linux_binprm *bprm) | 457 | static int smack_bprm_set_creds(struct linux_binprm *bprm) |
458 | { | 458 | { |
459 | struct inode *inode = bprm->file->f_path.dentry->d_inode; | 459 | struct inode *inode = file_inode(bprm->file); |
460 | struct task_smack *bsp = bprm->cred->security; | 460 | struct task_smack *bsp = bprm->cred->security; |
461 | struct inode_smack *isp; | 461 | struct inode_smack *isp; |
462 | int rc; | 462 | int rc; |
@@ -1187,21 +1187,15 @@ static int smack_mmap_file(struct file *file, | |||
1187 | char *msmack; | 1187 | char *msmack; |
1188 | char *osmack; | 1188 | char *osmack; |
1189 | struct inode_smack *isp; | 1189 | struct inode_smack *isp; |
1190 | struct dentry *dp; | ||
1191 | int may; | 1190 | int may; |
1192 | int mmay; | 1191 | int mmay; |
1193 | int tmay; | 1192 | int tmay; |
1194 | int rc; | 1193 | int rc; |
1195 | 1194 | ||
1196 | if (file == NULL || file->f_dentry == NULL) | 1195 | if (file == NULL) |
1197 | return 0; | ||
1198 | |||
1199 | dp = file->f_dentry; | ||
1200 | |||
1201 | if (dp->d_inode == NULL) | ||
1202 | return 0; | 1196 | return 0; |
1203 | 1197 | ||
1204 | isp = dp->d_inode->i_security; | 1198 | isp = file_inode(file)->i_security; |
1205 | if (isp->smk_mmap == NULL) | 1199 | if (isp->smk_mmap == NULL) |
1206 | return 0; | 1200 | return 0; |
1207 | msmack = isp->smk_mmap; | 1201 | msmack = isp->smk_mmap; |
@@ -1359,7 +1353,7 @@ static int smack_file_receive(struct file *file) | |||
1359 | */ | 1353 | */ |
1360 | static int smack_file_open(struct file *file, const struct cred *cred) | 1354 | static int smack_file_open(struct file *file, const struct cred *cred) |
1361 | { | 1355 | { |
1362 | struct inode_smack *isp = file->f_path.dentry->d_inode->i_security; | 1356 | struct inode_smack *isp = file_inode(file)->i_security; |
1363 | 1357 | ||
1364 | file->f_security = isp->smk_inode; | 1358 | file->f_security = isp->smk_inode; |
1365 | 1359 | ||