From bae478cc81a5cbd5e18016c3f06d8687ff2dc748 Mon Sep 17 00:00:00 2001 From: iedowse Date: Sat, 27 Apr 2002 22:10:16 +0000 Subject: Remove the nfs_{lock,unlock,islocked} functions and the associated definitions; they have been unused and #if 0'd out since the Lite/2 merge and we are unlikely to want them in the future. --- sys/nfsclient/nfs_node.c | 86 ------------------------------------------------ 1 file changed, 86 deletions(-) (limited to 'sys/nfsclient/nfs_node.c') diff --git a/sys/nfsclient/nfs_node.c b/sys/nfsclient/nfs_node.c index e3d8170..d8aa81a 100644 --- a/sys/nfsclient/nfs_node.c +++ b/sys/nfsclient/nfs_node.c @@ -357,89 +357,3 @@ nfs_reclaim(struct vop_reclaim_args *ap) vp->v_data = (void *)0; return (0); } - -#if 0 -/* - * Lock an nfsnode - */ -int -nfs_lock(struct vop_lock_args *ap) -{ - struct vnode *vp = ap->a_vp; - - /* - * Ugh, another place where interruptible mounts will get hung. - * If you make this sleep interruptible, then you have to fix all - * the VOP_LOCK() calls to expect interruptibility. - */ - while (vp->v_flag & VXLOCK) { - vp->v_flag |= VXWANT; - (void) tsleep((caddr_t)vp, PINOD, "nfslck", 0); - } - if (vp->v_tag == VT_NON) - return (ENOENT); - -#if 0 - /* - * Only lock regular files. If a server crashed while we were - * holding a directory lock, we could easily end up sleeping - * until the server rebooted while holding a lock on the root. - * Locks are only needed for protecting critical sections in - * VMIO at the moment. - * New vnodes will have type VNON but they should be locked - * since they may become VREG. This is checked in loadattrcache - * and unwanted locks are released there. - */ - if (vp->v_type == VREG || vp->v_type == VNON) { - while (np->n_flag & NLOCKED) { - np->n_flag |= NWANTED; - (void) tsleep((caddr_t) np, PINOD, "nfslck2", 0); - /* - * If the vnode has transmuted into a VDIR while we - * were asleep, then skip the lock. - */ - if (vp->v_type != VREG && vp->v_type != VNON) - return (0); - } - np->n_flag |= NLOCKED; - } -#endif - - return (0); -} - -/* - * Unlock an nfsnode - */ -int -nfs_unlock(struct vop_unlock_args *ap) -{ -#if 0 - struct vnode* vp = ap->a_vp; - struct nfsnode* np = VTONFS(vp); - - if (vp->v_type == VREG || vp->v_type == VNON) { - if (!(np->n_flag & NLOCKED)) - panic("nfs_unlock: nfsnode not locked"); - np->n_flag &= ~NLOCKED; - if (np->n_flag & NWANTED) { - np->n_flag &= ~NWANTED; - wakeup((caddr_t) np); - } - } -#endif - - return (0); -} - -/* - * Check for a locked nfsnode - */ -int -nfs_islocked(struct vop_islocked_args *ap) -{ - - return VTONFS(ap->a_vp)->n_flag & NLOCKED ? 1 : 0; -} -#endif - -- cgit v1.1