From 10632e44ccd2046264d47cbc96a7d4f890c0c319 Mon Sep 17 00:00:00 2001 From: Ian Dowse Date: Sat, 27 Apr 2002 22:10:16 +0000 Subject: [PATCH] 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 ---------------------------------------- sys/nfsclient/nfsnode.h | 2 - 2 files changed, 88 deletions(-) diff --git a/sys/nfsclient/nfs_node.c b/sys/nfsclient/nfs_node.c index e3d8170e45ba..d8aa81a919f1 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 - diff --git a/sys/nfsclient/nfsnode.h b/sys/nfsclient/nfsnode.h index fcda484a8f9e..5fe3dce8af6f 100644 --- a/sys/nfsclient/nfsnode.h +++ b/sys/nfsclient/nfsnode.h @@ -137,8 +137,6 @@ struct nfsnode { #define NACC 0x0100 /* Special file accessed */ #define NUPD 0x0200 /* Special file updated */ #define NCHG 0x0400 /* Special file times changed */ -#define NLOCKED 0x0800 /* node is locked */ -#define NWANTED 0x0100 /* someone wants to lock */ /* * Convert between nfsnode pointers and vnode pointers