Skip to content

Commit

Permalink
orangefs: use S_ISREG(mode) and friends instead of mode & S_IFREG.
Browse files Browse the repository at this point in the history
Suggestion from Dan Carpenter.

Signed-off-by: Martin Brandenburg <martin@omnibond.com>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
  • Loading branch information
Martin Brandenburg authored and Mike Marshall committed Feb 19, 2016
1 parent 78699e2 commit cf22644
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fs/orangefs/orangefs-utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,17 +428,17 @@ static int compare_attributes_to_inode(struct inode *inode,

switch (attrs->objtype) {
case ORANGEFS_TYPE_METAFILE:
if (!(inode->i_mode & S_IFREG))
if (!S_ISREG(inode->i_mode))
return 0;
break;
case ORANGEFS_TYPE_DIRECTORY:
if (!(inode->i_mode & S_IFDIR))
if (!S_ISDIR(inode->i_mode))
return 0;
if (inode->i_nlink != 1)
return 0;
break;
case ORANGEFS_TYPE_SYMLINK:
if (!(inode->i_mode & S_IFLNK))
if (!S_ISLNK(inode->i_mode))
return 0;
if (orangefs_inode && symname &&
mask & ORANGEFS_ATTR_SYS_LNK_TARGET)
Expand Down

0 comments on commit cf22644

Please sign in to comment.