diff options
author | jeff <jeff@FreeBSD.org> | 2005-03-13 12:09:34 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2005-03-13 12:09:34 +0000 |
commit | 1c1edae55c3cc94bc3225e577f7d477761028b16 (patch) | |
tree | 8ac96f3941fbc2c7c70c52e324f9e0bc3a9e3baf /sys/fs/coda/coda_vnops.c | |
parent | 71f62892ab8a5a8d8e2a5953387ef55a7fd21df7 (diff) | |
download | FreeBSD-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/coda_vnops.c')
-rw-r--r-- | sys/fs/coda/coda_vnops.c | 23 |
1 files changed, 8 insertions, 15 deletions
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); |