diff options
author | rodrigc <rodrigc@FreeBSD.org> | 2005-11-20 17:04:50 +0000 |
---|---|---|
committer | rodrigc <rodrigc@FreeBSD.org> | 2005-11-20 17:04:50 +0000 |
commit | b71f548d2c4531c4761908d6242cdded83e280d9 (patch) | |
tree | 9c600cdea0d02ba3054eab6e9411c49a96f77759 /sys/ufs/ffs | |
parent | fcbebc5c9cef69c18f4ffc5f05ccd932d010ac05 (diff) | |
download | FreeBSD-src-b71f548d2c4531c4761908d6242cdded83e280d9.zip FreeBSD-src-b71f548d2c4531c4761908d6242cdded83e280d9.tar.gz |
If export mount flag is not passed in, set default parameters
for export structure and pass that to vfs_export().
Currently in userland mount(8), an export structure is unconditionally
passed in, only for UFS. This is an attempt to move that UFS-specific
behavior out of mount(8) and into the UFS filesystem code.
Diffstat (limited to 'sys/ufs/ffs')
-rw-r--r-- | sys/ufs/ffs/ffs_vfsops.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 28e6c97..10c5bcd 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -181,6 +181,13 @@ ffs_mount(struct mount *mp, struct thread *td) if (vfs_getopt(mp->mnt_optnew, "update", NULL, NULL) == 0) mp->mnt_flag |= MNT_UPDATE; + export.ex_root = -2; /* DEFAULT_ROOTID */ + + if (mp->mnt_flag & MNT_RDONLY) + export.ex_flags = MNT_EXRDONLY; + else + export.ex_flags = 0; + /* * If updating, check whether changing from read-only to * read/write; if there is no device name, that's all we do. @@ -325,7 +332,12 @@ ffs_mount(struct mount *mp, struct thread *td) /* * If not updating name, process export requests. */ - error = vfs_copyopt(mp->mnt_optnew, "export", &export, sizeof export); + error = 0; + if (vfs_getopt(mp->mnt_optnew, "export", NULL, NULL) == 0) { + error = vfs_copyopt(mp->mnt_optnew, "export", + &export, sizeof export); + } + if (error == 0 && export.ex_flags != 0) return (vfs_export(mp, &export)); /* |