Skip to content

Commit cf22644

Browse files
Martin Brandenburghubcapsc
authored andcommitted
orangefs: use S_ISREG(mode) and friends instead of mode & S_IFREG.
Suggestion from Dan Carpenter. Signed-off-by: Martin Brandenburg <martin@omnibond.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
1 parent 78699e2 commit cf22644

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎fs/orangefs/orangefs-utils.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -428,17 +428,17 @@ static int compare_attributes_to_inode(struct inode *inode,
428428

429429
switch (attrs->objtype) {
430430
case ORANGEFS_TYPE_METAFILE:
431-
if (!(inode->i_mode & S_IFREG))
431+
if (!S_ISREG(inode->i_mode))
432432
return 0;
433433
break;
434434
case ORANGEFS_TYPE_DIRECTORY:
435-
if (!(inode->i_mode & S_IFDIR))
435+
if (!S_ISDIR(inode->i_mode))
436436
return 0;
437437
if (inode->i_nlink != 1)
438438
return 0;
439439
break;
440440
case ORANGEFS_TYPE_SYMLINK:
441-
if (!(inode->i_mode & S_IFLNK))
441+
if (!S_ISLNK(inode->i_mode))
442442
return 0;
443443
if (orangefs_inode && symname &&
444444
mask & ORANGEFS_ATTR_SYS_LNK_TARGET)

0 commit comments

Comments
 (0)