From: Christoph Hellwig <hch@lst.de>
To: linux-xfs@vger.kernel.org
Cc: Ian Kent <raven@themaw.net>, Eric Sandeen <sandeen@redhat.com>
Subject: [PATCH 02/12] xfs: remove the dsunit and dswidth variables in xfs_parseargs
Date: Sun, 27 Oct 2019 15:55:37 +0100 [thread overview]
Message-ID: <20191027145547.25157-3-hch@lst.de> (raw)
In-Reply-To: <20191027145547.25157-1-hch@lst.de>
There is no real need for the local variables here - either they
are applied to the mount structure, or if the noalign mount option
is set the mount will fail entirely if either is set. Removing
them helps cleaning up the mount API conversion.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
---
fs/xfs/xfs_super.c | 27 ++++++++-------------------
1 file changed, 8 insertions(+), 19 deletions(-)
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index 589c080cabfe..4089de3daded 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -159,8 +159,6 @@ xfs_parseargs(
const struct super_block *sb = mp->m_super;
char *p;
substring_t args[MAX_OPT_ARGS];
- int dsunit = 0;
- int dswidth = 0;
int iosize = 0;
uint8_t iosizelog = 0;
@@ -252,11 +250,11 @@ xfs_parseargs(
mp->m_flags |= XFS_MOUNT_SWALLOC;
break;
case Opt_sunit:
- if (match_int(args, &dsunit))
+ if (match_int(args, &mp->m_dalign))
return -EINVAL;
break;
case Opt_swidth:
- if (match_int(args, &dswidth))
+ if (match_int(args, &mp->m_swidth))
return -EINVAL;
break;
case Opt_inode32:
@@ -350,7 +348,8 @@ xfs_parseargs(
return -EINVAL;
}
- if ((mp->m_flags & XFS_MOUNT_NOALIGN) && (dsunit || dswidth)) {
+ if ((mp->m_flags & XFS_MOUNT_NOALIGN) &&
+ (mp->m_dalign || mp->m_swidth)) {
xfs_warn(mp,
"sunit and swidth options incompatible with the noalign option");
return -EINVAL;
@@ -363,30 +362,20 @@ xfs_parseargs(
}
#endif
- if ((dsunit && !dswidth) || (!dsunit && dswidth)) {
+ if ((mp->m_dalign && !mp->m_swidth) ||
+ (!mp->m_dalign && mp->m_swidth)) {
xfs_warn(mp, "sunit and swidth must be specified together");
return -EINVAL;
}
- if (dsunit && (dswidth % dsunit != 0)) {
+ if (mp->m_dalign && (mp->m_swidth % mp->m_dalign != 0)) {
xfs_warn(mp,
"stripe width (%d) must be a multiple of the stripe unit (%d)",
- dswidth, dsunit);
+ mp->m_swidth, mp->m_dalign);
return -EINVAL;
}
done:
- if (dsunit && !(mp->m_flags & XFS_MOUNT_NOALIGN)) {
- /*
- * At this point the superblock has not been read
- * in, therefore we do not know the block size.
- * Before the mount call ends we will convert
- * these to FSBs.
- */
- mp->m_dalign = dsunit;
- mp->m_swidth = dswidth;
- }
-
if (mp->m_logbufs != -1 &&
mp->m_logbufs != 0 &&
(mp->m_logbufs < XLOG_MIN_ICLOGS ||
--
2.20.1
next prev parent reply other threads:[~2019-10-27 14:55 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-27 14:55 decruft misc mount related code v2 Christoph Hellwig
2019-10-27 14:55 ` [PATCH 01/12] xfs: remove the biosize mount option Christoph Hellwig
2019-10-27 14:55 ` Christoph Hellwig [this message]
2019-10-28 16:50 ` [PATCH 02/12] xfs: remove the dsunit and dswidth variables in xfs_parseargs Darrick J. Wong
2019-10-27 14:55 ` [PATCH 03/12] xfs: cleanup calculating the stat optimal I/O size Christoph Hellwig
2019-10-28 16:50 ` Darrick J. Wong
2019-10-27 14:55 ` [PATCH 04/12] xfs: don't use a different allocsice for -o wsync mounts Christoph Hellwig
2019-10-28 17:05 ` Darrick J. Wong
2019-10-27 14:55 ` [PATCH 05/12] xfs: remove the m_readio_* fields in struct xfs_mount Christoph Hellwig
2019-10-28 17:06 ` Darrick J. Wong
2019-10-27 14:55 ` [PATCH 06/12] xfs: rename the m_writeio_* " Christoph Hellwig
2019-10-28 17:07 ` Darrick J. Wong
2019-10-27 14:55 ` [PATCH 07/12] xfs: simplify parsing of allocsize mount option Christoph Hellwig
2019-10-28 17:11 ` Darrick J. Wong
2019-10-27 14:55 ` [PATCH 08/12] xfs: rename the XFS_MOUNT_DFLT_IOSIZE option to XFS_MOUNT_ALLOCISZE Christoph Hellwig
2019-10-28 17:12 ` Darrick J. Wong
2019-10-29 7:50 ` Christoph Hellwig
2019-10-27 14:55 ` [PATCH 09/12] xfs: reverse the polarity of XFS_MOUNT_COMPAT_IOSIZE Christoph Hellwig
2019-10-28 17:13 ` Darrick J. Wong
2019-10-27 14:55 ` [PATCH 10/12] xfs: clean up printing the allocsize option in xfs_showargs Christoph Hellwig
2019-10-28 17:13 ` Darrick J. Wong
2019-10-27 14:55 ` [PATCH 11/12] xfs: clean up printing inode32/64 " Christoph Hellwig
2019-10-28 17:14 ` Darrick J. Wong
2019-10-27 14:55 ` [PATCH 12/12] xfs: merge xfs_showargs into xfs_fs_show_options Christoph Hellwig
2019-10-28 17:14 ` Darrick J. Wong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191027145547.25157-3-hch@lst.de \
--to=hch@lst.de \
--cc=linux-xfs@vger.kernel.org \
--cc=raven@themaw.net \
--cc=sandeen@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox