summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzack <zack@FreeBSD.org>2011-07-16 08:05:26 +0000
committerzack <zack@FreeBSD.org>2011-07-16 08:05:26 +0000
commitab40eb1f721cbd836ff5281884af9a205622877d (patch)
tree18c843ac36e91020e0d14fbabeeaef680147a3cc
parenta00a7b50afc47abcdf45a5d926f5fcf4634f7652 (diff)
downloadFreeBSD-src-ab40eb1f721cbd836ff5281884af9a205622877d.zip
FreeBSD-src-ab40eb1f721cbd836ff5281884af9a205622877d.tar.gz
Remove unnecessary thread pointer from VOPLOCK macros and current users.
Reviewed by: rmacklem Approved by: zml (mentor) MFC after: 2 weeks
-rw-r--r--sys/fs/nfs/nfsport.h9
-rw-r--r--sys/fs/nfsserver/nfs_nfsdport.c10
-rw-r--r--sys/fs/nfsserver/nfs_nfsdserv.c10
-rw-r--r--sys/fs/nfsserver/nfs_nfsdsocket.c2
4 files changed, 17 insertions, 14 deletions
diff --git a/sys/fs/nfs/nfsport.h b/sys/fs/nfs/nfsport.h
index 9866ef7..726d3b5 100644
--- a/sys/fs/nfs/nfsport.h
+++ b/sys/fs/nfs/nfsport.h
@@ -836,10 +836,13 @@ void nfsd_mntinit(void);
/*
* Define these for vnode lock/unlock ops.
+ *
+ * These are good abstractions to macro out, so that they can be added to
+ * later, for debugging or stats, etc.
*/
-#define NFSVOPLOCK(v, f, p) vn_lock((v), (f))
-#define NFSVOPUNLOCK(v, f, p) VOP_UNLOCK((v), (f))
-#define NFSVOPISLOCKED(v, p) VOP_ISLOCKED((v))
+#define NFSVOPLOCK(v, f) vn_lock((v), (f))
+#define NFSVOPUNLOCK(v, f) VOP_UNLOCK((v), (f))
+#define NFSVOPISLOCKED(v) VOP_ISLOCKED((v))
/*
* Define ncl_hash().
diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c
index afd69e7..f3b7382 100644
--- a/sys/fs/nfsserver/nfs_nfsdport.c
+++ b/sys/fs/nfsserver/nfs_nfsdport.c
@@ -282,7 +282,7 @@ nfsvno_namei(struct nfsrv_descript *nd, struct nameidata *ndp,
return (ENOTDIR);
}
if (islocked)
- NFSVOPUNLOCK(dp, 0, p);
+ NFSVOPUNLOCK(dp, 0);
VREF(dp);
*retdirp = dp;
if (NFSVNO_EXRDONLY(exp))
@@ -351,7 +351,7 @@ nfsvno_namei(struct nfsrv_descript *nd, struct nameidata *ndp,
if ((cnp->cn_flags & (SAVENAME | SAVESTART)) == 0)
nfsvno_relpathbuf(ndp);
if (ndp->ni_vp && !lockleaf)
- NFSVOPUNLOCK(ndp->ni_vp, 0, p);
+ NFSVOPUNLOCK(ndp->ni_vp, 0);
break;
}
@@ -359,7 +359,7 @@ nfsvno_namei(struct nfsrv_descript *nd, struct nameidata *ndp,
* Validate symlink
*/
if ((cnp->cn_flags & LOCKPARENT) && ndp->ni_pathlen == 1)
- NFSVOPUNLOCK(ndp->ni_dvp, 0, p);
+ NFSVOPUNLOCK(ndp->ni_dvp, 0);
if (!(nd->nd_flag & ND_PUBLOOKUP)) {
error = EINVAL;
goto badlink2;
@@ -2868,14 +2868,14 @@ nfsvno_advlock(struct vnode *vp, int ftype, u_int64_t first,
fl.l_pid = (pid_t)0;
fl.l_sysid = (int)nfsv4_sysid;
- NFSVOPUNLOCK(vp, 0, td);
+ NFSVOPUNLOCK(vp, 0);
if (ftype == F_UNLCK)
error = VOP_ADVLOCK(vp, (caddr_t)td->td_proc, F_UNLCK, &fl,
(F_POSIX | F_REMOTE));
else
error = VOP_ADVLOCK(vp, (caddr_t)td->td_proc, F_SETLK, &fl,
(F_POSIX | F_REMOTE));
- NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY, td);
+ NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY);
return (error);
}
diff --git a/sys/fs/nfsserver/nfs_nfsdserv.c b/sys/fs/nfsserver/nfs_nfsdserv.c
index 64aafb4..316228a 100644
--- a/sys/fs/nfsserver/nfs_nfsdserv.c
+++ b/sys/fs/nfsserver/nfs_nfsdserv.c
@@ -1449,7 +1449,7 @@ nfsrvd_rename(struct nfsrv_descript *nd, int isdgram,
if (tdp) {
tdirfor_ret = nfsvno_getattr(tdp, &tdirfor, nd->nd_cred,
p, 1);
- NFSVOPUNLOCK(tdp, 0, p);
+ NFSVOPUNLOCK(tdp, 0);
}
}
NFSNAMEICNDSET(&tond.ni_cnd, nd->nd_cred, RENAME, LOCKPARENT | LOCKLEAF | NOCACHE | SAVESTART);
@@ -1554,7 +1554,7 @@ nfsrvd_link(struct nfsrv_descript *nd, int isdgram,
nfsrv_wcc(nd, dirfor_ret, &dirfor, diraft_ret, &diraft);
return (0);
}
- NFSVOPUNLOCK(vp, 0, p);
+ NFSVOPUNLOCK(vp, 0);
if (vnode_vtype(vp) == VDIR) {
if (nd->nd_flag & ND_NFSV4)
nd->nd_repstat = NFSERR_ISDIR;
@@ -1584,7 +1584,7 @@ nfsrvd_link(struct nfsrv_descript *nd, int isdgram,
nfsd_fhtovp(nd, &dfh, LK_EXCLUSIVE, &dp, &tnes, NULL, 0,
p);
if (dp)
- NFSVOPUNLOCK(dp, 0, p);
+ NFSVOPUNLOCK(dp, 0);
}
}
NFSNAMEICNDSET(&named.ni_cnd, nd->nd_cred, CREATE,
@@ -1868,7 +1868,7 @@ nfsrvd_mkdirsub(struct nfsrv_descript *nd, struct nameidata *ndp,
nd->nd_repstat = nfsvno_getattr(vp, nvap, nd->nd_cred,
p, 1);
if (vpp && !nd->nd_repstat) {
- NFSVOPUNLOCK(vp, 0, p);
+ NFSVOPUNLOCK(vp, 0);
*vpp = vp;
} else {
vput(vp);
@@ -2765,7 +2765,7 @@ nfsrvd_open(struct nfsrv_descript *nd, __unused int isdgram,
* (ie: Leave the NFSVOPUNLOCK() about here.)
*/
if (vp)
- NFSVOPUNLOCK(vp, 0, p);
+ NFSVOPUNLOCK(vp, 0);
if (stp)
FREE((caddr_t)stp, M_NFSDSTATE);
if (!nd->nd_repstat && dirp)
diff --git a/sys/fs/nfsserver/nfs_nfsdsocket.c b/sys/fs/nfsserver/nfs_nfsdsocket.c
index 33be284..8773527 100644
--- a/sys/fs/nfsserver/nfs_nfsdsocket.c
+++ b/sys/fs/nfsserver/nfs_nfsdsocket.c
@@ -430,7 +430,7 @@ nfsrvd_dorpc(struct nfsrv_descript *nd, int isdgram,
} else {
if (nfs_retfh[nd->nd_procnum] == 1) {
if (vp)
- NFSVOPUNLOCK(vp, 0, p);
+ NFSVOPUNLOCK(vp, 0);
error = (*(nfsrv3_procs1[nd->nd_procnum]))(nd, isdgram,
vp, NULL, (fhandle_t *)fh.nfsrvfh_data, p, &nes);
} else if (nfs_retfh[nd->nd_procnum] == 2) {
OpenPOWER on IntegriCloud