Date: Wed, 1 Jun 2005 21:43:51 +0800 From: Xin LI <delphij@frontfree.net> To: Bruce Evans <bde@zeta.org.au> Cc: delphij@delphij.net, freebsd-arch@freebsd.org Subject: Re: [PATCH RFC] Add a macro for null mount options to sbin/mount* Message-ID: <20050601134351.GA76097@frontfree.net> In-Reply-To: <20050601211628.V96009@delplex.bde.org> References: <1117613456.771.16.camel@spirit> <20050601211628.V96009@delplex.bde.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--GID0FwUMdk1T2AWN
Content-Type: multipart/mixed; boundary="xHFwDpU9dbj6ez1V"
Content-Disposition: inline
--xHFwDpU9dbj6ez1V
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
On Wed, Jun 01, 2005 at 09:23:23PM +1000, Bruce Evans wrote:
> On Wed, 1 Jun 2005, Xin LI wrote:
>=20
> >In our mount* utilities, the null mount option, which is usually be used
> >as a terminator of an option vector, is defined with some hand-rolled
> >terms, e.g.: {NULL}, {NULL, 0, 0, 0}, etc.
>=20
> "{ NULL }" is the documented way. See getmntopts.3.
>
> >I think it would be nice to have a new macro to deal with this, say,
> >MOPT_NULL, which would be extended to {NULL, 0, 0, 0}, which can act as
> >an explicit initialize. And in my opinion, something like:
> >
> >%%%
> >opt =3D {
> > MOPT_STD,
> > MOPT_NULL
> >};
> >%%%
>=20
> MOPT_NULL is a poor name. It is not a null option, but a terminator that
> happens to have nulls in it.
Agreed... Will the patch found in attachment look better? It also
updates the manpage.
Cheers,
--=20
Xin LI <delphij frontfree net> http://www.delphij.net/
See complete headers for GPG key and other information.
--xHFwDpU9dbj6ez1V
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=patch-mntopts
Content-Transfer-Encoding: quoted-printable
Index: mount/getmntopts.3
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/src/sbin/mount/getmntopts.3,v
retrieving revision 1.13
diff -u -r1.13 getmntopts.3
--- mount/getmntopts.3 9 Apr 2004 19:58:30 -0000 1.13
+++ mount/getmntopts.3 1 Jun 2005 13:41:47 -0000
@@ -28,7 +28,7 @@
.\" @(#)getmntopts.3 8.3 (Berkeley) 3/30/95
.\" $FreeBSD: src/sbin/mount/getmntopts.3,v 1.13 2004/04/09 19:58:30 markm=
Exp $
.\"
-.Dd March 30, 1995
+.Dd June 1, 2005
.Dt GETMNTOPTS 3
.Os
.Sh NAME
@@ -148,7 +148,7 @@
struct mntopt mopts[] =3D {
MOPT_STDOPTS,
MOPT_UPDATE,
- { NULL }
+ MOPT_LIST_END
};
=20
...
Index: mount/mntopts.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/src/sbin/mount/mntopts.h,v
retrieving revision 1.25
diff -u -r1.25 mntopts.h
--- mount/mntopts.h 1 Jun 2005 09:39:34 -0000 1.25
+++ mount/mntopts.h 1 Jun 2005 13:35:57 -0000
@@ -66,7 +66,7 @@
#define MOPT_AUTO { "auto", 0, 0, 0 }
=20
/* A handy macro as terminator of MNT_ array */
-#define MOPT_NULL { NULL, 0, 0, 0 }
+#define MOPT_LIST_END { NULL, 0, 0, 0 }
=20
#define MOPT_FSTAB_COMPAT \
MOPT_RO, \
Index: mount/mount_ufs.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/src/sbin/mount/mount_ufs.c,v
retrieving revision 1.25
diff -u -r1.25 mount_ufs.c
--- mount/mount_ufs.c 1 Jun 2005 09:39:34 -0000 1.25
+++ mount/mount_ufs.c 1 Jun 2005 13:34:51 -0000
@@ -64,7 +64,7 @@
MOPT_SYNC,
MOPT_UPDATE,
MOPT_SNAPSHOT,
- MOPT_NULL
+ MOPT_LIST_END
};
=20
int
Index: mount_cd9660/mount_cd9660.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/src/sbin/mount_cd9660/mount_cd9660.c,v
retrieving revision 1.29
diff -u -r1.29 mount_cd9660.c
--- mount_cd9660/mount_cd9660.c 1 Jun 2005 09:39:34 -0000 1.29
+++ mount_cd9660/mount_cd9660.c 1 Jun 2005 13:34:51 -0000
@@ -77,7 +77,7 @@
{ "rrip", 1, ISOFSMNT_NORRIP, 1 },
{ "joliet", 1, ISOFSMNT_NOJOLIET, 1 },
{ "strictjoliet", 1, ISOFSMNT_BROKENJOLIET, 1 },
- MOPT_NULL
+ MOPT_LIST_END
};
=20
int get_ssector(const char *dev);
Index: mount_ext2fs/mount_ext2fs.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/src/sbin/mount_ext2fs/mount_ext2fs.c,v
retrieving revision 1.19
diff -u -r1.19 mount_ext2fs.c
--- mount_ext2fs/mount_ext2fs.c 1 Jun 2005 09:39:34 -0000 1.19
+++ mount_ext2fs/mount_ext2fs.c 1 Jun 2005 13:34:51 -0000
@@ -60,7 +60,7 @@
MOPT_FORCE,
MOPT_SYNC,
MOPT_UPDATE,
- MOPT_NULL
+ MOPT_LIST_END
};
=20
static void usage(void) __dead2;
Index: mount_hpfs/mount_hpfs.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/src/sbin/mount_hpfs/mount_hpfs.c,v
retrieving revision 1.5
diff -u -r1.5 mount_hpfs.c
--- mount_hpfs/mount_hpfs.c 1 Jun 2005 09:39:34 -0000 1.5
+++ mount_hpfs/mount_hpfs.c 1 Jun 2005 13:34:51 -0000
@@ -50,7 +50,7 @@
=20
static struct mntopt mopts[] =3D {
MOPT_STDOPTS,
- MOPT_NULL
+ MOPT_LIST_END
};
=20
static gid_t a_gid(char *);
Index: mount_msdosfs/mount_msdosfs.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/src/sbin/mount_msdosfs/mount_msdosfs.c,v
retrieving revision 1.35
diff -u -r1.35 mount_msdosfs.c
--- mount_msdosfs/mount_msdosfs.c 1 Jun 2005 09:39:34 -0000 1.35
+++ mount_msdosfs/mount_msdosfs.c 1 Jun 2005 13:34:51 -0000
@@ -73,7 +73,7 @@
{ "shortnames", 0, MSDOSFSMNT_SHORTNAME, 1 },
{ "longnames", 0, MSDOSFSMNT_LONGNAME, 1 },
{ "nowin95", 0, MSDOSFSMNT_NOWIN95, 1 },
- MOPT_NULL
+ MOPT_LIST_END
};
=20
static gid_t a_gid(char *);
Index: mount_nfs/mount_nfs.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/src/sbin/mount_nfs/mount_nfs.c,v
retrieving revision 1.64
diff -u -r1.64 mount_nfs.c
--- mount_nfs/mount_nfs.c 1 Jun 2005 09:39:35 -0000 1.64
+++ mount_nfs/mount_nfs.c 1 Jun 2005 13:34:51 -0000
@@ -121,7 +121,7 @@
{ "lockd", 1, ALTF_NOLOCKD, 1 },
{ "inet4", 1, ALTF_NOINET4, 1 },
{ "inet6", 1, ALTF_NOINET6, 1 },
- MOPT_NULL
+ MOPT_LIST_END
};
=20
struct nfs_args nfsdefargs =3D {
Index: mount_nfs4/mount_nfs4.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/src/sbin/mount_nfs4/mount_nfs4.c,v
retrieving revision 1.6
diff -u -r1.6 mount_nfs4.c
--- mount_nfs4/mount_nfs4.c 1 Jun 2005 09:39:35 -0000 1.6
+++ mount_nfs4/mount_nfs4.c 1 Jun 2005 13:34:51 -0000
@@ -151,7 +151,7 @@
{ "lockd", 1, ALTF_NOLOCKD, 1 },
{ "inet4", 1, ALTF_NOINET4, 1 },
{ "inet6", 1, ALTF_NOINET6, 1 },
- MOPT_NULL
+ MOPT_LIST_END
};
=20
struct nfs_args nfsdefargs =3D {
Index: mount_ntfs/mount_ntfs.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/src/sbin/mount_ntfs/mount_ntfs.c,v
retrieving revision 1.13
diff -u -r1.13 mount_ntfs.c
--- mount_ntfs/mount_ntfs.c 1 Jun 2005 09:39:35 -0000 1.13
+++ mount_ntfs/mount_ntfs.c 1 Jun 2005 13:34:51 -0000
@@ -58,7 +58,7 @@
=20
static struct mntopt mopts[] =3D {
MOPT_STDOPTS,
- MOPT_NULL
+ MOPT_LIST_END
};
=20
static gid_t a_gid(char *);
Index: mount_nullfs/mount_nullfs.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/src/sbin/mount_nullfs/mount_nullfs.c,v
retrieving revision 1.24
diff -u -r1.24 mount_nullfs.c
--- mount_nullfs/mount_nullfs.c 1 Jun 2005 09:39:35 -0000 1.24
+++ mount_nullfs/mount_nullfs.c 1 Jun 2005 13:34:51 -0000
@@ -59,7 +59,7 @@
=20
struct mntopt mopts[] =3D {
MOPT_STDOPTS,
- MOPT_NULL
+ MOPT_LIST_END
};
=20
int subdir(const char *, const char *);
Index: mount_reiserfs/mount_reiserfs.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/src/sbin/mount_reiserfs/mount_reiserfs.c,v
retrieving revision 1.2
diff -u -r1.2 mount_reiserfs.c
--- mount_reiserfs/mount_reiserfs.c 1 Jun 2005 09:39:35 -0000 1.2
+++ mount_reiserfs/mount_reiserfs.c 1 Jun 2005 13:34:51 -0000
@@ -41,7 +41,7 @@
=20
struct mntopt mopts[] =3D {
MOPT_STDOPTS,
- MOPT_NULL
+ MOPT_LIST_END
};
=20
void usage(void);
Index: mount_std/mount_std.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/src/sbin/mount_std/mount_std.c,v
retrieving revision 1.20
diff -u -r1.20 mount_std.c
--- mount_std/mount_std.c 1 Jun 2005 09:39:36 -0000 1.20
+++ mount_std/mount_std.c 1 Jun 2005 13:34:51 -0000
@@ -59,7 +59,7 @@
=20
static struct mntopt mopts[] =3D {
MOPT_STDOPTS,
- MOPT_NULL
+ MOPT_LIST_END
};
=20
static char *fsname;
Index: mount_udf/mount_udf.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/src/sbin/mount_udf/mount_udf.c,v
retrieving revision 1.12
diff -u -r1.12 mount_udf.c
--- mount_udf/mount_udf.c 1 Jun 2005 09:39:36 -0000 1.12
+++ mount_udf/mount_udf.c 1 Jun 2005 13:34:51 -0000
@@ -64,7 +64,7 @@
struct mntopt mopts[] =3D {
MOPT_STDOPTS,
MOPT_UPDATE,
- MOPT_NULL
+ MOPT_LIST_END
};
=20
int set_charset(char **, char **, const char *);
Index: mount_ufs/mount_ufs.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/src/sbin/mount_ufs/mount_ufs.c,v
retrieving revision 1.3
diff -u -r1.3 mount_ufs.c
--- mount_ufs/mount_ufs.c 1 Jun 2005 09:39:36 -0000 1.3
+++ mount_ufs/mount_ufs.c 1 Jun 2005 13:34:51 -0000
@@ -61,7 +61,7 @@
MOPT_SYNC,
MOPT_UPDATE,
MOPT_SNAPSHOT,
- MOPT_NULL
+ MOPT_LIST_END
};
=20
void usage(void);
Index: mount_umapfs/mount_umapfs.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/src/sbin/mount_umapfs/mount_umapfs.c,v
retrieving revision 1.24
diff -u -r1.24 mount_umapfs.c
--- mount_umapfs/mount_umapfs.c 1 Jun 2005 09:39:36 -0000 1.24
+++ mount_umapfs/mount_umapfs.c 1 Jun 2005 13:34:51 -0000
@@ -79,7 +79,7 @@
=20
static struct mntopt mopts[] =3D {
MOPT_STDOPTS,
- MOPT_NULL
+ MOPT_LIST_END
};
=20
static void usage(void) __dead2;
Index: mount_unionfs/mount_unionfs.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/src/sbin/mount_unionfs/mount_unionfs.c,v
retrieving revision 1.23
diff -u -r1.23 mount_unionfs.c
--- mount_unionfs/mount_unionfs.c 1 Jun 2005 09:39:36 -0000 1.23
+++ mount_unionfs/mount_unionfs.c 1 Jun 2005 13:34:51 -0000
@@ -60,7 +60,7 @@
=20
static struct mntopt mopts[] =3D {
MOPT_STDOPTS,
- MOPT_NULL
+ MOPT_LIST_END
};
=20
static int subdir(const char *, const char *);
--xHFwDpU9dbj6ez1V--
--GID0FwUMdk1T2AWN
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (FreeBSD)
iD4DBQFCnbuX/cVsHxFZiIoRAu/oAJdFffiFCbzp+3sXNGto2/X2wQQwAJ4/VbFm
gExDd+t75Y+42k6sKjqdLQ==
=TynJ
-----END PGP SIGNATURE-----
--GID0FwUMdk1T2AWN--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050601134351.GA76097>
