提交 69e8575d 编写于 作者: C Christoph Hellwig 提交者: Darrick J. Wong

xfs: remove the dsunit and dswidth variables in

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: NChristoph Hellwig <hch@lst.de>
Reviewed-by: NEric Sandeen <sandeen@redhat.com>
Reviewed-by: NDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com>
上级 8da57c5c
...@@ -159,8 +159,6 @@ xfs_parseargs( ...@@ -159,8 +159,6 @@ xfs_parseargs(
const struct super_block *sb = mp->m_super; const struct super_block *sb = mp->m_super;
char *p; char *p;
substring_t args[MAX_OPT_ARGS]; substring_t args[MAX_OPT_ARGS];
int dsunit = 0;
int dswidth = 0;
int iosize = 0; int iosize = 0;
uint8_t iosizelog = 0; uint8_t iosizelog = 0;
...@@ -252,11 +250,11 @@ xfs_parseargs( ...@@ -252,11 +250,11 @@ xfs_parseargs(
mp->m_flags |= XFS_MOUNT_SWALLOC; mp->m_flags |= XFS_MOUNT_SWALLOC;
break; break;
case Opt_sunit: case Opt_sunit:
if (match_int(args, &dsunit)) if (match_int(args, &mp->m_dalign))
return -EINVAL; return -EINVAL;
break; break;
case Opt_swidth: case Opt_swidth:
if (match_int(args, &dswidth)) if (match_int(args, &mp->m_swidth))
return -EINVAL; return -EINVAL;
break; break;
case Opt_inode32: case Opt_inode32:
...@@ -350,7 +348,8 @@ xfs_parseargs( ...@@ -350,7 +348,8 @@ xfs_parseargs(
return -EINVAL; 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, xfs_warn(mp,
"sunit and swidth options incompatible with the noalign option"); "sunit and swidth options incompatible with the noalign option");
return -EINVAL; return -EINVAL;
...@@ -363,30 +362,20 @@ xfs_parseargs( ...@@ -363,30 +362,20 @@ xfs_parseargs(
} }
#endif #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"); xfs_warn(mp, "sunit and swidth must be specified together");
return -EINVAL; return -EINVAL;
} }
if (dsunit && (dswidth % dsunit != 0)) { if (mp->m_dalign && (mp->m_swidth % mp->m_dalign != 0)) {
xfs_warn(mp, xfs_warn(mp,
"stripe width (%d) must be a multiple of the stripe unit (%d)", "stripe width (%d) must be a multiple of the stripe unit (%d)",
dswidth, dsunit); mp->m_swidth, mp->m_dalign);
return -EINVAL; return -EINVAL;
} }
done: 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 && if (mp->m_logbufs != -1 &&
mp->m_logbufs != 0 && mp->m_logbufs != 0 &&
(mp->m_logbufs < XLOG_MIN_ICLOGS || (mp->m_logbufs < XLOG_MIN_ICLOGS ||
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册