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.
This commit is contained in:
Ian Dowse 2002-04-27 22:10:16 +00:00
parent 089b073345
commit 10632e44cc
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=95590
2 changed files with 0 additions and 88 deletions

View File

@ -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

View File

@ -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