diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-07-26 02:31:30 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2011-07-26 15:05:16 -0400 |
commit | abbede1b3a680e108d61aaa415ce5153296e775d (patch) | |
tree | 0fb8b8db864e5919b02f5d7dd2d66474e76a39d5 /fs/xfs/xfs_inode.c | |
parent | c46c887744b330795eba55fdb96343c36d481765 (diff) |
xfs: get rid of open-coded S_ISREG(), etc.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/xfs/xfs_inode.c')
-rw-r--r-- | fs/xfs/xfs_inode.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index 3cc21ddf9f7e..2fcca4b03ed3 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c | |||
@@ -368,7 +368,7 @@ xfs_iformat( | |||
368 | /* | 368 | /* |
369 | * no local regular files yet | 369 | * no local regular files yet |
370 | */ | 370 | */ |
371 | if (unlikely((be16_to_cpu(dip->di_mode) & S_IFMT) == S_IFREG)) { | 371 | if (unlikely(S_ISREG(be16_to_cpu(dip->di_mode)))) { |
372 | xfs_warn(ip->i_mount, | 372 | xfs_warn(ip->i_mount, |
373 | "corrupt inode %Lu (local format for regular file).", | 373 | "corrupt inode %Lu (local format for regular file).", |
374 | (unsigned long long) ip->i_ino); | 374 | (unsigned long long) ip->i_ino); |
@@ -1040,7 +1040,7 @@ xfs_ialloc( | |||
1040 | 1040 | ||
1041 | if (pip && XFS_INHERIT_GID(pip)) { | 1041 | if (pip && XFS_INHERIT_GID(pip)) { |
1042 | ip->i_d.di_gid = pip->i_d.di_gid; | 1042 | ip->i_d.di_gid = pip->i_d.di_gid; |
1043 | if ((pip->i_d.di_mode & S_ISGID) && (mode & S_IFMT) == S_IFDIR) { | 1043 | if ((pip->i_d.di_mode & S_ISGID) && S_ISDIR(mode)) { |
1044 | ip->i_d.di_mode |= S_ISGID; | 1044 | ip->i_d.di_mode |= S_ISGID; |
1045 | } | 1045 | } |
1046 | } | 1046 | } |
@@ -1097,14 +1097,14 @@ xfs_ialloc( | |||
1097 | if (pip && (pip->i_d.di_flags & XFS_DIFLAG_ANY)) { | 1097 | if (pip && (pip->i_d.di_flags & XFS_DIFLAG_ANY)) { |
1098 | uint di_flags = 0; | 1098 | uint di_flags = 0; |
1099 | 1099 | ||
1100 | if ((mode & S_IFMT) == S_IFDIR) { | 1100 | if (S_ISDIR(mode)) { |
1101 | if (pip->i_d.di_flags & XFS_DIFLAG_RTINHERIT) | 1101 | if (pip->i_d.di_flags & XFS_DIFLAG_RTINHERIT) |
1102 | di_flags |= XFS_DIFLAG_RTINHERIT; | 1102 | di_flags |= XFS_DIFLAG_RTINHERIT; |
1103 | if (pip->i_d.di_flags & XFS_DIFLAG_EXTSZINHERIT) { | 1103 | if (pip->i_d.di_flags & XFS_DIFLAG_EXTSZINHERIT) { |
1104 | di_flags |= XFS_DIFLAG_EXTSZINHERIT; | 1104 | di_flags |= XFS_DIFLAG_EXTSZINHERIT; |
1105 | ip->i_d.di_extsize = pip->i_d.di_extsize; | 1105 | ip->i_d.di_extsize = pip->i_d.di_extsize; |
1106 | } | 1106 | } |
1107 | } else if ((mode & S_IFMT) == S_IFREG) { | 1107 | } else if (S_ISREG(mode)) { |
1108 | if (pip->i_d.di_flags & XFS_DIFLAG_RTINHERIT) | 1108 | if (pip->i_d.di_flags & XFS_DIFLAG_RTINHERIT) |
1109 | di_flags |= XFS_DIFLAG_REALTIME; | 1109 | di_flags |= XFS_DIFLAG_REALTIME; |
1110 | if (pip->i_d.di_flags & XFS_DIFLAG_EXTSZINHERIT) { | 1110 | if (pip->i_d.di_flags & XFS_DIFLAG_EXTSZINHERIT) { |
@@ -1188,7 +1188,7 @@ xfs_isize_check( | |||
1188 | int nimaps; | 1188 | int nimaps; |
1189 | xfs_bmbt_irec_t imaps[2]; | 1189 | xfs_bmbt_irec_t imaps[2]; |
1190 | 1190 | ||
1191 | if ((ip->i_d.di_mode & S_IFMT) != S_IFREG) | 1191 | if (!S_ISREG(ip->i_d.di_mode)) |
1192 | return; | 1192 | return; |
1193 | 1193 | ||
1194 | if (XFS_IS_REALTIME_INODE(ip)) | 1194 | if (XFS_IS_REALTIME_INODE(ip)) |
@@ -1828,7 +1828,7 @@ xfs_ifree( | |||
1828 | ASSERT(ip->i_d.di_nextents == 0); | 1828 | ASSERT(ip->i_d.di_nextents == 0); |
1829 | ASSERT(ip->i_d.di_anextents == 0); | 1829 | ASSERT(ip->i_d.di_anextents == 0); |
1830 | ASSERT((ip->i_d.di_size == 0 && ip->i_size == 0) || | 1830 | ASSERT((ip->i_d.di_size == 0 && ip->i_size == 0) || |
1831 | ((ip->i_d.di_mode & S_IFMT) != S_IFREG)); | 1831 | (!S_ISREG(ip->i_d.di_mode))); |
1832 | ASSERT(ip->i_d.di_nblocks == 0); | 1832 | ASSERT(ip->i_d.di_nblocks == 0); |
1833 | 1833 | ||
1834 | /* | 1834 | /* |
@@ -2671,7 +2671,7 @@ xfs_iflush_int( | |||
2671 | __func__, ip->i_ino, ip, ip->i_d.di_magic); | 2671 | __func__, ip->i_ino, ip, ip->i_d.di_magic); |
2672 | goto corrupt_out; | 2672 | goto corrupt_out; |
2673 | } | 2673 | } |
2674 | if ((ip->i_d.di_mode & S_IFMT) == S_IFREG) { | 2674 | if (S_ISREG(ip->i_d.di_mode)) { |
2675 | if (XFS_TEST_ERROR( | 2675 | if (XFS_TEST_ERROR( |
2676 | (ip->i_d.di_format != XFS_DINODE_FMT_EXTENTS) && | 2676 | (ip->i_d.di_format != XFS_DINODE_FMT_EXTENTS) && |
2677 | (ip->i_d.di_format != XFS_DINODE_FMT_BTREE), | 2677 | (ip->i_d.di_format != XFS_DINODE_FMT_BTREE), |
@@ -2681,7 +2681,7 @@ xfs_iflush_int( | |||
2681 | __func__, ip->i_ino, ip); | 2681 | __func__, ip->i_ino, ip); |
2682 | goto corrupt_out; | 2682 | goto corrupt_out; |
2683 | } | 2683 | } |
2684 | } else if ((ip->i_d.di_mode & S_IFMT) == S_IFDIR) { | 2684 | } else if (S_ISDIR(ip->i_d.di_mode)) { |
2685 | if (XFS_TEST_ERROR( | 2685 | if (XFS_TEST_ERROR( |
2686 | (ip->i_d.di_format != XFS_DINODE_FMT_EXTENTS) && | 2686 | (ip->i_d.di_format != XFS_DINODE_FMT_EXTENTS) && |
2687 | (ip->i_d.di_format != XFS_DINODE_FMT_BTREE) && | 2687 | (ip->i_d.di_format != XFS_DINODE_FMT_BTREE) && |