提交 cf22644a 编写于 作者: M Martin Brandenburg 提交者: Mike Marshall

orangefs: use S_ISREG(mode) and friends instead of mode & S_IFREG.

Suggestion from Dan Carpenter.
Signed-off-by: NMartin Brandenburg <martin@omnibond.com>
Signed-off-by: NMike Marshall <hubcap@omnibond.com>
上级 78699e29
...@@ -428,17 +428,17 @@ static int compare_attributes_to_inode(struct inode *inode, ...@@ -428,17 +428,17 @@ static int compare_attributes_to_inode(struct inode *inode,
switch (attrs->objtype) { switch (attrs->objtype) {
case ORANGEFS_TYPE_METAFILE: case ORANGEFS_TYPE_METAFILE:
if (!(inode->i_mode & S_IFREG)) if (!S_ISREG(inode->i_mode))
return 0; return 0;
break; break;
case ORANGEFS_TYPE_DIRECTORY: case ORANGEFS_TYPE_DIRECTORY:
if (!(inode->i_mode & S_IFDIR)) if (!S_ISDIR(inode->i_mode))
return 0; return 0;
if (inode->i_nlink != 1) if (inode->i_nlink != 1)
return 0; return 0;
break; break;
case ORANGEFS_TYPE_SYMLINK: case ORANGEFS_TYPE_SYMLINK:
if (!(inode->i_mode & S_IFLNK)) if (!S_ISLNK(inode->i_mode))
return 0; return 0;
if (orangefs_inode && symname && if (orangefs_inode && symname &&
mask & ORANGEFS_ATTR_SYS_LNK_TARGET) mask & ORANGEFS_ATTR_SYS_LNK_TARGET)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册