summaryrefslogtreecommitdiffstats
path: root/sys/fs/unionfs/union_vfsops.c
diff options
context:
space:
mode:
authormux <mux@FreeBSD.org>2002-06-15 22:48:14 +0000
committermux <mux@FreeBSD.org>2002-06-15 22:48:14 +0000
commit62289e8461aa01c16367d44b6e2f109737065bfa (patch)
treee21904b9ce86a9f8628501a0f904d7b3a64d99c9 /sys/fs/unionfs/union_vfsops.c
parenta9b7ee8dc7c3c2068241f4fbe5ee281eec5529ac (diff)
downloadFreeBSD-src-62289e8461aa01c16367d44b6e2f109737065bfa.zip
FreeBSD-src-62289e8461aa01c16367d44b6e2f109737065bfa.tar.gz
nmount'ify unionfs further by using separate options instead
of passing a flags mount options. This removes the include of sys/fs/unionfs/union.h in mount_unionfs as it should be. Reviewed by: phk
Diffstat (limited to 'sys/fs/unionfs/union_vfsops.c')
-rw-r--r--sys/fs/unionfs/union_vfsops.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/sys/fs/unionfs/union_vfsops.c b/sys/fs/unionfs/union_vfsops.c
index eb214e9..c4d362c 100644
--- a/sys/fs/unionfs/union_vfsops.c
+++ b/sys/fs/unionfs/union_vfsops.c
@@ -82,7 +82,7 @@ union_mount(mp, ndp, td)
struct union_mount *um = 0;
struct ucred *cred = 0;
char *cp = 0, *target;
- int *flags;
+ int op;
int len;
u_int size;
@@ -112,9 +112,20 @@ union_mount(mp, ndp, td)
if (error || target[len - 1] != '\0')
return (EINVAL);
- error = vfs_getopt(opts, "unionflags", (void **)&flags, &len);
- if (error || len != sizeof(int))
- return (EINVAL);
+ op = 0;
+ if (vfs_getopt(opts, "below", NULL, NULL) == 0)
+ op = UNMNT_BELOW;
+ if (vfs_getopt(opts, "replace", NULL, NULL) == 0) {
+ /* These options are mutually exclusive. */
+ if (op)
+ return (EINVAL);
+ op = UNMNT_REPLACE;
+ }
+ /*
+ * UNMNT_ABOVE is the default.
+ */
+ if (op == 0)
+ op = UNMNT_ABOVE;
/*
* Obtain lower vnode. Vnode is stored in mp->mnt_vnodecovered.
@@ -184,7 +195,7 @@ union_mount(mp, ndp, td)
um = (struct union_mount *) malloc(sizeof(struct union_mount),
M_UNIONFSMNT, M_WAITOK | M_ZERO);
- um->um_op = *flags & UNMNT_OPMASK;
+ um->um_op = op;
switch (um->um_op) {
case UNMNT_ABOVE:
OpenPOWER on IntegriCloud