replace -above, -below, -replace with -b, -r, (-above was the
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Mon, 28 Mar 1994 03:32:38 +0000 (19:32 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Mon, 28 Mar 1994 03:32:38 +0000 (19:32 -0800)
default)

SCCS-vsn: sbin/mount_union/mount_union.8 8.6
SCCS-vsn: sbin/mount_union/mount_union.c 8.5

usr/src/sbin/mount_union/mount_union.8
usr/src/sbin/mount_union/mount_union.c

index 9dc56ff..4dd5018 100644 (file)
@@ -6,7 +6,7 @@
 .\"
 .\" %sccs.include.redist.roff%
 .\"
 .\"
 .\" %sccs.include.redist.roff%
 .\"
-.\"    @(#)mount_union.8       8.5 (Berkeley) %G%
+.\"    @(#)mount_union.8       8.6 (Berkeley) %G%
 .\"
 .Dd 
 .Dt MOUNT_UNION 8
 .\"
 .Dd 
 .Dt MOUNT_UNION 8
 .Nd mount union filesystems
 .Sh SYNOPSIS
 .Nm mount_union
 .Nd mount union filesystems
 .Sh SYNOPSIS
 .Nm mount_union
+.Op Fl br
 .Op Fl o Ar options
 .Op Fl o Ar options
-.Op Fl above
-.Op Fl below
-.Op Fl replace
 .Ar directory
 .Ar uniondir
 .Sh DESCRIPTION
 .Ar directory
 .Ar uniondir
 .Sh DESCRIPTION
@@ -43,6 +41,15 @@ layer.
 .Pp
 The options are as follows:
 .Bl -tag -width indent
 .Pp
 The options are as follows:
 .Bl -tag -width indent
+.It Fl b
+Invert the default position, so that
+.Ar directory
+becomes the lower layer and
+.Ar uniondir
+becomes the upper layer.
+However,
+.Ar uniondir
+remains the mount point.
 .It Fl o
 Options are specified with a
 .Fl o
 .It Fl o
 Options are specified with a
 .Fl o
@@ -50,6 +57,11 @@ flag followed by a comma separated string of options.
 See the
 .Xr mount 8
 man page for possible options and their meanings.
 See the
 .Xr mount 8
 man page for possible options and their meanings.
+.It Fl r
+Hide the lower layer completely in the same way as mounting with
+.Xr mount_lofs 8
+or
+.Xr mount_null 8 .
 .El
 .Pp
 To enforce filesystem security, the user mounting the filesystem
 .El
 .Pp
 To enforce filesystem security, the user mounting the filesystem
@@ -106,37 +118,11 @@ option to
 .Xr mount 8
 which only applies the union operation to the mount point itself,
 and then only for lookups.
 .Xr mount 8
 which only applies the union operation to the mount point itself,
 and then only for lookups.
-.Sh OPTIONS
-The options are:
-.Bl -tag -width indent
-.It Fl above
-This is the default mode of operation, where
-.Ar directory
-becomes the upper layer,
-and
-.Ar uniondir
-becomes the lower layer.
-.It Fl below
-This inverts the sense of
-.Fl above
-such that
-.Ar directory
-becomes the lower layer and
-.Ar uniondir
-becomes the upper layer.
-.Ar uniondir
-remains the mount point.
-.It Fl replace
-This simply hides the lower layer completely in
-the same way as mounting with
-.Xr mount_lofs 8
-or
-.Xr mount_null 8 .
 .Sh EXAMPLES
 The commands
 .Bd -literal -offset indent
 mount -t cd9660 -o ro /dev/cd0a /usr/src
 .Sh EXAMPLES
 The commands
 .Bd -literal -offset indent
 mount -t cd9660 -o ro /dev/cd0a /usr/src
-mount -t union -o -above /var/obj /usr/src
+mount -t union -o /var/obj /usr/src
 .Ed
 .Pp
 mount the CD-ROM drive
 .Ed
 .Pp
 mount the CD-ROM drive
@@ -152,7 +138,7 @@ even though it is stored on a CD-ROM.
 .Pp
 The command
 .Bd -literal -offset indent
 .Pp
 The command
 .Bd -literal -offset indent
-mount -t union -o -below /sys $HOME/sys
+mount -t union -o -b /sys $HOME/sys
 .Ed
 .Pp
 attaches the system source tree below the
 .Ed
 .Pp
 attaches the system source tree below the
@@ -178,7 +164,7 @@ there is no way that delete and rename operations on lower layer
 objects can be done.
 .Dv EROFS
 is returned for this kind of operations along with any others
 objects can be done.
 .Dv EROFS
 is returned for this kind of operations along with any others
-which would make modifictions to the lower layer, such as
+which would make modifications to the lower layer, such as
 .Xr chmod 1 .
 .Pp
 Running
 .Xr chmod 1 .
 .Pp
 Running
index bf18697..e713a5f 100644 (file)
@@ -15,7 +15,7 @@ char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)mount_union.c      8.4 (Berkeley) %G%";
+static char sccsid[] = "@(#)mount_union.c      8.5 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -50,18 +50,9 @@ main(argc, argv)
 
        mntflags = 0;
        args.mntflags = UNMNT_ABOVE;
 
        mntflags = 0;
        args.mntflags = UNMNT_ABOVE;
-
-       while ((ch = getopt(argc, argv, "a:b:o:r:")) != EOF) {
+       while ((ch = getopt(argc, argv, "bo:r")) != EOF)
                switch (ch) {
                switch (ch) {
-               case 'a':
-                       if (strcmp(optarg, "bove") != 0)
-                               usage();
-                       args.mntflags &= ~UNMNT_OPMASK;
-                       args.mntflags |= UNMNT_ABOVE;
-                       break;
                case 'b':
                case 'b':
-                       if (strcmp(optarg, "elow") != 0)
-                               usage();
                        args.mntflags &= ~UNMNT_OPMASK;
                        args.mntflags |= UNMNT_BELOW;
                        break;
                        args.mntflags &= ~UNMNT_OPMASK;
                        args.mntflags |= UNMNT_BELOW;
                        break;
@@ -69,16 +60,14 @@ main(argc, argv)
                        getmntopts(optarg, mopts, &mntflags);
                        break;
                case 'r':
                        getmntopts(optarg, mopts, &mntflags);
                        break;
                case 'r':
-                       if (strcmp(optarg, "eplace") != 0)
-                               usage();
                        args.mntflags &= ~UNMNT_OPMASK;
                        args.mntflags |= UNMNT_REPLACE;
                        break;
                case '?':
                default:
                        usage();
                        args.mntflags &= ~UNMNT_OPMASK;
                        args.mntflags |= UNMNT_REPLACE;
                        break;
                case '?':
                default:
                        usage();
+                       /* NOTREACHED */
                }
                }
-       }
        argc -= optind;
        argv += optind;
 
        argc -= optind;
        argv += optind;
 
@@ -120,6 +109,6 @@ void
 usage()
 {
        (void)fprintf(stderr,
 usage()
 {
        (void)fprintf(stderr,
-               "usage: mount_union [-o options] target_fs mount_point\n");
+               "usage: mount_union [-br] [-o options] target_fs mount_point\n");
        exit(1);
 }
        exit(1);
 }