Skip to content

Commit dba19c6

Browse files
author
Al Viro
committed
get rid of open-coded S_ISREG(), etc.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 1b9d5ff commit dba19c6

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎fs/ceph/dir.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -870,7 +870,7 @@ static int ceph_unlink(struct inode *dir, struct dentry *dentry)
870870
} else if (ceph_snap(dir) == CEPH_NOSNAP) {
871871
dout("unlink/rmdir dir %p dn %p inode %p\n",
872872
dir, dentry, inode);
873-
op = ((dentry->d_inode->i_mode & S_IFMT) == S_IFDIR) ?
873+
op = S_ISDIR(dentry->d_inode->i_mode) ?
874874
CEPH_MDS_OP_RMDIR : CEPH_MDS_OP_UNLINK;
875875
} else
876876
goto out;

‎security/inode.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ static int create_by_name(const char *name, mode_t mode,
164164
mutex_lock(&parent->d_inode->i_mutex);
165165
*dentry = lookup_one_len(name, parent, strlen(name));
166166
if (!IS_ERR(*dentry)) {
167-
if ((mode & S_IFMT) == S_IFDIR)
167+
if (S_ISDIR(mode))
168168
error = mkdir(parent->d_inode, *dentry, mode);
169169
else
170170
error = create(parent->d_inode, *dentry, mode);

‎security/selinux/hooks.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1740,7 +1740,7 @@ static inline u32 file_mask_to_av(int mode, int mask)
17401740
{
17411741
u32 av = 0;
17421742

1743-
if ((mode & S_IFMT) != S_IFDIR) {
1743+
if (!S_ISDIR(mode)) {
17441744
if (mask & MAY_EXEC)
17451745
av |= FILE__EXECUTE;
17461746
if (mask & MAY_READ)

0 commit comments

Comments
 (0)