parse nmount options enough to use a current mount binary; this
allows people to boot releng_6 kernels with a current user install (for now at least) Reviewed by: rodrigc
This commit is contained in:
parent
b48afbe184
commit
9b6df8d651
@ -128,7 +128,9 @@ struct vnode *rootvnode;
|
||||
static const char *global_opts[] = {
|
||||
"fstype",
|
||||
"fspath",
|
||||
"rdonly",
|
||||
"ro",
|
||||
"rw",
|
||||
"suid",
|
||||
"exec",
|
||||
NULL
|
||||
@ -489,6 +491,69 @@ vfs_donmount(struct thread *td, int fsflags, struct uio *fsoptions)
|
||||
goto bail;
|
||||
}
|
||||
|
||||
/*
|
||||
* We need to see if we have the "update" option
|
||||
* before we call vfs_domount(), since vfs_domount() has special
|
||||
* logic based on MNT_UPDATE. This is very important
|
||||
* when we want to update the root filesystem.
|
||||
*/
|
||||
if (vfs_getopt(optlist, "update", NULL, NULL) == 0)
|
||||
fsflags |= MNT_UPDATE;
|
||||
|
||||
if (vfs_getopt(optlist, "async", NULL, NULL) == 0)
|
||||
fsflags |= MNT_ASYNC;
|
||||
|
||||
if (vfs_getopt(optlist, "force", NULL, NULL) == 0)
|
||||
fsflags |= MNT_FORCE;
|
||||
|
||||
if (vfs_getopt(optlist, "multilabel", NULL, NULL) == 0)
|
||||
fsflags |= MNT_MULTILABEL;
|
||||
|
||||
if (vfs_getopt(optlist, "noasync", NULL, NULL) == 0)
|
||||
fsflags &= ~MNT_ASYNC;
|
||||
|
||||
if (vfs_getopt(optlist, "noatime", NULL, NULL) == 0)
|
||||
fsflags |= MNT_NOATIME;
|
||||
|
||||
if (vfs_getopt(optlist, "noclusterr", NULL, NULL) == 0)
|
||||
fsflags |= MNT_NOCLUSTERR;
|
||||
|
||||
if (vfs_getopt(optlist, "noclusterw", NULL, NULL) == 0)
|
||||
fsflags |= MNT_NOCLUSTERW;
|
||||
|
||||
if (vfs_getopt(optlist, "noexec", NULL, NULL) == 0)
|
||||
fsflags |= MNT_NOEXEC;
|
||||
|
||||
if (vfs_getopt(optlist, "nosuid", NULL, NULL) == 0)
|
||||
fsflags |= MNT_NOSUID;
|
||||
|
||||
if (vfs_getopt(optlist, "nosymfollow", NULL, NULL) == 0)
|
||||
fsflags |= MNT_NOSYMFOLLOW;
|
||||
|
||||
if (vfs_getopt(optlist, "noro", NULL, NULL) == 0)
|
||||
fsflags &= ~MNT_RDONLY;
|
||||
|
||||
if (vfs_getopt(optlist, "ro", NULL, NULL) == 0)
|
||||
fsflags |= MNT_RDONLY;
|
||||
|
||||
if (vfs_getopt(optlist, "rdonly", NULL, NULL) == 0)
|
||||
fsflags |= MNT_RDONLY;
|
||||
|
||||
if (vfs_getopt(optlist, "rw", NULL, NULL) == 0)
|
||||
fsflags &= ~MNT_RDONLY;
|
||||
|
||||
if (vfs_getopt(optlist, "snapshot", NULL, NULL) == 0)
|
||||
fsflags |= MNT_SNAPSHOT;
|
||||
|
||||
if (vfs_getopt(optlist, "suiddir", NULL, NULL) == 0)
|
||||
fsflags |= MNT_SUIDDIR;
|
||||
|
||||
if (vfs_getopt(optlist, "sync", NULL, NULL) == 0)
|
||||
fsflags |= MNT_SYNCHRONOUS;
|
||||
|
||||
if (vfs_getopt(optlist, "union", NULL, NULL) == 0)
|
||||
fsflags |= MNT_UNION;
|
||||
|
||||
/*
|
||||
* Be ultra-paranoid about making sure the type and fspath
|
||||
* variables will fit in our mp buffers, including the
|
||||
|
@ -116,7 +116,10 @@ static struct buf_ops ffs_ops = {
|
||||
.bop_sync = bufsync,
|
||||
};
|
||||
|
||||
static const char *ffs_opts[] = { "from", "export", NULL };
|
||||
static const char *ffs_opts[] = { "acls", "async", "atime", "clusterr",
|
||||
"clusterw", "exec", "export", "force", "from", "multilabel",
|
||||
"snapshot", "suid", "suiddir", "symfollow", "sync",
|
||||
"update", "union", NULL };
|
||||
|
||||
static int
|
||||
ffs_mount(struct mount *mp, struct thread *td)
|
||||
|
Loading…
x
Reference in New Issue
Block a user