[XFS] Show all mount args in /proc/mounts

There are several mount options that don't show up in /proc/mounts. Add
them in and clean up the showargs code at the same time.

SGI-PV: 971186
SGI-Modid: xfs-linux-melb:xfs-kern:30004a

Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
This commit is contained in:
David Chinner 2007-11-23 16:28:24 +11:00 committed by Lachlan McIlroy
parent 8ae2c0f64a
commit 786f486f81

View file

@ -1806,15 +1806,17 @@ xfs_parseargs(
return 0; return 0;
} }
struct proc_xfs_info {
int flag;
char *str;
};
int int
xfs_showargs( xfs_showargs(
struct xfs_mount *mp, struct xfs_mount *mp,
struct seq_file *m) struct seq_file *m)
{ {
static struct proc_xfs_info { static struct proc_xfs_info xfs_info_set[] = {
int flag;
char *str;
} xfs_info[] = {
/* the few simple ones we can get from the mount struct */ /* the few simple ones we can get from the mount struct */
{ XFS_MOUNT_WSYNC, "," MNTOPT_WSYNC }, { XFS_MOUNT_WSYNC, "," MNTOPT_WSYNC },
{ XFS_MOUNT_INO64, "," MNTOPT_INO64 }, { XFS_MOUNT_INO64, "," MNTOPT_INO64 },
@ -1823,14 +1825,30 @@ xfs_showargs(
{ XFS_MOUNT_NOUUID, "," MNTOPT_NOUUID }, { XFS_MOUNT_NOUUID, "," MNTOPT_NOUUID },
{ XFS_MOUNT_NORECOVERY, "," MNTOPT_NORECOVERY }, { XFS_MOUNT_NORECOVERY, "," MNTOPT_NORECOVERY },
{ XFS_MOUNT_OSYNCISOSYNC, "," MNTOPT_OSYNCISOSYNC }, { XFS_MOUNT_OSYNCISOSYNC, "," MNTOPT_OSYNCISOSYNC },
{ XFS_MOUNT_ATTR2, "," MNTOPT_ATTR2 },
{ XFS_MOUNT_FILESTREAMS, "," MNTOPT_FILESTREAM },
{ XFS_MOUNT_DMAPI, "," MNTOPT_DMAPI },
{ XFS_MOUNT_GRPID, "," MNTOPT_GRPID },
{ 0, NULL }
};
static struct proc_xfs_info xfs_info_unset[] = {
/* the few simple ones we can get from the mount struct */
{ XFS_MOUNT_IDELETE, "," MNTOPT_IKEEP },
{ XFS_MOUNT_COMPAT_IOSIZE, "," MNTOPT_LARGEIO },
{ XFS_MOUNT_BARRIER, "," MNTOPT_NOBARRIER },
{ XFS_MOUNT_SMALL_INUMS, "," MNTOPT_64BITINODE },
{ 0, NULL } { 0, NULL }
}; };
struct proc_xfs_info *xfs_infop; struct proc_xfs_info *xfs_infop;
for (xfs_infop = xfs_info; xfs_infop->flag; xfs_infop++) { for (xfs_infop = xfs_info_set; xfs_infop->flag; xfs_infop++) {
if (mp->m_flags & xfs_infop->flag) if (mp->m_flags & xfs_infop->flag)
seq_puts(m, xfs_infop->str); seq_puts(m, xfs_infop->str);
} }
for (xfs_infop = xfs_info_unset; xfs_infop->flag; xfs_infop++) {
if (!(mp->m_flags & xfs_infop->flag))
seq_puts(m, xfs_infop->str);
}
if (mp->m_flags & XFS_MOUNT_DFLT_IOSIZE) if (mp->m_flags & XFS_MOUNT_DFLT_IOSIZE)
seq_printf(m, "," MNTOPT_ALLOCSIZE "=%dk", seq_printf(m, "," MNTOPT_ALLOCSIZE "=%dk",
@ -1853,41 +1871,23 @@ xfs_showargs(
seq_printf(m, "," MNTOPT_SWIDTH "=%d", seq_printf(m, "," MNTOPT_SWIDTH "=%d",
(int)XFS_FSB_TO_BB(mp, mp->m_swidth)); (int)XFS_FSB_TO_BB(mp, mp->m_swidth));
if (!(mp->m_flags & XFS_MOUNT_IDELETE)) if (mp->m_qflags & (XFS_UQUOTA_ACCT|XFS_UQUOTA_ENFD))
seq_printf(m, "," MNTOPT_IKEEP); seq_puts(m, "," MNTOPT_USRQUOTA);
if (!(mp->m_flags & XFS_MOUNT_COMPAT_IOSIZE)) else if (mp->m_qflags & XFS_UQUOTA_ACCT)
seq_printf(m, "," MNTOPT_LARGEIO); seq_puts(m, "," MNTOPT_UQUOTANOENF);
if (!(mp->m_flags & XFS_MOUNT_SMALL_INUMS)) if (mp->m_qflags & (XFS_PQUOTA_ACCT|XFS_OQUOTA_ENFD))
seq_printf(m, "," MNTOPT_64BITINODE); seq_puts(m, "," MNTOPT_PRJQUOTA);
if (mp->m_flags & XFS_MOUNT_GRPID) else if (mp->m_qflags & XFS_PQUOTA_ACCT)
seq_printf(m, "," MNTOPT_GRPID); seq_puts(m, "," MNTOPT_PQUOTANOENF);
if (mp->m_qflags & XFS_UQUOTA_ACCT) { if (mp->m_qflags & (XFS_GQUOTA_ACCT|XFS_OQUOTA_ENFD))
if (mp->m_qflags & XFS_UQUOTA_ENFD) seq_puts(m, "," MNTOPT_GRPQUOTA);
seq_puts(m, "," MNTOPT_USRQUOTA); else if (mp->m_qflags & XFS_GQUOTA_ACCT)
else seq_puts(m, "," MNTOPT_GQUOTANOENF);
seq_puts(m, "," MNTOPT_UQUOTANOENF);
}
if (mp->m_qflags & XFS_PQUOTA_ACCT) {
if (mp->m_qflags & XFS_OQUOTA_ENFD)
seq_puts(m, "," MNTOPT_PRJQUOTA);
else
seq_puts(m, "," MNTOPT_PQUOTANOENF);
}
if (mp->m_qflags & XFS_GQUOTA_ACCT) {
if (mp->m_qflags & XFS_OQUOTA_ENFD)
seq_puts(m, "," MNTOPT_GRPQUOTA);
else
seq_puts(m, "," MNTOPT_GQUOTANOENF);
}
if (!(mp->m_qflags & XFS_ALL_QUOTA_ACCT)) if (!(mp->m_qflags & XFS_ALL_QUOTA_ACCT))
seq_puts(m, "," MNTOPT_NOQUOTA); seq_puts(m, "," MNTOPT_NOQUOTA);
if (mp->m_flags & XFS_MOUNT_DMAPI)
seq_puts(m, "," MNTOPT_DMAPI);
return 0; return 0;
} }