summaryrefslogtreecommitdiffstats
path: root/sys/fs/coda
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2005-03-13 12:09:34 +0000
committerjeff <jeff@FreeBSD.org>2005-03-13 12:09:34 +0000
commit1c1edae55c3cc94bc3225e577f7d477761028b16 (patch)
tree8ac96f3941fbc2c7c70c52e324f9e0bc3a9e3baf /sys/fs/coda
parent71f62892ab8a5a8d8e2a5953387ef55a7fd21df7 (diff)
downloadFreeBSD-src-1c1edae55c3cc94bc3225e577f7d477761028b16.zip
FreeBSD-src-1c1edae55c3cc94bc3225e577f7d477761028b16.tar.gz
- The c_lock in the coda node does not offer any features over the standard
vnode lock. Remove the c_lock and use the vn lock in its place. - Keep the coda lock functions so that the debugging information is preserved, but call directly to the vop_std*lock routines for the real functionality. Sponsored by: Isilon Systems, Inc.
Diffstat (limited to 'sys/fs/coda')
-rw-r--r--sys/fs/coda/cnode.h1
-rw-r--r--sys/fs/coda/coda_vnops.c23
2 files changed, 8 insertions, 16 deletions
diff --git a/sys/fs/coda/cnode.h b/sys/fs/coda/cnode.h
index 3041478..8bbdeb5 100644
--- a/sys/fs/coda/cnode.h
+++ b/sys/fs/coda/cnode.h
@@ -102,7 +102,6 @@ struct cnode {
struct vnode *c_vnode;
u_short c_flags; /* flags (see below) */
CodaFid c_fid; /* file handle */
- struct lock c_lock; /* new lock protocol */
struct vnode *c_ovp; /* open vnode pointer */
u_short c_ocount; /* count of openers */
u_short c_owrite; /* count of open for write */
diff --git a/sys/fs/coda/coda_vnops.c b/sys/fs/coda/coda_vnops.c
index 025c081..389f78b 100644
--- a/sys/fs/coda/coda_vnops.c
+++ b/sys/fs/coda/coda_vnops.c
@@ -847,7 +847,6 @@ coda_inactive(struct vop_inactive_args *ap)
printf("coda_inactive: cp->ovp != NULL use %d: vp %p, cp %p\n",
vrefcnt(vp), vp, cp);
#endif
- lockmgr(&cp->c_lock, LK_RELEASE, &vp->v_interlock, td);
} else {
#ifdef OLD_DIAGNOSTIC
if (vrefcnt(CTOV(cp))) {
@@ -857,7 +856,6 @@ coda_inactive(struct vop_inactive_args *ap)
panic("coda_inactive: cp->ovp != NULL");
}
#endif
- VOP_UNLOCK(vp, 0, td);
vgone(vp);
}
@@ -1630,7 +1628,6 @@ coda_reclaim(struct vop_reclaim_args *ap)
#endif
}
cache_purge(vp);
- lockdestroy(&(VTOC(vp)->c_lock));
coda_free(VTOC(vp));
vp->v_data = NULL;
vnode_destroy_vobject(vp);
@@ -1643,23 +1640,22 @@ coda_lock(struct vop_lock_args *ap)
/* true args */
struct vnode *vp = ap->a_vp;
struct cnode *cp = VTOC(vp);
- struct thread *td = ap->a_td;
/* upcall decl */
/* locals */
ENTRY;
+ if ((ap->a_flags & LK_INTERLOCK) == 0) {
+ VI_LOCK(vp);
+ ap->a_flags |= LK_INTERLOCK;
+ }
+
if (coda_lockdebug) {
myprintf(("Attempting lock on %s\n",
coda_f2s(&cp->c_fid)));
}
-#ifndef DEBUG_LOCKS
- return (lockmgr(&cp->c_lock, ap->a_flags, &vp->v_interlock, td));
-#else
- return (debuglockmgr(&cp->c_lock, ap->a_flags, &vp->v_interlock, td,
- "coda_lock", vp->filename, vp->line));
-#endif
+ return (vop_stdlock(ap));
}
int
@@ -1668,7 +1664,6 @@ coda_unlock(struct vop_unlock_args *ap)
/* true args */
struct vnode *vp = ap->a_vp;
struct cnode *cp = VTOC(vp);
- struct thread *td = ap->a_td;
/* upcall decl */
/* locals */
@@ -1678,17 +1673,16 @@ coda_unlock(struct vop_unlock_args *ap)
coda_f2s(&cp->c_fid)));
}
- return (lockmgr(&cp->c_lock, ap->a_flags | LK_RELEASE, &vp->v_interlock, td));
+ return (vop_stdunlock(ap));
}
int
coda_islocked(struct vop_islocked_args *ap)
{
/* true args */
- struct cnode *cp = VTOC(ap->a_vp);
ENTRY;
- return (lockstatus(&cp->c_lock, ap->a_td));
+ return (vop_stdislocked(ap));
}
/* How one looks up a vnode given a device/inode pair: */
@@ -1808,7 +1802,6 @@ make_coda_node(fid, vfsp, type)
struct vnode *vp;
cp = coda_alloc();
- lockinit(&cp->c_lock, PINOD, "cnode", 0, 0);
cp->c_fid = *fid;
err = getnewvnode("coda", vfsp, &coda_vnodeops, &vp);
OpenPOWER on IntegriCloud