From 16f511ab65fd28c303b9ce9870c18942f1a6dece Mon Sep 17 00:00:00 2001 From: rodrigc Date: Fri, 18 Nov 2005 06:06:10 +0000 Subject: - Add parsing for the following existing UFS/FFS mount options in the nmount() callpath via vfs_getopt(), and set the appropriate MNT_* flag: -> acls, async, force, multilabel, noasync, noatime, -> noclusterr, noclusterw, snapshot, update - Allow errmsg as a valid mount option via vfs_getopt(), so we can later add a hook to propagate mount errors back to userspace via vfs_mount_error(). --- sys/ufs/ffs/ffs_vfsops.c | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index da4a362..e84b252 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -116,7 +116,9 @@ static struct buf_ops ffs_ops = { .bop_sync = bufsync, }; -static const char *ffs_opts[] = { "from", "export", NULL }; +static const char *ffs_opts[] = { "acls", "async", "errmsg", "export", + "force", "from", "multilabel", "noasync", "noatime", + "noclusterr", "noclusterw", "snapshot", "update", NULL }; static int ffs_mount(struct mount *mp, struct thread *td) @@ -148,6 +150,36 @@ ffs_mount(struct mount *mp, struct thread *td) if (error) return (error); + if (vfs_getopt(mp->mnt_optnew, "acls", NULL, NULL) == 0) + mp->mnt_flag |= MNT_ACLS; + + if (vfs_getopt(mp->mnt_optnew, "async", NULL, NULL) == 0) + mp->mnt_flag |= MNT_ASYNC; + + if (vfs_getopt(mp->mnt_optnew, "force", NULL, NULL) == 0) + mp->mnt_flag |= MNT_FORCE; + + if (vfs_getopt(mp->mnt_optnew, "multilabel", NULL, NULL) == 0) + mp->mnt_flag |= MNT_MULTILABEL; + + if (vfs_getopt(mp->mnt_optnew, "noasync", NULL, NULL) == 0) + mp->mnt_flag &= ~MNT_ASYNC; + + if (vfs_getopt(mp->mnt_optnew, "noatime", NULL, NULL) == 0) + mp->mnt_flag |= MNT_NOATIME; + + if (vfs_getopt(mp->mnt_optnew, "noclusterr", NULL, NULL) == 0) + mp->mnt_flag |= MNT_NOCLUSTERR; + + if (vfs_getopt(mp->mnt_optnew, "noclusterw", NULL, NULL) == 0) + mp->mnt_flag |= MNT_NOCLUSTERW; + + if (vfs_getopt(mp->mnt_optnew, "snapshot", NULL, NULL) == 0) + mp->mnt_flag |= MNT_SNAPSHOT; + + if (vfs_getopt(mp->mnt_optnew, "update", NULL, NULL) == 0) + mp->mnt_flag |= MNT_UPDATE; + /* * If updating, check whether changing from read-only to * read/write; if there is no device name, that's all we do. -- cgit v1.1