aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_mount.c
diff options
context:
space:
mode:
authorJie Liu <jeff.liu@oracle.com>2013-05-02 07:27:47 -0400
committerBen Myers <bpm@sgi.com>2013-06-19 15:54:17 -0400
commit39a45d8463d98ea57347b871641136be64b216a9 (patch)
tree7184b8d6abaec378fc41d007fe45dc1abfce99e5 /fs/xfs/xfs_mount.c
parent2fb8b5027dbde32a45edf5f3d7ee082be9261d93 (diff)
xfs: Remove XFS_MOUNT_RETERR
XFS_MOUNT_RETERR is going to be set at xfs_parseargs() if mp->m_dalign is enabled, so any time we enter "if (mp->m_dalign)" branch in xfs_update_alignment(), XFS_MOUNT_RETERR is set and so we always be emitting a warning and returning an error. Hence, we can remove it and get rid of a couple of redundant check up against it at xfs_upate_alignment(). Thanks Dave Chinner for the suggestions of simplify the code in xfs_parseargs(). Signed-off-by: Jie Liu <jeff.liu@oracle.com> Cc: Dave Chinner <dchinner@redhat.com> Cc: Mark Tinguely <tinguely@sgi.com> Reviewed-by: Mark Tinguely <tinguely@sgi.com> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_mount.c')
-rw-r--r--fs/xfs/xfs_mount.c37
1 files changed, 11 insertions, 26 deletions
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
index 6a19434eba2a..2978bb4cc72a 100644
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -987,42 +987,27 @@ xfs_update_alignment(xfs_mount_t *mp)
987 */ 987 */
988 if ((BBTOB(mp->m_dalign) & mp->m_blockmask) || 988 if ((BBTOB(mp->m_dalign) & mp->m_blockmask) ||
989 (BBTOB(mp->m_swidth) & mp->m_blockmask)) { 989 (BBTOB(mp->m_swidth) & mp->m_blockmask)) {
990 if (mp->m_flags & XFS_MOUNT_RETERR) { 990 xfs_warn(mp,
991 xfs_warn(mp, "alignment check failed: " 991 "alignment check failed: sunit/swidth vs. blocksize(%d)",
992 "(sunit/swidth vs. blocksize)"); 992 sbp->sb_blocksize);
993 return XFS_ERROR(EINVAL); 993 return XFS_ERROR(EINVAL);
994 }
995 mp->m_dalign = mp->m_swidth = 0;
996 } else { 994 } else {
997 /* 995 /*
998 * Convert the stripe unit and width to FSBs. 996 * Convert the stripe unit and width to FSBs.
999 */ 997 */
1000 mp->m_dalign = XFS_BB_TO_FSBT(mp, mp->m_dalign); 998 mp->m_dalign = XFS_BB_TO_FSBT(mp, mp->m_dalign);
1001 if (mp->m_dalign && (sbp->sb_agblocks % mp->m_dalign)) { 999 if (mp->m_dalign && (sbp->sb_agblocks % mp->m_dalign)) {
1002 if (mp->m_flags & XFS_MOUNT_RETERR) {
1003 xfs_warn(mp, "alignment check failed: "
1004 "(sunit/swidth vs. ag size)");
1005 return XFS_ERROR(EINVAL);
1006 }
1007 xfs_warn(mp, 1000 xfs_warn(mp,
1008 "stripe alignment turned off: sunit(%d)/swidth(%d) " 1001 "alignment check failed: sunit/swidth vs. agsize(%d)",
1009 "incompatible with agsize(%d)", 1002 sbp->sb_agblocks);
1010 mp->m_dalign, mp->m_swidth, 1003 return XFS_ERROR(EINVAL);
1011 sbp->sb_agblocks);
1012
1013 mp->m_dalign = 0;
1014 mp->m_swidth = 0;
1015 } else if (mp->m_dalign) { 1004 } else if (mp->m_dalign) {
1016 mp->m_swidth = XFS_BB_TO_FSBT(mp, mp->m_swidth); 1005 mp->m_swidth = XFS_BB_TO_FSBT(mp, mp->m_swidth);
1017 } else { 1006 } else {
1018 if (mp->m_flags & XFS_MOUNT_RETERR) { 1007 xfs_warn(mp,
1019 xfs_warn(mp, "alignment check failed: " 1008 "alignment check failed: sunit(%d) less than bsize(%d)",
1020 "sunit(%d) less than bsize(%d)", 1009 mp->m_dalign, sbp->sb_blocksize);
1021 mp->m_dalign, 1010 return XFS_ERROR(EINVAL);
1022 mp->m_blockmask +1);
1023 return XFS_ERROR(EINVAL);
1024 }
1025 mp->m_swidth = 0;
1026 } 1011 }
1027 } 1012 }
1028 1013