diff options
author | zack <zack@FreeBSD.org> | 2011-07-16 08:05:31 +0000 |
---|---|---|
committer | zack <zack@FreeBSD.org> | 2011-07-16 08:05:31 +0000 |
commit | d626afc8b3e9aead1393c2c520688f2e4f16415d (patch) | |
tree | 4b7af116cc91fe2fdea4b64ed479bd9aa651c387 | |
parent | ab40eb1f721cbd836ff5281884af9a205622877d (diff) | |
download | FreeBSD-src-d626afc8b3e9aead1393c2c520688f2e4f16415d.zip FreeBSD-src-d626afc8b3e9aead1393c2c520688f2e4f16415d.tar.gz |
Simple find/replace of vn_lock -> NFSVOPLOCK. This is done so that NFSVOPLOCK can be modified later to add enhanced logging and assertions.
Reviewed by: rmacklem
Approved by: zml (mentor)
MFC after: 2 weeks
-rw-r--r-- | sys/fs/nfs/nfs_commonsubs.c | 2 | ||||
-rw-r--r-- | sys/fs/nfsclient/nfs_clport.c | 2 | ||||
-rw-r--r-- | sys/fs/nfsclient/nfs_clsubs.c | 4 | ||||
-rw-r--r-- | sys/fs/nfsclient/nfs_clvnops.c | 14 | ||||
-rw-r--r-- | sys/fs/nfsserver/nfs_nfsdport.c | 12 | ||||
-rw-r--r-- | sys/fs/nfsserver/nfs_nfsdserv.c | 4 | ||||
-rw-r--r-- | sys/fs/nfsserver/nfs_nfsdsocket.c | 4 | ||||
-rw-r--r-- | sys/fs/nfsserver/nfs_nfsdstate.c | 10 |
8 files changed, 26 insertions, 26 deletions
diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c index ff5ea59..221bc61 100644 --- a/sys/fs/nfs/nfs_commonsubs.c +++ b/sys/fs/nfs/nfs_commonsubs.c @@ -2001,7 +2001,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount *mp, vnode_t vp, supports_nfsv4acls == 0)) { NFSCLRBIT_ATTRBIT(retbitp, NFSATTRBIT_ACL); } else if (naclp != NULL) { - if (vn_lock(vp, LK_SHARED) == 0) { + if (NFSVOPLOCK(vp, LK_SHARED) == 0) { error = VOP_ACCESSX(vp, VREAD_ACL, cred, p); if (error == 0) error = VOP_GETACL(vp, ACL_TYPE_NFS4, diff --git a/sys/fs/nfsclient/nfs_clport.c b/sys/fs/nfsclient/nfs_clport.c index 4a95887..812d359 100644 --- a/sys/fs/nfsclient/nfs_clport.c +++ b/sys/fs/nfsclient/nfs_clport.c @@ -127,7 +127,7 @@ nfscl_nget(struct mount *mntp, struct vnode *dvp, struct nfsfh *nfhp, if (error == 0 && nvp != NULL) { /* * I believe there is a slight chance that vgonel() could - * get called on this vnode between when vn_lock() drops + * get called on this vnode between when NFSVOPLOCK() drops * the VI_LOCK() and vget() acquires it again, so that it * hasn't yet had v_usecount incremented. If this were to * happen, the VI_DOOMED flag would be set, so check for diff --git a/sys/fs/nfsclient/nfs_clsubs.c b/sys/fs/nfsclient/nfs_clsubs.c index 214dfb7..fdb83b6 100644 --- a/sys/fs/nfsclient/nfs_clsubs.c +++ b/sys/fs/nfsclient/nfs_clsubs.c @@ -148,7 +148,7 @@ ncl_upgrade_vnlock(struct vnode *vp) KASSERT(old_lock == LK_SHARED, ("ncl_upgrade_vnlock: wrong old_lock %d", old_lock)); /* Upgrade to exclusive lock, this might block */ - vn_lock(vp, LK_UPGRADE | LK_RETRY); + NFSVOPLOCK(vp, LK_UPGRADE | LK_RETRY); } return (old_lock); } @@ -159,7 +159,7 @@ ncl_downgrade_vnlock(struct vnode *vp, int old_lock) if (old_lock != LK_EXCLUSIVE) { KASSERT(old_lock == LK_SHARED, ("wrong old_lock %d", old_lock)); /* Downgrade from exclusive lock. */ - vn_lock(vp, LK_DOWNGRADE | LK_RETRY); + NFSVOPLOCK(vp, LK_DOWNGRADE | LK_RETRY); } } diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c index 0a1d6a2..ff3aba6 100644 --- a/sys/fs/nfsclient/nfs_clvnops.c +++ b/sys/fs/nfsclient/nfs_clvnops.c @@ -1215,7 +1215,7 @@ nfs_lookup(struct vop_lookup_args *ap) vfs_ref(mp); VOP_UNLOCK(dvp, 0); error = vfs_busy(mp, 0); - vn_lock(dvp, ltype | LK_RETRY); + NFSVOPLOCK(dvp, ltype | LK_RETRY); vfs_rel(mp); if (error == 0 && (dvp->v_iflag & VI_DOOMED)) { vfs_unbusy(mp); @@ -1231,7 +1231,7 @@ nfs_lookup(struct vop_lookup_args *ap) newvp = NFSTOV(np); vfs_unbusy(mp); if (newvp != dvp) - vn_lock(dvp, ltype | LK_RETRY); + NFSVOPLOCK(dvp, ltype | LK_RETRY); if (dvp->v_iflag & VI_DOOMED) { if (error == 0) { if (newvp == dvp) @@ -1764,7 +1764,7 @@ nfs_rename(struct vop_rename_args *ap) error = 0; goto out; } - if ((error = vn_lock(fvp, LK_EXCLUSIVE)) != 0) + if ((error = NFSVOPLOCK(fvp, LK_EXCLUSIVE)) != 0) goto out; /* @@ -2943,7 +2943,7 @@ nfs_advlock(struct vop_advlock_args *ap) cred = p->p_ucred; else cred = td->td_ucred; - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY); if (vp->v_iflag & VI_DOOMED) { VOP_UNLOCK(vp, 0); return (EBADF); @@ -2973,7 +2973,7 @@ nfs_advlock(struct vop_advlock_args *ap) "ncladvl"); if (error) return (EINTR); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY); if (vp->v_iflag & VI_DOOMED) { VOP_UNLOCK(vp, 0); return (EBADF); @@ -3018,7 +3018,7 @@ nfs_advlock(struct vop_advlock_args *ap) VOP_UNLOCK(vp, 0); return (0); } else if (!NFS_ISV4(vp)) { - error = vn_lock(vp, LK_SHARED); + error = NFSVOPLOCK(vp, LK_SHARED); if (error) return (error); if ((VFSTONFS(vp->v_mount)->nm_flag & NFSMNT_NOLOCKD) != 0) { @@ -3049,7 +3049,7 @@ nfs_advlockasync(struct vop_advlockasync_args *ap) if (NFS_ISV4(vp)) return (EOPNOTSUPP); - error = vn_lock(vp, LK_SHARED); + error = NFSVOPLOCK(vp, LK_SHARED); if (error) return (error); if ((VFSTONFS(vp->v_mount)->nm_flag & NFSMNT_NOLOCKD) != 0) { diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index f3b7382..6e64cfc 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -118,7 +118,7 @@ nfsvno_getattr(struct vnode *vp, struct nfsvattr *nvap, struct ucred *cred, */ if (VOP_ISLOCKED(vp) != LK_EXCLUSIVE) { lockedit = 1; - vn_lock(vp, LK_SHARED | LK_RETRY); + NFSVOPLOCK(vp, LK_SHARED | LK_RETRY); } } error = VOP_GETATTR(vp, &nvap->na_vattr, cred); @@ -160,7 +160,7 @@ nfsvno_accchk(struct vnode *vp, accmode_t accmode, struct ucred *cred, int error = 0, getret = 0; if (vpislocked == 0) { - if (vn_lock(vp, LK_SHARED) != 0) + if (NFSVOPLOCK(vp, LK_SHARED) != 0) return (EPERM); } if (accmode & VWRITE) { @@ -1097,7 +1097,7 @@ nfsvno_rename(struct nameidata *fromndp, struct nameidata *tondp, goto out; } if (ndflag & ND_NFSV4) { - if (vn_lock(fvp, LK_EXCLUSIVE) == 0) { + if (NFSVOPLOCK(fvp, LK_EXCLUSIVE) == 0) { error = nfsrv_checkremove(fvp, 0, p); VOP_UNLOCK(fvp, 0); } else @@ -1158,7 +1158,7 @@ nfsvno_link(struct nameidata *ndp, struct vnode *vp, struct ucred *cred, error = EXDEV; } if (!error) { - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY); if ((vp->v_iflag & VI_DOOMED) == 0) error = VOP_LINK(ndp->ni_dvp, vp, &ndp->ni_cnd); else @@ -1986,7 +1986,7 @@ again: dp->d_name[1] == '.') cn.cn_flags |= ISDOTDOT; - if (vn_lock(vp, LK_SHARED) + if (NFSVOPLOCK(vp, LK_SHARED) != 0) { nd->nd_repstat = EPERM; break; @@ -2578,7 +2578,7 @@ nfsvno_fhtovp(struct mount *mp, fhandle_t *fhp, struct sockaddr *nam, * but this will have to do until VFS_FHTOVP() has a lock * type argument like VFS_VGET(). */ - vn_lock(*vpp, LK_DOWNGRADE | LK_RETRY); + NFSVOPLOCK(*vpp, LK_DOWNGRADE | LK_RETRY); return (error); } diff --git a/sys/fs/nfsserver/nfs_nfsdserv.c b/sys/fs/nfsserver/nfs_nfsdserv.c index 316228a..e9b3cfb 100644 --- a/sys/fs/nfsserver/nfs_nfsdserv.c +++ b/sys/fs/nfsserver/nfs_nfsdserv.c @@ -238,7 +238,7 @@ nfsrvd_getattr(struct nfsrv_descript *nd, int isdgram, VOP_UNLOCK(vp, 0); if (at_root != 0) { if ((nd->nd_repstat = - vn_lock(tvp, LK_SHARED)) == 0) { + NFSVOPLOCK(tvp, LK_SHARED)) == 0) { nd->nd_repstat = VOP_GETATTR( tvp, &va, nd->nd_cred); vput(tvp); @@ -2703,7 +2703,7 @@ nfsrvd_open(struct nfsrv_descript *nd, __unused int isdgram, }; stp->ls_flags |= NFSLCK_RECLAIM; vp = dp; - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY); if ((vp->v_iflag & VI_DOOMED) == 0) nd->nd_repstat = nfsrv_opencheck(clientid, &stateid, stp, vp, nd, p, nd->nd_repstat); diff --git a/sys/fs/nfsserver/nfs_nfsdsocket.c b/sys/fs/nfsserver/nfs_nfsdsocket.c index 8773527..a76ff5c 100644 --- a/sys/fs/nfsserver/nfs_nfsdsocket.c +++ b/sys/fs/nfsserver/nfs_nfsdsocket.c @@ -861,7 +861,7 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram, } if (nfsv4_opflag[op].modifyfs) vn_start_write(savevp, &temp_mp, V_WAIT); - if (vn_lock(savevp, LK_EXCLUSIVE) == 0) { + if (NFSVOPLOCK(savevp, LK_EXCLUSIVE) == 0) { VREF(vp); VREF(savevp); error = (*(nfsrv4_ops2[op]))(nd, isdgram, @@ -878,7 +878,7 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram, if (nfsv4_opflag[op].modifyfs) vn_start_write(vp, &temp_mp, V_WAIT); - if (vn_lock(vp, nfsv4_opflag[op].lktype) + if (NFSVOPLOCK(vp, nfsv4_opflag[op].lktype) == 0) VREF(vp); else diff --git a/sys/fs/nfsserver/nfs_nfsdstate.c b/sys/fs/nfsserver/nfs_nfsdstate.c index fc84d72..96e1d54 100644 --- a/sys/fs/nfsserver/nfs_nfsdstate.c +++ b/sys/fs/nfsserver/nfs_nfsdstate.c @@ -4096,7 +4096,7 @@ nfsrv_updatestable(NFSPROC_T *p) NFSVNO_SETATTRVAL(&nva, size, 0); vp = NFSFPVNODE(sf->nsf_fp); vn_start_write(vp, &mp, V_WAIT); - if (vn_lock(vp, LK_EXCLUSIVE) == 0) { + if (NFSVOPLOCK(vp, LK_EXCLUSIVE) == 0) { error = nfsvno_setattr(vp, &nva, NFSFPCRED(sf->nsf_fp), p, NULL); VOP_UNLOCK(vp, 0); @@ -4231,7 +4231,7 @@ nfsrv_checkstable(struct nfsclient *clp) * Return 0 to indicate the conflict can't be revoked and 1 to indicate * the revocation worked and the conflicting client is "bye, bye", so it * can be tried again. - * Return 2 to indicate that the vnode is VI_DOOMED after vn_lock(). + * Return 2 to indicate that the vnode is VI_DOOMED after NFSVOPLOCK(). * Unlocks State before a non-zero value is returned. */ static int @@ -4258,7 +4258,7 @@ nfsrv_clientconflict(struct nfsclient *clp, int *haslockp, vnode_t vp, } while (!gotlock); NFSUNLOCKV4ROOTMUTEX(); *haslockp = 1; - vn_lock(vp, lktype | LK_RETRY); + NFSVOPLOCK(vp, lktype | LK_RETRY); if ((vp->v_iflag & VI_DOOMED) != 0) return (2); else @@ -4426,7 +4426,7 @@ nfsrv_delegconflict(struct nfsstate *stp, int *haslockp, NFSPROC_T *p, } while (!gotlock); NFSUNLOCKV4ROOTMUTEX(); *haslockp = 1; - vn_lock(vp, lktype | LK_RETRY); + NFSVOPLOCK(vp, lktype | LK_RETRY); if ((vp->v_iflag & VI_DOOMED) != 0) { *haslockp = 0; NFSLOCKV4ROOTMUTEX(); @@ -4626,7 +4626,7 @@ nfsd_recalldelegation(vnode_t vp, NFSPROC_T *p) NFSGETNANOTIME(&mytime); starttime = (u_int32_t)mytime.tv_sec; do { - if (vn_lock(vp, LK_EXCLUSIVE) == 0) { + if (NFSVOPLOCK(vp, LK_EXCLUSIVE) == 0) { error = nfsrv_checkremove(vp, 0, p); VOP_UNLOCK(vp, 0); } else |