提交 de94a2e1 编写于 作者: Z Zeng Heng 提交者: Dave Chinner

xfs: simplify if-else condition in xfs_validate_new_dalign

"else" is not generally useful after a return,
so remove them which makes if condition a bit
more clear.

There is no logical changes.
Signed-off-by: NZeng Heng <zengheng4@huawei.com>
Reviewed-by: NDarrick J. Wong <djwong@kernel.org>
Signed-off-by: NDave Chinner <david@fromorbit.com>
上级 92b40768
......@@ -300,7 +300,8 @@ xfs_validate_new_dalign(
"alignment check failed: sunit/swidth vs. blocksize(%d)",
mp->m_sb.sb_blocksize);
return -EINVAL;
} else {
}
/*
* Convert the stripe unit and width to FSBs.
*/
......@@ -310,15 +311,16 @@ xfs_validate_new_dalign(
"alignment check failed: sunit/swidth vs. agsize(%d)",
mp->m_sb.sb_agblocks);
return -EINVAL;
} else if (mp->m_dalign) {
mp->m_swidth = XFS_BB_TO_FSBT(mp, mp->m_swidth);
} else {
}
if (!mp->m_dalign) {
xfs_warn(mp,
"alignment check failed: sunit(%d) less than bsize(%d)",
mp->m_dalign, mp->m_sb.sb_blocksize);
return -EINVAL;
}
}
mp->m_swidth = XFS_BB_TO_FSBT(mp, mp->m_swidth);
if (!xfs_has_dalign(mp)) {
xfs_warn(mp,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册