提交 2ccf4a9b 编写于 作者: E Eric Sandeen 提交者: Dave Chinner

xfs: collapse allocsize and biosize mount option handling

The allocsize and biosize mount options are handled identically,
other than allocsize accepting suffixes.  suffix_kstrtoint handles
bare numbers just fine too, so these can be collapsed.
Signed-off-by: NEric Sandeen <sandeen@redhat.com>
Reviewed-by: NDave Chinner <dchinner@redhat.com>
Signed-off-by: NDave Chinner <david@fromorbit.com>
上级 03754234
...@@ -261,16 +261,8 @@ xfs_parseargs( ...@@ -261,16 +261,8 @@ xfs_parseargs(
mp->m_rtname = kstrndup(value, MAXNAMELEN, GFP_KERNEL); mp->m_rtname = kstrndup(value, MAXNAMELEN, GFP_KERNEL);
if (!mp->m_rtname) if (!mp->m_rtname)
return -ENOMEM; return -ENOMEM;
} else if (!strcmp(this_char, MNTOPT_BIOSIZE)) { } else if (!strcmp(this_char, MNTOPT_ALLOCSIZE) ||
if (!value || !*value) { !strcmp(this_char, MNTOPT_BIOSIZE)) {
xfs_warn(mp, "%s option requires an argument",
this_char);
return -EINVAL;
}
if (kstrtoint(value, 10, &iosize))
return -EINVAL;
iosizelog = ffs(iosize) - 1;
} else if (!strcmp(this_char, MNTOPT_ALLOCSIZE)) {
if (!value || !*value) { if (!value || !*value) {
xfs_warn(mp, "%s option requires an argument", xfs_warn(mp, "%s option requires an argument",
this_char); this_char);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册