summaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2011-07-26 02:49:29 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2012-01-04 04:55:12 +0100
commitdba19c6064766730dd64757a010ec3aec503ecdb (patch)
tree2071835ccfcb169b6219be7d5a4692fcfdcbd2c5 /security
parentmqueue: propagate umode_t (diff)
downloadlinux-dba19c6064766730dd64757a010ec3aec503ecdb.tar.xz
linux-dba19c6064766730dd64757a010ec3aec503ecdb.zip
get rid of open-coded S_ISREG(), etc.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'security')
-rw-r--r--security/inode.c2
-rw-r--r--security/selinux/hooks.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/security/inode.c b/security/inode.c
index a67004f9d106..bfe02e68f92e 100644
--- a/security/inode.c
+++ b/security/inode.c
@@ -164,7 +164,7 @@ static int create_by_name(const char *name, mode_t mode,
mutex_lock(&parent->d_inode->i_mutex);
*dentry = lookup_one_len(name, parent, strlen(name));
if (!IS_ERR(*dentry)) {
- if ((mode & S_IFMT) == S_IFDIR)
+ if (S_ISDIR(mode))
error = mkdir(parent->d_inode, *dentry, mode);
else
error = create(parent->d_inode, *dentry, mode);
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 8878370c13bf..4def4d92aaee 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -1740,7 +1740,7 @@ static inline u32 file_mask_to_av(int mode, int mask)
{
u32 av = 0;
- if ((mode & S_IFMT) != S_IFDIR) {
+ if (!S_ISDIR(mode)) {
if (mask & MAY_EXEC)
av |= FILE__EXECUTE;
if (mask & MAY_READ)