summaryrefslogtreecommitdiffstats
path: root/sys/fs/msdosfs/msdosfs_vfsops.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/fs/msdosfs/msdosfs_vfsops.c')
-rw-r--r--sys/fs/msdosfs/msdosfs_vfsops.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/sys/fs/msdosfs/msdosfs_vfsops.c b/sys/fs/msdosfs/msdosfs_vfsops.c
index 95be396..a5a9680 100644
--- a/sys/fs/msdosfs/msdosfs_vfsops.c
+++ b/sys/fs/msdosfs/msdosfs_vfsops.c
@@ -239,11 +239,11 @@ static int
msdosfs_mount(struct mount *mp, struct thread *td)
{
struct vnode *devvp; /* vnode for blk device to mount */
- struct export_args *export;
+ struct export_args export;
/* msdosfs specific mount control block */
struct msdosfsmount *pmp = NULL;
struct nameidata ndp;
- int error, flags, len;
+ int error, flags;
mode_t accessmode;
char *from;
@@ -256,7 +256,18 @@ msdosfs_mount(struct mount *mp, struct thread *td)
*/
if (mp->mnt_flag & MNT_UPDATE) {
pmp = VFSTOMSDOSFS(mp);
- error = 0;
+
+ error = vfs_copyopt(mp->mnt_optnew, "export",
+ &export, sizeof export);
+ if (error == 0 && export.ex_flags != 0) {
+ /*
+ * Process export requests.
+ */
+ if ((export.ex_flags & MNT_EXPORTED) != 0 &&
+ (pmp->pm_flags & MSDOSFS_LARGEFS) != 0)
+ return (EOPNOTSUPP);
+ return (vfs_export(mp, &export));
+ }
if (!(pmp->pm_flags & MSDOSFSMNT_RONLY) &&
vfs_flagopt(mp->mnt_optnew, "ro", NULL, 0)) {
error = VFS_SYNC(mp, MNT_WAIT, td->td_ucred, td);
@@ -316,17 +327,6 @@ msdosfs_mount(struct mount *mp, struct thread *td)
pmp->pm_flags |= MSDOSFSMNT_SHORTNAME;
}
#endif
- error = vfs_getopt(mp->mnt_optnew, "export",
- (void **)&export, &len);
- if (error || len != sizeof *export)
- return (EINVAL);
- /*
- * Process export requests.
- */
- if ((export->ex_flags & MNT_EXPORTED) != 0 &&
- (pmp->pm_flags & MSDOSFS_LARGEFS) != 0)
- return (EOPNOTSUPP);
- return (vfs_export(mp, export));
}
}
/*
OpenPOWER on IntegriCloud