summaryrefslogtreecommitdiff
path: root/sys/msdosfs/msdosfs_vfsops.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/msdosfs/msdosfs_vfsops.c')
-rw-r--r--sys/msdosfs/msdosfs_vfsops.c63
1 files changed, 22 insertions, 41 deletions
diff --git a/sys/msdosfs/msdosfs_vfsops.c b/sys/msdosfs/msdosfs_vfsops.c
index f10de74c684..df59486df4d 100644
--- a/sys/msdosfs/msdosfs_vfsops.c
+++ b/sys/msdosfs/msdosfs_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: msdosfs_vfsops.c,v 1.9 1997/10/06 20:20:59 deraadt Exp $ */
+/* $OpenBSD: msdosfs_vfsops.c,v 1.10 1997/11/06 05:58:57 csapuntz Exp $ */
/* $NetBSD: msdosfs_vfsops.c,v 1.44 1996/12/22 10:10:32 cgd Exp $ */
/*-
@@ -75,10 +75,8 @@ int msdosfs_mount __P((struct mount *, char *, caddr_t, struct nameidata *,
int msdosfs_start __P((struct mount *, int, struct proc *));
int msdosfs_unmount __P((struct mount *, int, struct proc *));
int msdosfs_root __P((struct mount *, struct vnode **));
-int msdosfs_quotactl __P((struct mount *, int, uid_t, caddr_t, struct proc *));
int msdosfs_statfs __P((struct mount *, struct statfs *, struct proc *));
int msdosfs_sync __P((struct mount *, int, struct ucred *, struct proc *));
-int msdosfs_vget __P((struct mount *, ino_t, struct vnode **));
int msdosfs_fhtovp __P((struct mount *, struct fid *, struct mbuf *,
struct vnode **, int *, struct ucred **));
int msdosfs_vptofh __P((struct vnode *, struct fid *));
@@ -121,10 +119,10 @@ msdosfs_mount(mp, path, data, ndp, p)
flags = WRITECLOSE;
if (mp->mnt_flag & MNT_FORCE)
flags |= FORCECLOSE;
- if (vfs_busy(mp))
+ if (vfs_busy(mp, 0, 0, p))
return (EBUSY);
error = vflush(mp, NULLVP, flags);
- vfs_unbusy(mp);
+ vfs_unbusy(mp, p);
}
if (!error && (mp->mnt_flag & MNT_RELOAD))
/* not yet implemented */
@@ -138,14 +136,14 @@ msdosfs_mount(mp, path, data, ndp, p)
*/
if (p->p_ucred->cr_uid != 0) {
devvp = pmp->pm_devvp;
- VOP_LOCK(devvp);
+ vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, p);
error = VOP_ACCESS(devvp, VREAD | VWRITE,
p->p_ucred, p);
if (error) {
- VOP_UNLOCK(devvp);
+ VOP_UNLOCK(devvp, 0, p);
return (error);
}
- VOP_UNLOCK(devvp);
+ VOP_UNLOCK(devvp, 0, p);
}
pmp->pm_flags &= ~MSDOSFSMNT_RONLY;
}
@@ -189,13 +187,13 @@ msdosfs_mount(mp, path, data, ndp, p)
accessmode = VREAD;
if ((mp->mnt_flag & MNT_RDONLY) == 0)
accessmode |= VWRITE;
- VOP_LOCK(devvp);
+ vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, p);
error = VOP_ACCESS(devvp, accessmode, p->p_ucred, p);
if (error) {
vput(devvp);
return (error);
}
- VOP_UNLOCK(devvp);
+ VOP_UNLOCK(devvp, 0, p);
}
if ((mp->mnt_flag & MNT_UPDATE) == 0)
error = msdosfs_mountfs(devvp, mp, p, &args);
@@ -514,7 +512,7 @@ msdosfs_mountfs(devvp, mp, p, argp)
* in the directory entry where we could put uid's and gid's.
*/
#endif
- devvp->v_specflags |= SI_MOUNTEDON;
+ devvp->v_specmountpoint = mp;
return (0);
@@ -561,7 +559,7 @@ msdosfs_unmount(mp, mntflags, p)
if ((error = vflush(mp, NULLVP, flags)) != 0)
return (error);
pmp = VFSTOMSDOSFS(mp);
- pmp->pm_devvp->v_specflags &= ~SI_MOUNTEDON;
+ pmp->pm_devvp->v_specmountpoint = NULL;
#ifdef MSDOSFS_DEBUG
printf("msdosfs_umount(): just before calling VOP_CLOSE()\n");
printf("flag %08x, usecount %d, writecount %d, holdcnt %d\n",
@@ -605,22 +603,6 @@ msdosfs_root(mp, vpp)
}
int
-msdosfs_quotactl(mp, cmds, uid, arg, p)
- struct mount *mp;
- int cmds;
- uid_t uid;
- caddr_t arg;
- struct proc *p;
-{
-
-#ifdef QUOTA
- return (EOPNOTSUPP);
-#else
- return (EOPNOTSUPP);
-#endif
-}
-
-int
msdosfs_statfs(mp, sbp, p)
struct mount *mp;
struct statfs *sbp;
@@ -645,7 +627,7 @@ msdosfs_statfs(mp, sbp, p)
bcopy(mp->mnt_stat.f_mntonname, sbp->f_mntonname, MNAMELEN);
bcopy(mp->mnt_stat.f_mntfromname, sbp->f_mntfromname, MNAMELEN);
}
- strncpy(sbp->f_fstypename, mp->mnt_op->vfs_name, MFSNAMELEN);
+ strncpy(sbp->f_fstypename, mp->mnt_vfc->vfc_name, MFSNAMELEN);
return (0);
}
@@ -689,9 +671,9 @@ loop:
dep = VTODE(vp);
if (((dep->de_flag
& (DE_ACCESS | DE_CREATE | DE_UPDATE | DE_MODIFIED)) == 0)
- && (vp->v_dirtyblkhd.lh_first == NULL))
+ && (vp->v_dirtyblkhd.lh_first == NULL || waitfor == MNT_LAZY))
continue;
- if (vget(vp, 1))
+ if (vget(vp, LK_EXCLUSIVE, p))
goto loop;
if ((error = VOP_FSYNC(vp, cred, waitfor, p)) != 0)
allerror = error;
@@ -753,18 +735,16 @@ msdosfs_vptofh(vp, fhp)
return (0);
}
-int
-msdosfs_vget(mp, ino, vpp)
- struct mount *mp;
- ino_t ino;
- struct vnode **vpp;
-{
+#define msdosfs_vget ((int (*) __P((struct mount *, ino_t, struct vnode **))) \
+ eopnotsupp)
- return (EOPNOTSUPP);
-}
+#define msdosfs_quotactl ((int (*) __P((struct mount *, int, uid_t, caddr_t, \
+ struct proc *)))eopnotsupp)
+
+#define msdosfs_sysctl ((int (*) __P((int *, u_int, void *, size_t *, void *, \
+ size_t, struct proc *)))eopnotsupp)
struct vfsops msdosfs_vfsops = {
- MOUNT_MSDOS,
msdosfs_mount,
msdosfs_start,
msdosfs_unmount,
@@ -775,5 +755,6 @@ struct vfsops msdosfs_vfsops = {
msdosfs_vget,
msdosfs_fhtovp,
msdosfs_vptofh,
- msdosfs_init
+ msdosfs_init,
+ msdosfs_sysctl
};