diff options
author | rodrigc <rodrigc@FreeBSD.org> | 2005-11-18 06:06:10 +0000 |
---|---|---|
committer | rodrigc <rodrigc@FreeBSD.org> | 2005-11-18 06:06:10 +0000 |
commit | 16f511ab65fd28c303b9ce9870c18942f1a6dece (patch) | |
tree | 18089fbeafc923e6f9ea6e1df69edef949579fdd | |
parent | 63ac8a6c5f4fc8da1471573289519319fe410078 (diff) | |
download | FreeBSD-src-16f511ab65fd28c303b9ce9870c18942f1a6dece.zip FreeBSD-src-16f511ab65fd28c303b9ce9870c18942f1a6dece.tar.gz |
- 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().
-rw-r--r-- | sys/ufs/ffs/ffs_vfsops.c | 34 |
1 files changed, 33 insertions, 1 deletions
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. |