summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorBret Lambert <blambert@cvs.openbsd.org>2008-06-14 22:44:08 +0000
committerBret Lambert <blambert@cvs.openbsd.org>2008-06-14 22:44:08 +0000
commit892e5c7870feb83aed885e2d125fc87cdf442596 (patch)
tree15970249e962c624f72bc0bfbbe4200d863e290b /sys
parente2b77923703616711f56e18d99911219a9c0f185 (diff)
Replace nfsm_build/bcopy with nfsm_{buf,str}tombuf functions in
filehandle -> mbuf write macros. Removes `magic' variable cp which was used only in these macros, and should lead to marginally better mbuf packing as well. `slap it in' thib@
Diffstat (limited to 'sys')
-rw-r--r--sys/nfs/nfs_serv.c4
-rw-r--r--sys/nfs/nfs_vfsops.c4
-rw-r--r--sys/nfs/nfs_vnops.c19
-rw-r--r--sys/nfs/nfsm_subs.h12
4 files changed, 7 insertions, 32 deletions
diff --git a/sys/nfs/nfs_serv.c b/sys/nfs/nfs_serv.c
index 698924bc86e..ce08e07972e 100644
--- a/sys/nfs/nfs_serv.c
+++ b/sys/nfs/nfs_serv.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_serv.c,v 1.55 2008/06/14 00:26:13 thib Exp $ */
+/* $OpenBSD: nfs_serv.c,v 1.56 2008/06/14 22:44:07 blambert Exp $ */
/* $NetBSD: nfs_serv.c,v 1.34 1997/05/12 23:37:12 fvdl Exp $ */
/*
@@ -345,7 +345,6 @@ nfsrv_lookup(nfsd, slp, procp, mrq)
struct vnode *vp, *dirp;
nfsfh_t nfh;
fhandle_t *fhp;
- caddr_t cp;
u_int32_t *tl;
int32_t t1;
int error = 0, len, dirattr_ret = 1;
@@ -2108,7 +2107,6 @@ nfsrv_mkdir(nfsd, slp, procp, mrq)
struct vattr va, dirfor, diraft;
struct nfs_fattr *fp;
struct nameidata nd;
- caddr_t cp;
u_int32_t *tl;
int32_t t1;
int error = 0, len, dirfor_ret = 1, diraft_ret = 1;
diff --git a/sys/nfs/nfs_vfsops.c b/sys/nfs/nfs_vfsops.c
index 3a57d09f6bb..3084e8a88f4 100644
--- a/sys/nfs/nfs_vfsops.c
+++ b/sys/nfs/nfs_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_vfsops.c,v 1.75 2008/06/13 22:11:32 blambert Exp $ */
+/* $OpenBSD: nfs_vfsops.c,v 1.76 2008/06/14 22:44:07 blambert Exp $ */
/* $NetBSD: nfs_vfsops.c,v 1.46.4.1 1996/05/25 22:40:35 fvdl Exp $ */
/*
@@ -111,7 +111,6 @@ nfs_statfs(mp, sbp, p)
{
struct vnode *vp;
struct nfs_statfs *sfp = NULL;
- caddr_t cp;
u_int32_t *tl;
int32_t t1;
caddr_t dpos, cp2;
@@ -186,7 +185,6 @@ nfs_fsinfo(nmp, vp, cred, p)
struct proc *p;
{
struct nfsv3_fsinfo *fsp;
- caddr_t cp;
int32_t t1;
u_int32_t *tl, pref, max;
caddr_t dpos, cp2;
diff --git a/sys/nfs/nfs_vnops.c b/sys/nfs/nfs_vnops.c
index 2799dc87fd4..5236968f551 100644
--- a/sys/nfs/nfs_vnops.c
+++ b/sys/nfs/nfs_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_vnops.c,v 1.92 2008/06/13 22:11:32 blambert Exp $ */
+/* $OpenBSD: nfs_vnops.c,v 1.93 2008/06/14 22:44:07 blambert Exp $ */
/* $NetBSD: nfs_vnops.c,v 1.62.4.1 1996/07/08 20:26:52 jtc Exp $ */
/*
@@ -240,7 +240,6 @@ nfs_access(v)
struct vop_access_args *ap = v;
struct vnode *vp = ap->a_vp;
u_int32_t *tl;
- caddr_t cp;
int32_t t1;
caddr_t dpos, cp2;
int error = 0, attrflag;
@@ -492,7 +491,6 @@ nfs_getattr(v)
struct vop_getattr_args *ap = v;
struct vnode *vp = ap->a_vp;
struct nfsnode *np = VTONFS(vp);
- caddr_t cp;
int32_t t1;
caddr_t dpos;
int error = 0;
@@ -611,7 +609,6 @@ nfs_setattrrpc(vp, vap, cred, procp)
struct proc *procp;
{
struct nfsv2_sattr *sp;
- caddr_t cp;
int32_t t1;
caddr_t dpos, cp2;
u_int32_t *tl;
@@ -671,7 +668,6 @@ nfs_lookup(v)
int flags;
struct vnode *newvp;
u_int32_t *tl;
- caddr_t cp;
int32_t t1;
struct nfsmount *nmp;
caddr_t dpos, cp2;
@@ -950,7 +946,6 @@ nfs_readlinkrpc(vp, uiop, cred)
struct ucred *cred;
{
u_int32_t *tl;
- caddr_t cp;
int32_t t1;
caddr_t dpos, cp2;
int error = 0, len, attrflag;
@@ -982,7 +977,6 @@ nfs_readrpc(vp, uiop)
struct uio *uiop;
{
u_int32_t *tl;
- caddr_t cp;
int32_t t1;
caddr_t dpos, cp2;
struct mbuf *mreq, *mrep, *md, *mb;
@@ -1047,7 +1041,6 @@ nfs_writerpc(vp, uiop, iomode, must_commit)
int *iomode, *must_commit;
{
u_int32_t *tl;
- caddr_t cp;
int32_t t1, backup;
caddr_t dpos, cp2;
struct mbuf *mreq, *mrep, *md, *mb;
@@ -1160,7 +1153,6 @@ nfs_mknodrpc(dvp, vpp, cnp, vap)
{
struct nfsv2_sattr *sp;
u_int32_t *tl;
- caddr_t cp;
int32_t t1;
struct vnode *newvp = (struct vnode *)0;
struct nfsnode *np;
@@ -1272,7 +1264,6 @@ nfs_create(v)
struct componentname *cnp = ap->a_cnp;
struct nfsv2_sattr *sp;
u_int32_t *tl;
- caddr_t cp;
int32_t t1;
struct nfsnode *np = (struct nfsnode *)0;
struct vnode *newvp = (struct vnode *)0;
@@ -1457,7 +1448,6 @@ nfs_removerpc(dvp, name, namelen, cred, proc)
struct proc *proc;
{
u_int32_t *tl;
- caddr_t cp;
int32_t t1;
caddr_t dpos, cp2;
int error = 0, wccflag = NFSV3_WCCRATTR;
@@ -1576,7 +1566,6 @@ nfs_renamerpc(fdvp, fnameptr, fnamelen, tdvp, tnameptr, tnamelen, cred, proc)
struct proc *proc;
{
u_int32_t *tl;
- caddr_t cp;
int32_t t1;
caddr_t dpos, cp2;
int error = 0, fwccflag = NFSV3_WCCRATTR, twccflag = NFSV3_WCCRATTR;
@@ -1618,7 +1607,6 @@ nfs_link(v)
struct vnode *dvp = ap->a_dvp;
struct componentname *cnp = ap->a_cnp;
u_int32_t *tl;
- caddr_t cp;
int32_t t1;
caddr_t dpos, cp2;
int error = 0, wccflag = NFSV3_WCCRATTR, attrflag = 0;
@@ -1681,7 +1669,6 @@ nfs_symlink(v)
struct componentname *cnp = ap->a_cnp;
struct nfsv2_sattr *sp;
u_int32_t *tl;
- caddr_t cp;
int32_t t1;
caddr_t dpos, cp2;
int slen, error = 0, wccflag = NFSV3_WCCRATTR, gotvp;
@@ -1739,7 +1726,6 @@ nfs_mkdir(v)
struct componentname *cnp = ap->a_cnp;
struct nfsv2_sattr *sp;
u_int32_t *tl;
- caddr_t cp;
int32_t t1;
int len;
struct nfsnode *np = (struct nfsnode *)0;
@@ -1813,7 +1799,6 @@ nfs_rmdir(v)
struct vnode *dvp = ap->a_dvp;
struct componentname *cnp = ap->a_cnp;
u_int32_t *tl;
- caddr_t cp;
int32_t t1;
caddr_t dpos, cp2;
int error = 0, wccflag = NFSV3_WCCRATTR;
@@ -2509,7 +2494,6 @@ nfs_lookitup(dvp, name, len, cred, procp, npp)
struct nfsnode **npp;
{
u_int32_t *tl;
- caddr_t cp;
int32_t t1;
struct vnode *newvp = (struct vnode *)0;
struct nfsnode *np, *dnp = VTONFS(dvp);
@@ -2580,7 +2564,6 @@ nfs_commit(vp, offset, cnt, procp)
int cnt;
struct proc *procp;
{
- caddr_t cp;
u_int32_t *tl;
int32_t t1;
struct nfsmount *nmp = VFSTONFS(vp->v_mount);
diff --git a/sys/nfs/nfsm_subs.h b/sys/nfs/nfsm_subs.h
index 43d29ac281e..c2aa61b97e6 100644
--- a/sys/nfs/nfsm_subs.h
+++ b/sys/nfs/nfsm_subs.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfsm_subs.h,v 1.29 2008/06/13 22:11:32 blambert Exp $ */
+/* $OpenBSD: nfsm_subs.h,v 1.30 2008/06/14 22:44:07 blambert Exp $ */
/* $NetBSD: nfsm_subs.h,v 1.10 1996/03/20 21:59:56 fvdl Exp $ */
/*
@@ -86,18 +86,14 @@
nfsm_strtombuf(&mb, VTONFS(v)->n_fhp, \
VTONFS(v)->n_fhsize); \
} else { \
- cp = nfsm_build(&mb, NFSX_V2FH); \
- bcopy((caddr_t)VTONFS(v)->n_fhp, cp, NFSX_V2FH); \
+ nfsm_buftombuf(&mb, VTONFS(v)->n_fhp, NFSX_V2FH); \
} }
#define nfsm_srvfhtom(f, v3) \
{ if (v3) { \
- tl = nfsm_build(&mb, NFSX_UNSIGNED + NFSX_V3FH); \
- *tl++ = txdr_unsigned(NFSX_V3FH); \
- bcopy((caddr_t)(f), (caddr_t)tl, NFSX_V3FH); \
+ nfsm_strtombuf(&mb, (f), NFSX_V3FH); \
} else { \
- cp = nfsm_build(&mb, NFSX_V2FH); \
- bcopy((caddr_t)(f), cp, NFSX_V2FH); \
+ nfsm_buftombuf(&mb, (f), NFSX_V2FH); \
} }
#define nfsm_srvpostop_fh(f) \