* [PATCH] xfs: collapse allocsize and biosize mount option handling
@ 2015-08-21 21:15 Eric Sandeen
2015-08-24 12:41 ` Brian Foster
0 siblings, 1 reply; 2+ messages in thread
From: Eric Sandeen @ 2015-08-21 21:15 UTC (permalink / raw)
To: xfs-oss
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.
(In other news, though, maybe biosize needs to be deprecated?
XFS_IOC_SETBIOSIZE and XFS_IOC_GETBIOSIZE are deprecated, and
"biosize" was removed from Documentation/ back in 2005 ...)
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index 1fb1656..4bd6c0d 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -261,16 +261,8 @@ xfs_parseargs(
mp->m_rtname = kstrndup(value, MAXNAMELEN, GFP_KERNEL);
if (!mp->m_rtname)
return -ENOMEM;
- } else if (!strcmp(this_char, MNTOPT_BIOSIZE)) {
- if (!value || !*value) {
- 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)) {
+ } else if (!strcmp(this_char, MNTOPT_ALLOCSIZE) ||
+ !strcmp(this_char, MNTOPT_BIOSIZE)) {
if (!value || !*value) {
xfs_warn(mp, "%s option requires an argument",
this_char);
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] xfs: collapse allocsize and biosize mount option handling
2015-08-21 21:15 [PATCH] xfs: collapse allocsize and biosize mount option handling Eric Sandeen
@ 2015-08-24 12:41 ` Brian Foster
0 siblings, 0 replies; 2+ messages in thread
From: Brian Foster @ 2015-08-24 12:41 UTC (permalink / raw)
To: Eric Sandeen; +Cc: xfs-oss
On Fri, Aug 21, 2015 at 04:15:48PM -0500, Eric Sandeen wrote:
> 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.
>
> (In other news, though, maybe biosize needs to be deprecated?
> XFS_IOC_SETBIOSIZE and XFS_IOC_GETBIOSIZE are deprecated, and
> "biosize" was removed from Documentation/ back in 2005 ...)
>
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---
Reviewed-by: Brian Foster <bfoster@redhat.com>
>
> diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
> index 1fb1656..4bd6c0d 100644
> --- a/fs/xfs/xfs_super.c
> +++ b/fs/xfs/xfs_super.c
> @@ -261,16 +261,8 @@ xfs_parseargs(
> mp->m_rtname = kstrndup(value, MAXNAMELEN, GFP_KERNEL);
> if (!mp->m_rtname)
> return -ENOMEM;
> - } else if (!strcmp(this_char, MNTOPT_BIOSIZE)) {
> - if (!value || !*value) {
> - 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)) {
> + } else if (!strcmp(this_char, MNTOPT_ALLOCSIZE) ||
> + !strcmp(this_char, MNTOPT_BIOSIZE)) {
> if (!value || !*value) {
> xfs_warn(mp, "%s option requires an argument",
> this_char);
>
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-08-24 12:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-21 21:15 [PATCH] xfs: collapse allocsize and biosize mount option handling Eric Sandeen
2015-08-24 12:41 ` Brian Foster
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox