summaryrefslogtreecommitdiff
path: root/sys/adosfs
diff options
context:
space:
mode:
Diffstat (limited to 'sys/adosfs')
-rw-r--r--sys/adosfs/adlookup.c27
-rw-r--r--sys/adosfs/advfsops.c15
-rw-r--r--sys/adosfs/advnops.c7
3 files changed, 28 insertions, 21 deletions
diff --git a/sys/adosfs/adlookup.c b/sys/adosfs/adlookup.c
index b7bc5a26fd9..2e6fa94d8de 100644
--- a/sys/adosfs/adlookup.c
+++ b/sys/adosfs/adlookup.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: adlookup.c,v 1.7 1997/01/20 15:49:51 niklas Exp $ */
+/* $OpenBSD: adlookup.c,v 1.8 1997/11/06 05:58:00 csapuntz Exp $ */
/* $NetBSD: adlookup.c,v 1.17 1996/10/25 23:13:58 cgd Exp $ */
/*
@@ -75,6 +75,7 @@ adosfs_lookup(v)
struct vnode *vdp; /* vnode of search dir */
struct anode *adp; /* anode of search dir */
struct ucred *ucp; /* lookup credentials */
+ struct proc *p;
u_int32_t plen, hval, vpid;
daddr_t bn;
char *pelt;
@@ -95,6 +96,7 @@ adosfs_lookup(v)
wantp = flags & (LOCKPARENT | WANTPARENT);
pelt = cnp->cn_nameptr;
plen = cnp->cn_namelen;
+ p = cnp->cn_proc;
nocache = 0;
/*
@@ -118,25 +120,25 @@ adosfs_lookup(v)
VREF(vdp);
error = 0;
} else if (flags & ISDOTDOT) {
- VOP_UNLOCK(vdp); /* race */
- error = vget(*vpp, 1);
+ VOP_UNLOCK(vdp, 0, p); /* race */
+ error = vget(*vpp, LK_EXCLUSIVE, p);
if (error == 0 && lockp && last)
- error = VOP_LOCK(vdp);
+ error = vn_lock(vdp, LK_EXCLUSIVE | LK_RETRY, p);
} else {
error = vget(*vpp, 1);
/* if (lockp == 0 || error || last) */
if (lockp == 0 || error || last == 0)
- VOP_UNLOCK(vdp);
+ VOP_UNLOCK(vdp, 0, p);
}
if (error == 0) {
if (vpid == vdp->v_id)
return (0);
vput(*vpp);
if (lockp && vdp != *vpp && last)
- VOP_UNLOCK(vdp);
+ VOP_UNLOCK(vdp, 0, p);
}
*vpp = NULL;
- if ((error = VOP_LOCK(vdp)) != 0)
+ if ((error = vn_lock(vdp, LK_EXCLUSIVE | LK_RETRY, p)) != 0)
return (error);
}
@@ -170,11 +172,12 @@ adosfs_lookup(v)
* and fail. Otherwise we have succeded.
*
*/
- VOP_UNLOCK(vdp); /* race */
+ VOP_UNLOCK(vdp, 0, p); /* race */
if ((error = VFS_VGET(vdp->v_mount, ABLKTOINO(adp->pblock),
vpp)) != 0)
- VOP_LOCK(vdp);
- else if (last && lockp && (error = VOP_LOCK(vdp)))
+ vn_lock(vdp, LK_RETRY | LK_EXCLUSIVE, p);
+ else if (last && lockp &&
+ (error = vn_lock(vdp, LK_EXCLUSIVE | LK_RETRY, p)))
vput(*vpp);
if (error) {
*vpp = NULL;
@@ -234,7 +237,7 @@ adosfs_lookup(v)
return (error);
}
if (lockp == 0)
- VOP_UNLOCK(vdp);
+ VOP_UNLOCK(vdp, 0, p);
cnp->cn_nameiop |= SAVENAME;
#ifdef ADOSFS_DIAGNOSTIC
printf("EJUSTRETURN)");
@@ -272,7 +275,7 @@ found:
if (vdp == *vpp)
VREF(vdp);
else if (lockp == 0 || last == 0)
- VOP_UNLOCK(vdp);
+ VOP_UNLOCK(vdp, 0, p);
found_lockdone:
if ((cnp->cn_flags & MAKEENTRY) && nocache == 0)
cache_enter(vdp, *vpp, cnp);
diff --git a/sys/adosfs/advfsops.c b/sys/adosfs/advfsops.c
index 7ad7f1b5606..b831d4f48a6 100644
--- a/sys/adosfs/advfsops.c
+++ b/sys/adosfs/advfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: advfsops.c,v 1.9 1997/01/20 15:49:53 niklas Exp $ */
+/* $OpenBSD: advfsops.c,v 1.10 1997/11/06 05:58:01 csapuntz Exp $ */
/* $NetBSD: advfsops.c,v 1.24 1996/12/22 10:10:12 cgd Exp $ */
/*
@@ -48,7 +48,7 @@
#include <miscfs/specfs/specdev.h> /* XXX */
#include <adosfs/adosfs.h>
-void adosfs_init __P((void));
+int adosfs_init __P((struct vfsconf *));
int adosfs_mount __P((struct mount *, char *, caddr_t, struct nameidata *,
struct proc *));
int adosfs_start __P((struct mount *, int, struct proc *));
@@ -125,13 +125,13 @@ adosfs_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);
}
/* MNT_UPDATE? */
if ((error = adosfs_mountfs(devvp, mp, p)) != 0) {
@@ -332,10 +332,11 @@ adosfs_statfs(mp, sbp, p)
sbp->f_files = 0; /* who knows */
sbp->f_ffree = 0; /* " " */
if (sbp != &mp->mnt_stat) {
+ sbp->f_type = mp->mnt_vfc->vfc_typenum;
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);
}
@@ -734,8 +735,8 @@ adosfs_sync(mp, waitfor, uc, p)
return(0);
}
-void
-adosfs_init()
+int
+adosfs_init(struct vfsconf *vfsp)
{
}
diff --git a/sys/adosfs/advnops.c b/sys/adosfs/advnops.c
index ca1b2b101af..8335d59a549 100644
--- a/sys/adosfs/advnops.c
+++ b/sys/adosfs/advnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: advnops.c,v 1.8 1997/01/20 15:49:54 niklas Exp $ */
+/* $OpenBSD: advnops.c,v 1.9 1997/11/06 05:58:01 csapuntz Exp $ */
/* $NetBSD: advnops.c,v 1.32 1996/10/13 02:52:09 christos Exp $ */
/*
@@ -964,8 +964,11 @@ adosfs_inactive(v)
#ifdef ADOSFS_DIAGNOSTIC
advopprint(sp);
#endif
+
+ VOP_UNLOCK(ap->a_vp, 0, ap->a_p);
+
if (sp->a_vp->v_usecount == 0 /* && check for file gone? */)
- vgone(sp->a_vp);
+ vrecycle(sp->a_vp, (struct simplelock *)0, ap->a_p);
#ifdef ADOSFS_DIAGNOSTIC
printf(" 0)");