summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorBret Lambert <blambert@cvs.openbsd.org>2008-06-12 20:24:07 +0000
committerBret Lambert <blambert@cvs.openbsd.org>2008-06-12 20:24:07 +0000
commitec25606cfce1451aa1fa4e172b5ffa1c1b7982c9 (patch)
treebd21a66a427d87c7ed47f807fbeabfc8f729b9b4 /sys
parentc03ea754147b42148781159cf5f5e3aac0a77121 (diff)
Remove now-vestigial bpos pointer from NFS. For building outgoing
NFS mbufs, mbufs now contain all their internal buffer state internally, the way god intended. ok thib@ testing johan@ (and possibly merdely@; this diff's been around for a bit...)
Diffstat (limited to 'sys')
-rw-r--r--sys/nfs/nfs_serv.c156
-rw-r--r--sys/nfs/nfs_socket.c15
-rw-r--r--sys/nfs/nfs_srvcache.c6
-rw-r--r--sys/nfs/nfs_subs.c83
-rw-r--r--sys/nfs/nfs_var.h20
-rw-r--r--sys/nfs/nfs_vfsops.c6
-rw-r--r--sys/nfs/nfs_vnops.c90
-rw-r--r--sys/nfs/nfsm_subs.h26
8 files changed, 174 insertions, 228 deletions
diff --git a/sys/nfs/nfs_serv.c b/sys/nfs/nfs_serv.c
index 6145f253c96..7929c835705 100644
--- a/sys/nfs/nfs_serv.c
+++ b/sys/nfs/nfs_serv.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_serv.c,v 1.52 2008/06/11 04:52:27 blambert Exp $ */
+/* $OpenBSD: nfs_serv.c,v 1.53 2008/06/12 20:24:06 blambert Exp $ */
/* $NetBSD: nfs_serv.c,v 1.34 1997/05/12 23:37:12 fvdl Exp $ */
/*
@@ -109,7 +109,6 @@ nfsrv3_access(nfsd, slp, procp, mrq)
fhandle_t *fhp;
u_int32_t *tl;
int32_t t1;
- caddr_t bpos;
int error = 0, rdonly, getret;
char *cp2;
struct mbuf *mb, *mreq;
@@ -148,7 +147,7 @@ nfsrv3_access(nfsd, slp, procp, mrq)
vput(vp);
nfsm_reply(NFSX_POSTOPATTR(1) + NFSX_UNSIGNED);
nfsm_srvpostop_attr(getret, &va);
- tl = nfsm_build(&mb, NFSX_UNSIGNED, &bpos);
+ tl = nfsm_build(&mb, NFSX_UNSIGNED);
*tl = txdr_unsigned(nfsmode);
nfsmout:
return(error);
@@ -175,7 +174,6 @@ nfsrv_getattr(nfsd, slp, procp, mrq)
fhandle_t *fhp;
u_int32_t *tl;
int32_t t1;
- caddr_t bpos;
int error = 0, rdonly;
char *cp2;
struct mbuf *mb, *mreq;
@@ -192,7 +190,7 @@ nfsrv_getattr(nfsd, slp, procp, mrq)
nfsm_reply(NFSX_FATTR(nfsd->nd_flag & ND_NFSV3));
if (error)
return (0);
- fp = nfsm_build(&mb, NFSX_FATTR(nfsd->nd_flag & ND_NFSV3), &bpos);
+ fp = nfsm_build(&mb, NFSX_FATTR(nfsd->nd_flag & ND_NFSV3));
nfsm_srvfattr(nfsd, &va, fp);
nfsmout:
return(error);
@@ -220,7 +218,6 @@ nfsrv_setattr(nfsd, slp, procp, mrq)
fhandle_t *fhp;
u_int32_t *tl;
int32_t t1;
- caddr_t bpos;
int error = 0, rdonly, preat_ret = 1, postat_ret = 1;
int v3 = (nfsd->nd_flag & ND_NFSV3), gcheck = 0;
char *cp2;
@@ -276,8 +273,7 @@ nfsrv_setattr(nfsd, slp, procp, mrq)
error = nfsrv_fhtovp(fhp, 1, &vp, cred, slp, nam, &rdonly);
if (error) {
nfsm_reply(2 * NFSX_UNSIGNED);
- nfsm_srvwcc(nfsd, preat_ret, &preat, postat_ret, &va, &mb,
- &bpos);
+ nfsm_srvwcc(nfsd, preat_ret, &preat, postat_ret, &va, &mb);
return (0);
}
if (v3) {
@@ -290,7 +286,7 @@ nfsrv_setattr(nfsd, slp, procp, mrq)
vput(vp);
nfsm_reply(NFSX_WCCDATA(v3));
nfsm_srvwcc(nfsd, preat_ret, &preat, postat_ret, &va,
- &mb, &bpos);
+ &mb);
return (0);
}
}
@@ -320,11 +316,10 @@ out:
vput(vp);
nfsm_reply(NFSX_WCCORFATTR(v3));
if (v3) {
- nfsm_srvwcc(nfsd, preat_ret, &preat, postat_ret, &va, &mb,
- &bpos);
+ nfsm_srvwcc(nfsd, preat_ret, &preat, postat_ret, &va, &mb);
return (0);
} else {
- fp = nfsm_build(&mb, NFSX_V2FATTR, &bpos);
+ fp = nfsm_build(&mb, NFSX_V2FATTR);
nfsm_srvfattr(nfsd, &va, fp);
}
nfsmout:
@@ -353,7 +348,6 @@ nfsrv_lookup(nfsd, slp, procp, mrq)
caddr_t cp;
u_int32_t *tl;
int32_t t1;
- caddr_t bpos;
int error = 0, len, dirattr_ret = 1;
int v3 = (nfsd->nd_flag & ND_NFSV3);
char *cp2;
@@ -397,7 +391,7 @@ nfsrv_lookup(nfsd, slp, procp, mrq)
nfsm_srvpostop_attr(0, &va);
nfsm_srvpostop_attr(dirattr_ret, &dirattr);
} else {
- fp = nfsm_build(&mb, NFSX_V2FATTR, &bpos);
+ fp = nfsm_build(&mb, NFSX_V2FATTR);
nfsm_srvfattr(nfsd, &va, fp);
}
nfsmout:
@@ -423,7 +417,6 @@ nfsrv_readlink(nfsd, slp, procp, mrq)
struct mbuf *mp;
u_int32_t *tl;
int32_t t1;
- caddr_t bpos;
int error = 0, rdonly, i, tlen, len, getret;
int v3 = (nfsd->nd_flag & ND_NFSV3);
char *cp2;
@@ -496,7 +489,7 @@ out:
tlen = nfsm_rndup(len);
nfsm_adj(mp3, NFS_MAXPATHLEN-tlen, tlen-len);
}
- tl = nfsm_build(&mb, NFSX_UNSIGNED, &bpos);
+ tl = nfsm_build(&mb, NFSX_UNSIGNED);
*tl = txdr_unsigned(len);
mb->m_next = mp3;
nfsmout:
@@ -524,7 +517,6 @@ nfsrv_read(nfsd, slp, procp, mrq)
u_int32_t *tl;
int32_t t1;
int i;
- caddr_t bpos;
int error = 0, rdonly, cnt, len, left, siz, tlen, getret;
int v3 = (nfsd->nd_flag & ND_NFSV3), reqlen;
char *cp2;
@@ -580,12 +572,12 @@ nfsrv_read(nfsd, slp, procp, mrq)
cnt = reqlen;
nfsm_reply(NFSX_POSTOPORFATTR(v3) + 3 * NFSX_UNSIGNED+nfsm_rndup(cnt));
if (v3) {
- tl = nfsm_build(&mb, NFSX_V3FATTR + 4 * NFSX_UNSIGNED, &bpos);
+ tl = nfsm_build(&mb, NFSX_V3FATTR + 4 * NFSX_UNSIGNED);
*tl++ = nfs_true;
fp = (struct nfs_fattr *)tl;
tl += (NFSX_V3FATTR / sizeof (u_int32_t));
} else {
- tl = nfsm_build(&mb, NFSX_V2FATTR + NFSX_UNSIGNED, &bpos);
+ tl = nfsm_build(&mb, NFSX_V2FATTR + NFSX_UNSIGNED);
fp = (struct nfs_fattr *)tl;
tl += (NFSX_V2FATTR / sizeof (u_int32_t));
}
@@ -689,7 +681,6 @@ nfsrv_write(nfsd, slp, procp, mrq)
struct vattr va, forat;
u_int32_t *tl;
int32_t t1;
- caddr_t bpos;
int error = 0, rdonly, len, forat_ret = 1;
int ioflags, aftat_ret = 1, retlen, zeroing, adjust;
int stable = NFSV3WRITE_FILESYNC;
@@ -754,15 +745,13 @@ nfsrv_write(nfsd, slp, procp, mrq)
if (len > NFS_MAXDATA || len < 0 || i < len) {
error = EIO;
nfsm_reply(2 * NFSX_UNSIGNED);
- nfsm_srvwcc(nfsd, forat_ret, &forat, aftat_ret, &va, &mb,
- &bpos);
+ nfsm_srvwcc(nfsd, forat_ret, &forat, aftat_ret, &va, &mb);
return (0);
}
error = nfsrv_fhtovp(fhp, 1, &vp, cred, slp, nam, &rdonly);
if (error) {
nfsm_reply(2 * NFSX_UNSIGNED);
- nfsm_srvwcc(nfsd, forat_ret, &forat, aftat_ret, &va, &mb,
- &bpos);
+ nfsm_srvwcc(nfsd, forat_ret, &forat, aftat_ret, &va, &mb);
return (0);
}
if (v3)
@@ -779,8 +768,7 @@ nfsrv_write(nfsd, slp, procp, mrq)
if (error) {
vput(vp);
nfsm_reply(NFSX_WCCDATA(v3));
- nfsm_srvwcc(nfsd, forat_ret, &forat, aftat_ret, &va, &mb,
- &bpos);
+ nfsm_srvwcc(nfsd, forat_ret, &forat, aftat_ret, &va, &mb);
return (0);
}
@@ -827,11 +815,10 @@ nfsrv_write(nfsd, slp, procp, mrq)
nfsm_reply(NFSX_PREOPATTR(v3) + NFSX_POSTOPORFATTR(v3) +
2 * NFSX_UNSIGNED + NFSX_WRITEVERF(v3));
if (v3) {
- nfsm_srvwcc(nfsd, forat_ret, &forat, aftat_ret, &va, &mb,
- &bpos);
+ nfsm_srvwcc(nfsd, forat_ret, &forat, aftat_ret, &va, &mb);
if (error)
return (0);
- tl = nfsm_build(&mb, 4 * NFSX_UNSIGNED, &bpos);
+ tl = nfsm_build(&mb, 4 * NFSX_UNSIGNED);
*tl++ = txdr_unsigned(retlen);
if (stable == NFSV3WRITE_UNSTABLE)
*tl++ = txdr_unsigned(stable);
@@ -845,7 +832,7 @@ nfsrv_write(nfsd, slp, procp, mrq)
*tl++ = txdr_unsigned(boottime.tv_sec);
*tl = txdr_unsigned(boottime.tv_usec);
} else {
- fp = nfsm_build(&mb, NFSX_V2FATTR, &bpos);
+ fp = nfsm_build(&mb, NFSX_V2FATTR);
nfsm_srvfattr(nfsd, &va, fp);
}
nfsmout:
@@ -877,7 +864,7 @@ nfsrv_writegather(ndp, slp, procp, mrq)
struct vattr va, forat;
u_int32_t *tl;
int32_t t1;
- caddr_t bpos, dpos;
+ caddr_t dpos;
int error = 0, rdonly, len = 0, forat_ret = 1;
int ioflags, aftat_ret = 1, s, adjust, v3, zeroing;
char *cp2;
@@ -953,8 +940,7 @@ nfsmout:
error = EIO;
nfsm_writereply(2 * NFSX_UNSIGNED, v3);
if (v3)
- nfsm_srvwcc(nfsd, forat_ret, &forat, aftat_ret, &va, &mb,
- &bpos);
+ nfsm_srvwcc(nfsd, forat_ret, &forat, aftat_ret, &va, &mb);
nfsd->nd_mreq = mreq;
nfsd->nd_mrep = NULL;
nfsd->nd_time = 0;
@@ -1100,7 +1086,7 @@ loop1:
nfsm_writereply(NFSX_WCCDATA(v3), v3);
if (v3) {
nfsm_srvwcc(nfsd, forat_ret, &forat, aftat_ret,
- &va, &mb, &bpos);
+ &va, &mb);
}
} else {
nfsm_writereply(NFSX_PREOPATTR(v3) +
@@ -1108,8 +1094,8 @@ loop1:
NFSX_WRITEVERF(v3), v3);
if (v3) {
nfsm_srvwcc(nfsd, forat_ret, &forat, aftat_ret,
- &va, &mb, &bpos);
- tl = nfsm_build(&mb, 4 * NFSX_UNSIGNED, &bpos);
+ &va, &mb);
+ tl = nfsm_build(&mb, 4 * NFSX_UNSIGNED);
*tl++ = txdr_unsigned(nfsd->nd_len);
*tl++ = txdr_unsigned(swp->nd_stable);
/*
@@ -1120,7 +1106,7 @@ loop1:
*tl++ = txdr_unsigned(boottime.tv_sec);
*tl = txdr_unsigned(boottime.tv_usec);
} else {
- fp = nfsm_build(&mb, NFSX_V2FATTR, &bpos);
+ fp = nfsm_build(&mb, NFSX_V2FATTR);
nfsm_srvfattr(nfsd, &va, fp);
}
}
@@ -1243,7 +1229,6 @@ nfsrv_create(nfsd, slp, procp, mrq)
struct nameidata nd;
caddr_t cp;
int32_t t1;
- caddr_t bpos;
int error = 0, len, tsize, dirfor_ret = 1, diraft_ret = 1;
dev_t rdev = 0;
int v3 = (nfsd->nd_flag & ND_NFSV3), how, exclusive_flag = 0;
@@ -1275,7 +1260,7 @@ nfsrv_create(nfsd, slp, procp, mrq)
if (error) {
nfsm_reply(NFSX_WCCDATA(v3));
nfsm_srvwcc(nfsd, dirfor_ret, &dirfor, diraft_ret, &diraft,
- &mb, &bpos);
+ &mb);
if (dirp)
vrele(dirp);
return (0);
@@ -1438,10 +1423,10 @@ nfsrv_create(nfsd, slp, procp, mrq)
nfsm_srvpostop_attr(0, &va);
}
nfsm_srvwcc(nfsd, dirfor_ret, &dirfor, diraft_ret, &diraft,
- &mb, &bpos);
+ &mb);
} else {
nfsm_srvfhtom(fhp, v3);
- fp = nfsm_build(&mb, NFSX_V2FATTR, &bpos);
+ fp = nfsm_build(&mb, NFSX_V2FATTR);
nfsm_srvfattr(nfsd, &va, fp);
}
return (0);
@@ -1480,7 +1465,6 @@ nfsrv_mknod(nfsd, slp, procp, mrq)
u_int32_t *tl;
struct nameidata nd;
int32_t t1;
- caddr_t bpos;
int error = 0, len, dirfor_ret = 1, diraft_ret = 1;
u_int32_t major, minor;
enum vtype vtyp;
@@ -1503,7 +1487,7 @@ nfsrv_mknod(nfsd, slp, procp, mrq)
if (error) {
nfsm_reply(NFSX_WCCDATA(1));
nfsm_srvwcc(nfsd, dirfor_ret, &dirfor, diraft_ret, &diraft,
- &mb, &bpos);
+ &mb);
if (dirp)
vrele(dirp);
return (0);
@@ -1590,8 +1574,7 @@ out:
nfsm_srvpostop_fh(fhp);
nfsm_srvpostop_attr(0, &va);
}
- nfsm_srvwcc(nfsd, dirfor_ret, &dirfor, diraft_ret, &diraft, &mb,
- &bpos);
+ nfsm_srvwcc(nfsd, dirfor_ret, &dirfor, diraft_ret, &diraft, &mb);
return (0);
nfsmout:
if (dirp)
@@ -1627,7 +1610,6 @@ nfsrv_remove(nfsd, slp, procp, mrq)
struct nameidata nd;
u_int32_t *tl;
int32_t t1;
- caddr_t bpos;
int error = 0, len, dirfor_ret = 1, diraft_ret = 1;
int v3 = (nfsd->nd_flag & ND_NFSV3);
char *cp2;
@@ -1687,7 +1669,7 @@ out:
nfsm_reply(NFSX_WCCDATA(v3));
if (v3) {
nfsm_srvwcc(nfsd, dirfor_ret, &dirfor, diraft_ret, &diraft,
- &mb, &bpos);
+ &mb);
return (0);
}
nfsmout:
@@ -1710,7 +1692,6 @@ nfsrv_rename(nfsd, slp, procp, mrq)
struct ucred *cred = &nfsd->nd_cr;
u_int32_t *tl;
int32_t t1;
- caddr_t bpos;
int error = 0, len, len2, fdirfor_ret = 1, fdiraft_ret = 1;
int tdirfor_ret = 1, tdiraft_ret = 1;
int v3 = (nfsd->nd_flag & ND_NFSV3);
@@ -1751,9 +1732,9 @@ nfsrv_rename(nfsd, slp, procp, mrq)
if (error) {
nfsm_reply(2 * NFSX_WCCDATA(v3));
nfsm_srvwcc(nfsd, fdirfor_ret, &fdirfor, fdiraft_ret, &fdiraft,
- &mb, &bpos);
+ &mb);
nfsm_srvwcc(nfsd, tdirfor_ret, &tdirfor, tdiraft_ret, &tdiraft,
- &mb, &bpos);
+ &mb);
if (fdirp)
vrele(fdirp);
return (0);
@@ -1850,9 +1831,9 @@ out1:
nfsm_reply(2 * NFSX_WCCDATA(v3));
if (v3) {
nfsm_srvwcc(nfsd, fdirfor_ret, &fdirfor, fdiraft_ret, &fdiraft,
- &mb, &bpos);
+ &mb);
nfsm_srvwcc(nfsd, tdirfor_ret, &tdirfor, tdiraft_ret, &tdiraft,
- &mb, &bpos);
+ &mb);
}
return (0);
@@ -1892,7 +1873,6 @@ nfsrv_link(nfsd, slp, procp, mrq)
struct nameidata nd;
u_int32_t *tl;
int32_t t1;
- caddr_t bpos;
int error = 0, rdonly, len, dirfor_ret = 1, diraft_ret = 1;
int getret = 1, v3 = (nfsd->nd_flag & ND_NFSV3);
char *cp2;
@@ -1912,7 +1892,7 @@ nfsrv_link(nfsd, slp, procp, mrq)
nfsm_reply(NFSX_POSTOPATTR(v3) + NFSX_WCCDATA(v3));
nfsm_srvpostop_attr(getret, &at);
nfsm_srvwcc(nfsd, dirfor_ret, &dirfor, diraft_ret, &diraft,
- &mb, &bpos);
+ &mb);
return (0);
}
if (vp->v_type == VDIR && (error = suser_ucred(cred)) != 0)
@@ -1964,7 +1944,7 @@ out1:
if (v3) {
nfsm_srvpostop_attr(getret, &at);
nfsm_srvwcc(nfsd, dirfor_ret, &dirfor, diraft_ret, &diraft,
- &mb, &bpos);
+ &mb);
return (0);
}
nfsmout:
@@ -1990,7 +1970,7 @@ nfsrv_symlink(nfsd, slp, procp, mrq)
u_int32_t *tl;
int32_t t1;
struct nfsv2_sattr *sp;
- char *bpos, *pathcp = NULL, *cp2;
+ char *pathcp = NULL, *cp2;
struct uio io;
struct iovec iv;
int error = 0, len, len2, dirfor_ret = 1, diraft_ret = 1;
@@ -2089,7 +2069,7 @@ out:
nfsm_srvpostop_attr(0, &va);
}
nfsm_srvwcc(nfsd, dirfor_ret, &dirfor, diraft_ret, &diraft,
- &mb, &bpos);
+ &mb);
}
return (0);
nfsmout:
@@ -2131,7 +2111,6 @@ nfsrv_mkdir(nfsd, slp, procp, mrq)
caddr_t cp;
u_int32_t *tl;
int32_t t1;
- caddr_t bpos;
int error = 0, len, dirfor_ret = 1, diraft_ret = 1;
int v3 = (nfsd->nd_flag & ND_NFSV3);
char *cp2;
@@ -2159,7 +2138,7 @@ nfsrv_mkdir(nfsd, slp, procp, mrq)
if (error) {
nfsm_reply(NFSX_WCCDATA(v3));
nfsm_srvwcc(nfsd, dirfor_ret, &dirfor, diraft_ret, &diraft,
- &mb, &bpos);
+ &mb);
if (dirp)
vrele(dirp);
return (0);
@@ -2205,10 +2184,10 @@ out:
nfsm_srvpostop_attr(0, &va);
}
nfsm_srvwcc(nfsd, dirfor_ret, &dirfor, diraft_ret, &diraft,
- &mb, &bpos);
+ &mb);
} else {
nfsm_srvfhtom(fhp, v3);
- fp = nfsm_build(&mb, NFSX_V2FATTR, &bpos);
+ fp = nfsm_build(&mb, NFSX_V2FATTR);
nfsm_srvfattr(nfsd, &va, fp);
}
return (0);
@@ -2241,7 +2220,6 @@ nfsrv_rmdir(nfsd, slp, procp, mrq)
struct ucred *cred = &nfsd->nd_cr;
u_int32_t *tl;
int32_t t1;
- caddr_t bpos;
int error = 0, len, dirfor_ret = 1, diraft_ret = 1;
int v3 = (nfsd->nd_flag & ND_NFSV3);
char *cp2;
@@ -2271,7 +2249,7 @@ nfsrv_rmdir(nfsd, slp, procp, mrq)
if (error) {
nfsm_reply(NFSX_WCCDATA(v3));
nfsm_srvwcc(nfsd, dirfor_ret, &dirfor, diraft_ret, &diraft,
- &mb, &bpos);
+ &mb);
if (dirp)
vrele(dirp);
return (0);
@@ -2311,7 +2289,7 @@ out:
nfsm_reply(NFSX_WCCDATA(v3));
if (v3) {
nfsm_srvwcc(nfsd, dirfor_ret, &dirfor, diraft_ret, &diraft,
- &mb, &bpos);
+ &mb);
return (0);
}
nfsmout:
@@ -2368,7 +2346,6 @@ nfsrv_readdir(nfsd, slp, procp, mrq)
struct dirent *dp;
u_int32_t *tl;
int32_t t1;
- caddr_t bpos;
struct mbuf *mb, *mreq;
char *cpos, *cend, *cp2, *rbuf;
struct vnode *vp;
@@ -2476,11 +2453,11 @@ again:
2 * NFSX_UNSIGNED);
if (v3) {
nfsm_srvpostop_attr(getret, &at);
- tl = nfsm_build(&mb, 4 * NFSX_UNSIGNED, &bpos);
+ tl = nfsm_build(&mb, 4 * NFSX_UNSIGNED);
txdr_hyper(at.va_filerev, tl);
tl += 2;
} else
- tl = nfsm_build(&mb, 2 * NFSX_UNSIGNED, &bpos);
+ tl = nfsm_build(&mb, 2 * NFSX_UNSIGNED);
*tl++ = nfs_false;
*tl = nfs_true;
free(rbuf, M_TEMP);
@@ -2514,7 +2491,7 @@ again:
nfsm_reply(NFSX_POSTOPATTR(v3) + NFSX_COOKIEVERF(v3) + siz);
if (v3) {
nfsm_srvpostop_attr(getret, &at);
- tl = nfsm_build(&mb, 2 * NFSX_UNSIGNED, &bpos);
+ tl = nfsm_build(&mb, 2 * NFSX_UNSIGNED);
txdr_hyper(at.va_filerev, tl);
}
@@ -2534,23 +2511,23 @@ again:
* Build the directory record xdr from
* the dirent entry.
*/
- tl = nfsm_build(&mb, 2 * NFSX_UNSIGNED, &bpos);
+ tl = nfsm_build(&mb, 2 * NFSX_UNSIGNED);
*tl++ = nfs_true;
if (v3) {
*tl = 0;
- tl = nfsm_build(&mb, NFSX_UNSIGNED, &bpos);
+ tl = nfsm_build(&mb, NFSX_UNSIGNED);
}
*tl = txdr_unsigned(dp->d_fileno);
/* And copy the name */
- nfsm_strtombuf(&mb, dp->d_name, nlen, &bpos);
+ nfsm_strtombuf(&mb, dp->d_name, nlen);
/* Finish off the record */
if (v3) {
- tl = nfsm_build(&mb, NFSX_UNSIGNED, &bpos);
+ tl = nfsm_build(&mb, NFSX_UNSIGNED);
*tl = 0;
}
- tl = nfsm_build(&mb, NFSX_UNSIGNED, &bpos);
+ tl = nfsm_build(&mb, NFSX_UNSIGNED);
*tl = txdr_unsigned(*cookiep);
}
cpos += dp->d_reclen;
@@ -2559,7 +2536,7 @@ again:
ncookies--;
}
vrele(vp);
- tl = nfsm_build(&mb, 2 * NFSX_UNSIGNED, &bpos);
+ tl = nfsm_build(&mb, 2 * NFSX_UNSIGNED);
*tl++ = nfs_false;
if (eofflag)
*tl = nfs_true;
@@ -2585,7 +2562,6 @@ nfsrv_readdirplus(nfsd, slp, procp, mrq)
struct dirent *dp;
u_int32_t *tl;
int32_t t1;
- caddr_t bpos;
struct mbuf *mb, *mreq;
char *cpos, *cend, *cp2, *rbuf;
struct vnode *vp, *nvp;
@@ -2688,7 +2664,7 @@ again:
nfsm_reply(NFSX_V3POSTOPATTR + NFSX_V3COOKIEVERF +
2 * NFSX_UNSIGNED);
nfsm_srvpostop_attr(getret, &at);
- tl = nfsm_build(&mb, 4 * NFSX_UNSIGNED, &bpos);
+ tl = nfsm_build(&mb, 4 * NFSX_UNSIGNED);
txdr_hyper(at.va_filerev, tl);
tl += 2;
*tl++ = nfs_false;
@@ -2735,7 +2711,7 @@ again:
dirlen = len = NFSX_V3POSTOPATTR + NFSX_V3COOKIEVERF + 2 * NFSX_UNSIGNED;
nfsm_reply(cnt);
nfsm_srvpostop_attr(getret, &at);
- tl = nfsm_build(&mb, 2 * NFSX_UNSIGNED, &bpos);
+ tl = nfsm_build(&mb, 2 * NFSX_UNSIGNED);
txdr_hyper(at.va_filerev, tl);
/* Loop through the records and build reply */
@@ -2788,13 +2764,13 @@ again:
break;
}
- tl = nfsm_build(&mb, 3 * NFSX_UNSIGNED, &bpos);
+ tl = nfsm_build(&mb, 3 * NFSX_UNSIGNED);
*tl++ = nfs_true;
*tl++ = 0;
*tl = txdr_unsigned(dp->d_fileno);
/* And copy the name */
- nfsm_strtombuf(&mb, dp->d_name, nlen, &bpos);
+ nfsm_strtombuf(&mb, dp->d_name, nlen);
/*
* Build the directory record xdr from
@@ -2809,7 +2785,7 @@ again:
fl.fl_off.nfsuquad[1] = txdr_unsigned(*cookiep);
/* Now copy the flrep structure out. */
- nfsm_buftombuf(&mb, &fl, sizeof(struct flrep), &bpos);
+ nfsm_buftombuf(&mb, &fl, sizeof(struct flrep));
}
invalid:
cpos += dp->d_reclen;
@@ -2818,7 +2794,7 @@ invalid:
ncookies--;
}
vrele(vp);
- tl = nfsm_build(&mb, 2 * NFSX_UNSIGNED, &bpos);
+ tl = nfsm_build(&mb, 2 * NFSX_UNSIGNED);
*tl++ = nfs_false;
if (eofflag)
*tl = nfs_true;
@@ -2850,7 +2826,6 @@ nfsrv_commit(nfsd, slp, procp, mrq)
fhandle_t *fhp;
u_int32_t *tl;
int32_t t1;
- caddr_t bpos;
int error = 0, rdonly, for_ret = 1, aft_ret = 1, cnt;
char *cp2;
struct mbuf *mb, *mreq;
@@ -2870,7 +2845,7 @@ nfsrv_commit(nfsd, slp, procp, mrq)
error = nfsrv_fhtovp(fhp, 1, &vp, cred, slp, nam, &rdonly);
if (error) {
nfsm_reply(2 * NFSX_UNSIGNED);
- nfsm_srvwcc(nfsd, for_ret, &bfor, aft_ret, &aft, &mb, &bpos);
+ nfsm_srvwcc(nfsd, for_ret, &bfor, aft_ret, &aft, &mb);
return (0);
}
for_ret = VOP_GETATTR(vp, &bfor, cred, procp);
@@ -2878,9 +2853,9 @@ nfsrv_commit(nfsd, slp, procp, mrq)
aft_ret = VOP_GETATTR(vp, &aft, cred, procp);
vput(vp);
nfsm_reply(NFSX_V3WCCDATA + NFSX_V3WRITEVERF);
- nfsm_srvwcc(nfsd, for_ret, &bfor, aft_ret, &aft, &mb, &bpos);
+ nfsm_srvwcc(nfsd, for_ret, &bfor, aft_ret, &aft, &mb);
if (!error) {
- tl = nfsm_build(&mb, NFSX_V3WRITEVERF, &bpos);
+ tl = nfsm_build(&mb, NFSX_V3WRITEVERF);
*tl++ = txdr_unsigned(boottime.tv_sec);
*tl = txdr_unsigned(boottime.tv_usec);
} else
@@ -2907,7 +2882,6 @@ nfsrv_statfs(nfsd, slp, procp, mrq)
struct nfs_statfs *sfp;
u_int32_t *tl;
int32_t t1;
- caddr_t bpos;
int error = 0, rdonly, getret = 1;
int v3 = (nfsd->nd_flag & ND_NFSV3);
char *cp2;
@@ -2936,7 +2910,7 @@ nfsrv_statfs(nfsd, slp, procp, mrq)
nfsm_srvpostop_attr(getret, &at);
if (error)
return (0);
- sfp = nfsm_build(&mb, NFSX_STATFS(v3), &bpos);
+ sfp = nfsm_build(&mb, NFSX_STATFS(v3));
if (v3) {
tval = (u_quad_t)sf->f_blocks;
tval *= (u_quad_t)sf->f_bsize;
@@ -2981,7 +2955,6 @@ nfsrv_fsinfo(nfsd, slp, procp, mrq)
u_int32_t *tl;
struct nfsv3_fsinfo *sip;
int32_t t1;
- caddr_t bpos;
int error = 0, rdonly, getret = 1, pref;
char *cp2;
struct mbuf *mb, *mreq;
@@ -3002,7 +2975,7 @@ nfsrv_fsinfo(nfsd, slp, procp, mrq)
vput(vp);
nfsm_reply(NFSX_V3POSTOPATTR + NFSX_V3FSINFO);
nfsm_srvpostop_attr(getret, &at);
- sip = nfsm_build(&mb, NFSX_V3FSINFO, &bpos);
+ sip = nfsm_build(&mb, NFSX_V3FSINFO);
/*
* XXX
@@ -3048,7 +3021,6 @@ nfsrv_pathconf(nfsd, slp, procp, mrq)
u_int32_t *tl;
struct nfsv3_pathconf *pc;
int32_t t1;
- caddr_t bpos;
int error = 0, rdonly, getret = 1;
register_t linkmax, namemax, chownres, notrunc;
char *cp2;
@@ -3079,7 +3051,7 @@ nfsrv_pathconf(nfsd, slp, procp, mrq)
nfsm_srvpostop_attr(getret, &at);
if (error)
return (0);
- pc = nfsm_build(&mb, NFSX_V3PATHCONF, &bpos);
+ pc = nfsm_build(&mb, NFSX_V3PATHCONF);
pc->pc_linkmax = txdr_unsigned(linkmax);
pc->pc_namemax = txdr_unsigned(namemax);
@@ -3109,7 +3081,6 @@ nfsrv_null(nfsd, slp, procp, mrq)
struct mbuf **mrq;
{
struct mbuf *mrep = nfsd->nd_mrep;
- caddr_t bpos;
int error = NFSERR_RETVOID;
struct mbuf *mb, *mreq;
@@ -3129,7 +3100,6 @@ nfsrv_noop(nfsd, slp, procp, mrq)
struct mbuf **mrq;
{
struct mbuf *mrep = nfsd->nd_mrep;
- caddr_t bpos;
int error;
struct mbuf *mb, *mreq;
diff --git a/sys/nfs/nfs_socket.c b/sys/nfs/nfs_socket.c
index 0380d3e0cca..87ea9755478 100644
--- a/sys/nfs/nfs_socket.c
+++ b/sys/nfs/nfs_socket.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_socket.c,v 1.60 2008/06/11 04:52:27 blambert Exp $ */
+/* $OpenBSD: nfs_socket.c,v 1.61 2008/06/12 20:24:06 blambert Exp $ */
/* $NetBSD: nfs_socket.c,v 1.27 1996/04/15 20:20:00 thorpej Exp $ */
/*
@@ -1040,18 +1040,16 @@ nfsmout:
* siz arg. is used to decide if adding a cluster is worthwhile
*/
int
-nfs_rephead(siz, nd, slp, err, mrq, mbp, bposp)
+nfs_rephead(siz, nd, slp, err, mrq, mbp)
int siz;
struct nfsrv_descript *nd;
struct nfssvc_sock *slp;
int err;
struct mbuf **mrq;
struct mbuf **mbp;
- caddr_t *bposp;
{
u_int32_t *tl;
struct mbuf *mreq;
- caddr_t bpos;
struct mbuf *mb;
MGETHDR(mreq, M_WAIT, MT_DATA);
@@ -1067,7 +1065,6 @@ nfs_rephead(siz, nd, slp, err, mrq, mbp, bposp)
mreq->m_data += max_hdr;
tl = mtod(mreq, u_int32_t *);
mreq->m_len = 6 * NFSX_UNSIGNED;
- bpos = ((caddr_t)tl) + mreq->m_len;
*tl++ = txdr_unsigned(nd->nd_retxid);
*tl++ = rpc_reply;
if (err == ERPCMISMATCH || (err & NFSERR_AUTHERR)) {
@@ -1076,7 +1073,6 @@ nfs_rephead(siz, nd, slp, err, mrq, mbp, bposp)
*tl++ = rpc_autherr;
*tl = txdr_unsigned(err & ~NFSERR_AUTHERR);
mreq->m_len -= NFSX_UNSIGNED;
- bpos -= NFSX_UNSIGNED;
} else {
*tl++ = rpc_mismatch;
*tl++ = txdr_unsigned(RPC_VER2);
@@ -1109,7 +1105,7 @@ nfs_rephead(siz, nd, slp, err, mrq, mbp, bposp)
*tl++ = rpc_auth_kerb;
*tl++ = txdr_unsigned(3 * NFSX_UNSIGNED);
*tl = ktvout.tv_sec;
- tl = nfsm_build(&mb, 3 * NFSX_UNSIGNED, &bpos);
+ tl = nfsm_build(&mb, 3 * NFSX_UNSIGNED);
*tl++ = ktvout.tv_usec;
*tl++ = txdr_unsigned(nuidp->nu_cr.cr_uid);
} else {
@@ -1126,7 +1122,7 @@ nfs_rephead(siz, nd, slp, err, mrq, mbp, bposp)
break;
case EPROGMISMATCH:
*tl = txdr_unsigned(RPC_PROGMISMATCH);
- tl = nfsm_build(&mb, 2 * NFSX_UNSIGNED, &bpos);
+ tl = nfsm_build(&mb, 2 * NFSX_UNSIGNED);
*tl++ = txdr_unsigned(2);
*tl = txdr_unsigned(3);
break;
@@ -1139,7 +1135,7 @@ nfs_rephead(siz, nd, slp, err, mrq, mbp, bposp)
default:
*tl = 0;
if (err != NFSERR_RETVOID) {
- tl = nfsm_build(&mb, NFSX_UNSIGNED, &bpos);
+ tl = nfsm_build(&mb, NFSX_UNSIGNED);
if (err)
*tl = txdr_unsigned(nfsrv_errmap(nd, err));
else
@@ -1152,7 +1148,6 @@ nfs_rephead(siz, nd, slp, err, mrq, mbp, bposp)
*mrq = mreq;
if (mbp != NULL)
*mbp = mb;
- *bposp = bpos;
if (err != 0 && err != NFSERR_RETVOID)
nfsstats.srvrpc_errs++;
return (0);
diff --git a/sys/nfs/nfs_srvcache.c b/sys/nfs/nfs_srvcache.c
index b4d637a728b..0372f5b15a8 100644
--- a/sys/nfs/nfs_srvcache.c
+++ b/sys/nfs/nfs_srvcache.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_srvcache.c,v 1.17 2008/06/11 04:52:27 blambert Exp $ */
+/* $OpenBSD: nfs_srvcache.c,v 1.18 2008/06/12 20:24:06 blambert Exp $ */
/* $NetBSD: nfs_srvcache.c,v 1.12 1996/02/18 11:53:49 fvdl Exp $ */
/*
@@ -157,7 +157,6 @@ nfsrv_getcache(struct nfsrv_descript *nd, struct nfssvc_sock *slp,
struct nfsrvcache *rp;
struct mbuf *mb;
struct sockaddr_in *saddr;
- caddr_t bpos;
int ret;
/*
@@ -181,8 +180,7 @@ nfsrv_getcache(struct nfsrv_descript *nd, struct nfssvc_sock *slp,
ret = RC_DROPIT;
} else if (rp->rc_flag & RC_REPSTATUS) {
nfsstats.srvcache_nonidemdonehits++;
- nfs_rephead(0, nd, slp, rp->rc_status, repp, &mb,
- &bpos);
+ nfs_rephead(0, nd, slp, rp->rc_status, repp, &mb);
ret = RC_REPLY;
} else if (rp->rc_flag & RC_REPMBUF) {
nfsstats.srvcache_nonidemdonehits++;
diff --git a/sys/nfs/nfs_subs.c b/sys/nfs/nfs_subs.c
index 82de7aa5ae5..2f74a74f212 100644
--- a/sys/nfs/nfs_subs.c
+++ b/sys/nfs/nfs_subs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_subs.c,v 1.78 2008/06/11 08:11:33 thib Exp $ */
+/* $OpenBSD: nfs_subs.c,v 1.79 2008/06/12 20:24:06 blambert Exp $ */
/* $NetBSD: nfs_subs.c,v 1.27.4.3 1996/07/08 20:34:24 jtc Exp $ */
/*
@@ -526,23 +526,19 @@ struct pool nfsreqpl;
* (just used to decide if a cluster is a good idea)
*/
struct mbuf *
-nfsm_reqh(vp, procid, hsiz, bposp)
+nfsm_reqh(vp, procid, hsiz)
struct vnode *vp;
u_long procid;
int hsiz;
- caddr_t *bposp;
{
struct mbuf *mb;
- caddr_t bpos;
MGET(mb, M_WAIT, MT_DATA);
if (hsiz > MLEN)
MCLGET(mb, M_WAIT);
mb->m_len = 0;
- bpos = mtod(mb, caddr_t);
/* Finally, return values */
- *bposp = bpos;
return (mb);
}
@@ -574,7 +570,6 @@ nfsm_rpchead(struct nfsreq *req, struct ucred *cr, int auth_type,
{
struct mbuf *mb;
u_int32_t *tl;
- caddr_t bpos;
int i, authsiz, auth_len, ngroups;
KASSERT(auth_type == RPCAUTH_UNIX);
@@ -611,10 +606,9 @@ nfsm_rpchead(struct nfsreq *req, struct ucred *cr, int auth_type,
}
mb->m_len = 0;
- bpos = mtod(mb, caddr_t);
/* First the RPC header. */
- tl = nfsm_build(&mb, 6 * NFSX_UNSIGNED, &bpos);
+ tl = nfsm_build(&mb, 6 * NFSX_UNSIGNED);
/* Get a new (non-zero) xid */
*tl++ = req->r_xid = nfs_get_xid();
@@ -632,7 +626,7 @@ nfsm_rpchead(struct nfsreq *req, struct ucred *cr, int auth_type,
/* The Authorization cred and its verifier */
switch (auth_type) {
case RPCAUTH_UNIX:
- tl = nfsm_build(&mb, auth_len + 4 * NFSX_UNSIGNED, &bpos);
+ tl = nfsm_build(&mb, auth_len + 4 * NFSX_UNSIGNED);
*tl++ = txdr_unsigned(RPCAUTH_UNIX);
*tl++ = txdr_unsigned(authsiz);
@@ -735,7 +729,7 @@ nfsm_mbuftouio(mrep, uiop, siz, dpos)
* Copy a uio scatter/gather list to an mbuf chain.
*/
void
-nfsm_uiotombuf(struct mbuf **mp, struct uio *uiop, size_t len, caddr_t *bposp)
+nfsm_uiotombuf(struct mbuf **mp, struct uio *uiop, size_t len)
{
struct mbuf *mb, *mb2;
size_t xfer, pad;
@@ -774,7 +768,6 @@ nfsm_uiotombuf(struct mbuf **mp, struct uio *uiop, size_t len, caddr_t *bposp)
mb->m_len += pad;
}
- *bposp = mb_offset(mb);
*mp = mb;
}
@@ -782,7 +775,7 @@ nfsm_uiotombuf(struct mbuf **mp, struct uio *uiop, size_t len, caddr_t *bposp)
* Copy a buffer to an mbuf chain
*/
void
-nfsm_buftombuf(struct mbuf **mp, void *buf, size_t len, caddr_t *bposp)
+nfsm_buftombuf(struct mbuf **mp, void *buf, size_t len)
{
struct iovec iov;
struct uio io;
@@ -796,14 +789,14 @@ nfsm_buftombuf(struct mbuf **mp, void *buf, size_t len, caddr_t *bposp)
io.uio_segflg = UIO_SYSSPACE;
io.uio_rw = UIO_WRITE;
- nfsm_uiotombuf(mp, &io, len, bposp);
+ nfsm_uiotombuf(mp, &io, len);
}
/*
* Copy a string to an mbuf chain
*/
void
-nfsm_strtombuf(struct mbuf **mp, void *str, size_t len, caddr_t *bposp)
+nfsm_strtombuf(struct mbuf **mp, void *str, size_t len)
{
struct iovec iov[2];
struct uio io;
@@ -822,7 +815,7 @@ nfsm_strtombuf(struct mbuf **mp, void *str, size_t len, caddr_t *bposp)
io.uio_segflg = UIO_SYSSPACE;
io.uio_rw = UIO_WRITE;
- nfsm_uiotombuf(mp, &io, io.uio_resid, bposp);
+ nfsm_uiotombuf(mp, &io, io.uio_resid);
}
/*
@@ -1418,24 +1411,22 @@ nfsm_adj(mp, len, nul)
* doesn't get too big...
*/
void
-nfsm_srvwcc(nfsd, before_ret, before_vap, after_ret, after_vap, mbp, bposp)
+nfsm_srvwcc(nfsd, before_ret, before_vap, after_ret, after_vap, mbp)
struct nfsrv_descript *nfsd;
int before_ret;
struct vattr *before_vap;
int after_ret;
struct vattr *after_vap;
struct mbuf **mbp;
- char **bposp;
{
struct mbuf *mb = *mbp;
- char *bpos = *bposp;
u_int32_t *tl;
if (before_ret) {
- tl = nfsm_build(&mb, NFSX_UNSIGNED, &bpos);
+ tl = nfsm_build(&mb, NFSX_UNSIGNED);
*tl = nfs_false;
} else {
- tl = nfsm_build(&mb, 7 * NFSX_UNSIGNED, &bpos);
+ tl = nfsm_build(&mb, 7 * NFSX_UNSIGNED);
*tl++ = nfs_true;
txdr_hyper(before_vap->va_size, tl);
tl += 2;
@@ -1443,35 +1434,31 @@ nfsm_srvwcc(nfsd, before_ret, before_vap, after_ret, after_vap, mbp, bposp)
tl += 2;
txdr_nfsv3time(&(before_vap->va_ctime), tl);
}
- *bposp = bpos;
*mbp = mb;
- nfsm_srvpostopattr(nfsd, after_ret, after_vap, mbp, bposp);
+ nfsm_srvpostopattr(nfsd, after_ret, after_vap, mbp);
}
void
-nfsm_srvpostopattr(nfsd, after_ret, after_vap, mbp, bposp)
+nfsm_srvpostopattr(nfsd, after_ret, after_vap, mbp)
struct nfsrv_descript *nfsd;
int after_ret;
struct vattr *after_vap;
struct mbuf **mbp;
- char **bposp;
{
struct mbuf *mb = *mbp;
- char *bpos = *bposp;
u_int32_t *tl;
struct nfs_fattr *fp;
if (after_ret) {
- tl = nfsm_build(&mb, NFSX_UNSIGNED, &bpos);
+ tl = nfsm_build(&mb, NFSX_UNSIGNED);
*tl = nfs_false;
} else {
- tl = nfsm_build(&mb, NFSX_UNSIGNED + NFSX_V3FATTR, &bpos);
+ tl = nfsm_build(&mb, NFSX_UNSIGNED + NFSX_V3FATTR);
*tl++ = nfs_true;
fp = (struct nfs_fattr *)tl;
nfsm_srvfattr(nfsd, after_vap, fp);
}
*mbp = mb;
- *bposp = bpos;
}
void
@@ -1877,75 +1864,72 @@ nfsrv_setcred(incred, outcred)
* If full is true, set all fields, otherwise just set mode and time fields
*/
void
-nfsm_v3attrbuild(struct mbuf **mp, struct vattr *a, int full, caddr_t *bposp)
+nfsm_v3attrbuild(struct mbuf **mp, struct vattr *a, int full)
{
struct mbuf *mb;
u_int32_t *tl;
- caddr_t bpos;
mb = *mp;
- bpos = *bposp;
if (a->va_mode != (mode_t)VNOVAL) {
- tl = nfsm_build(&mb, 2 * NFSX_UNSIGNED, &bpos);
+ tl = nfsm_build(&mb, 2 * NFSX_UNSIGNED);
*tl++ = nfs_true;
*tl = txdr_unsigned(a->va_mode);
} else {
- tl = nfsm_build(&mb, NFSX_UNSIGNED, &bpos);
+ tl = nfsm_build(&mb, NFSX_UNSIGNED);
*tl = nfs_false;
}
if (full && a->va_uid != (uid_t)VNOVAL) {
- tl = nfsm_build(&mb, 2 * NFSX_UNSIGNED, &bpos);
+ tl = nfsm_build(&mb, 2 * NFSX_UNSIGNED);
*tl++ = nfs_true;
*tl = txdr_unsigned(a->va_uid);
} else {
- tl = nfsm_build(&mb, NFSX_UNSIGNED, &bpos);
+ tl = nfsm_build(&mb, NFSX_UNSIGNED);
*tl = nfs_false;
}
if (full && a->va_gid != (gid_t)VNOVAL) {
- tl = nfsm_build(&mb, 2 * NFSX_UNSIGNED, &bpos);
+ tl = nfsm_build(&mb, 2 * NFSX_UNSIGNED);
*tl++ = nfs_true;
*tl = txdr_unsigned((a)->va_gid);
} else {
- tl = nfsm_build(&mb, NFSX_UNSIGNED, &bpos);
+ tl = nfsm_build(&mb, NFSX_UNSIGNED);
*tl = nfs_false;
}
if (full && a->va_size != VNOVAL) {
- tl = nfsm_build(&mb, 3 * NFSX_UNSIGNED, &bpos);
+ tl = nfsm_build(&mb, 3 * NFSX_UNSIGNED);
*tl++ = nfs_true;
txdr_hyper(a->va_size, tl);
} else {
- tl = nfsm_build(&mb, NFSX_UNSIGNED, &bpos);
+ tl = nfsm_build(&mb, NFSX_UNSIGNED);
*tl = nfs_false;
}
if (a->va_atime.tv_sec != VNOVAL) {
if (a->va_atime.tv_sec != time_second) {
- tl = nfsm_build(&mb, 3 * NFSX_UNSIGNED, &bpos);
+ tl = nfsm_build(&mb, 3 * NFSX_UNSIGNED);
*tl++ = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT);
txdr_nfsv3time(&a->va_atime, tl);
} else {
- tl = nfsm_build(&mb, NFSX_UNSIGNED, &bpos);
+ tl = nfsm_build(&mb, NFSX_UNSIGNED);
*tl = txdr_unsigned(NFSV3SATTRTIME_TOSERVER);
}
} else {
- tl = nfsm_build(&mb, NFSX_UNSIGNED, &bpos);
+ tl = nfsm_build(&mb, NFSX_UNSIGNED);
*tl = txdr_unsigned(NFSV3SATTRTIME_DONTCHANGE);
}
if (a->va_mtime.tv_sec != VNOVAL) {
if (a->va_mtime.tv_sec != time_second) {
- tl = nfsm_build(&mb, 3 * NFSX_UNSIGNED, &bpos);
+ tl = nfsm_build(&mb, 3 * NFSX_UNSIGNED);
*tl++ = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT);
txdr_nfsv3time(&a->va_mtime, tl);
} else {
- tl = nfsm_build(&mb, NFSX_UNSIGNED, &bpos);
+ tl = nfsm_build(&mb, NFSX_UNSIGNED);
*tl = txdr_unsigned(NFSV3SATTRTIME_TOSERVER);
}
} else {
- tl = nfsm_build(&mb, NFSX_UNSIGNED, &bpos);
+ tl = nfsm_build(&mb, NFSX_UNSIGNED);
*tl = txdr_unsigned(NFSV3SATTRTIME_DONTCHANGE);
}
- *bposp = bpos;
*mp = mb;
}
@@ -1953,13 +1937,13 @@ nfsm_v3attrbuild(struct mbuf **mp, struct vattr *a, int full, caddr_t *bposp)
* Ensure a contiguous buffer len bytes long
*/
void *
-nfsm_build(struct mbuf **mp, u_int len, caddr_t *bposp)
+nfsm_build(struct mbuf **mp, u_int len)
{
struct mbuf *mb, *mb2;
caddr_t bpos;
mb = *mp;
- bpos = *bposp;
+ bpos = mb_offset(mb);
if (len > M_TRAILINGSPACE(mb)) {
MGET(mb2, M_WAIT, MT_DATA);
@@ -1972,7 +1956,6 @@ nfsm_build(struct mbuf **mp, u_int len, caddr_t *bposp)
}
mb->m_len += len;
- *bposp = bpos + len;
*mp = mb;
return (bpos);
diff --git a/sys/nfs/nfs_var.h b/sys/nfs/nfs_var.h
index e6a6f8ca527..5ad0fd7f526 100644
--- a/sys/nfs/nfs_var.h
+++ b/sys/nfs/nfs_var.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_var.h,v 1.38 2008/06/10 22:59:09 thib Exp $ */
+/* $OpenBSD: nfs_var.h,v 1.39 2008/06/12 20:24:06 blambert Exp $ */
/* $NetBSD: nfs_var.h,v 1.3 1996/02/18 11:53:54 fvdl Exp $ */
/*
@@ -214,7 +214,7 @@ int nfs_request(struct vnode *, struct mbuf *, int, struct proc *,
struct ucred *, struct mbuf **, struct mbuf **,
caddr_t *);
int nfs_rephead(int, struct nfsrv_descript *, struct nfssvc_sock *, int,
- struct mbuf **, struct mbuf **, caddr_t *);
+ struct mbuf **, struct mbuf **);
void nfs_timer(void *);
int nfs_sigintr(struct nfsmount *, struct nfsreq *, struct proc *);
int nfs_sndlock(int *, struct nfsreq *);
@@ -237,14 +237,14 @@ void nfsrv_updatecache(struct nfsrv_descript *, int, struct mbuf *);
void nfsrv_cleancache(void);
/* nfs_subs.c */
-struct mbuf *nfsm_reqh(struct vnode *, u_long, int, caddr_t *);
+struct mbuf *nfsm_reqh(struct vnode *, u_long, int);
u_int32_t nfs_get_xid(void);
void nfsm_rpchead(struct nfsreq *, struct ucred *, int, struct mbuf *, int);
-void *nfsm_build(struct mbuf **, u_int, caddr_t *);
+void *nfsm_build(struct mbuf **, u_int);
int nfsm_mbuftouio(struct mbuf **, struct uio *, int, caddr_t *);
-void nfsm_uiotombuf(struct mbuf **, struct uio *, size_t, caddr_t *);
-void nfsm_strtombuf(struct mbuf **, void *, size_t, caddr_t *);
-void nfsm_buftombuf(struct mbuf **, void *, size_t, caddr_t *);
+void nfsm_uiotombuf(struct mbuf **, struct uio *, size_t);
+void nfsm_strtombuf(struct mbuf **, void *, size_t);
+void nfsm_buftombuf(struct mbuf **, void *, size_t);
int nfsm_disct(struct mbuf **, caddr_t *, int, int, caddr_t *);
int nfs_adv(struct mbuf **, caddr_t *, int, int);
int nfsm_strtmbuf(struct mbuf **, char **, char *, long);
@@ -256,12 +256,12 @@ int nfs_getattrcache(struct vnode *, struct vattr *);
int nfs_namei(struct nameidata *, fhandle_t *, int, struct nfssvc_sock *,
struct mbuf *, struct mbuf **, caddr_t *, struct vnode **,
struct proc *);
-void nfsm_v3attrbuild(struct mbuf **, struct vattr *, int, caddr_t *);
+void nfsm_v3attrbuild(struct mbuf **, struct vattr *, int);
void nfsm_adj(struct mbuf *, int, int);
void nfsm_srvwcc(struct nfsrv_descript *, int, struct vattr *, int,
- struct vattr *, struct mbuf **, char **);
+ struct vattr *, struct mbuf **);
void nfsm_srvpostopattr(struct nfsrv_descript *, int, struct vattr *,
- struct mbuf **, char **);
+ struct mbuf **);
void nfsm_srvfattr(struct nfsrv_descript *, struct vattr *,
struct nfs_fattr *);
int nfsrv_fhtovp(fhandle_t *, int, struct vnode **, struct ucred *,
diff --git a/sys/nfs/nfs_vfsops.c b/sys/nfs/nfs_vfsops.c
index bed19e20aac..86e90cddc9d 100644
--- a/sys/nfs/nfs_vfsops.c
+++ b/sys/nfs/nfs_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_vfsops.c,v 1.73 2008/06/11 04:52:27 blambert Exp $ */
+/* $OpenBSD: nfs_vfsops.c,v 1.74 2008/06/12 20:24:06 blambert Exp $ */
/* $NetBSD: nfs_vfsops.c,v 1.46.4.1 1996/05/25 22:40:35 fvdl Exp $ */
/*
@@ -114,7 +114,7 @@ nfs_statfs(mp, sbp, p)
caddr_t cp;
u_int32_t *tl;
int32_t t1;
- caddr_t bpos, dpos, cp2;
+ caddr_t dpos, cp2;
struct nfsmount *nmp = VFSTONFS(mp);
int error = 0, v3 = (nmp->nm_flag & NFSMNT_NFSV3), retattr;
struct mbuf *mreq, *mrep = NULL, *md, *mb;
@@ -189,7 +189,7 @@ nfs_fsinfo(nmp, vp, cred, p)
caddr_t cp;
int32_t t1;
u_int32_t *tl, pref, max;
- caddr_t bpos, dpos, cp2;
+ caddr_t dpos, cp2;
int error = 0, retattr;
struct mbuf *mreq, *mrep, *md, *mb;
diff --git a/sys/nfs/nfs_vnops.c b/sys/nfs/nfs_vnops.c
index 8b32df4b9bf..870463e3136 100644
--- a/sys/nfs/nfs_vnops.c
+++ b/sys/nfs/nfs_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_vnops.c,v 1.89 2008/06/12 06:58:40 deraadt Exp $ */
+/* $OpenBSD: nfs_vnops.c,v 1.90 2008/06/12 20:24:06 blambert Exp $ */
/* $NetBSD: nfs_vnops.c,v 1.62.4.1 1996/07/08 20:26:52 jtc Exp $ */
/*
@@ -216,7 +216,7 @@ nfs_null(vp, cred, procp)
struct ucred *cred;
struct proc *procp;
{
- caddr_t bpos, dpos;
+ caddr_t dpos;
int error = 0;
struct mbuf *mreq, *mrep, *md, *mb;
@@ -242,7 +242,7 @@ nfs_access(v)
u_int32_t *tl;
caddr_t cp;
int32_t t1;
- caddr_t bpos, dpos, cp2;
+ caddr_t dpos, cp2;
int error = 0, attrflag;
struct mbuf *mreq, *mrep, *md, *mb;
u_int32_t mode, rmode;
@@ -295,7 +295,7 @@ nfs_access(v)
nfsstats.rpccnt[NFSPROC_ACCESS]++;
nfsm_reqhead(vp, NFSPROC_ACCESS, NFSX_FH(v3) + NFSX_UNSIGNED);
nfsm_fhtom(vp, v3);
- tl = nfsm_build(&mb, NFSX_UNSIGNED, &bpos);
+ tl = nfsm_build(&mb, NFSX_UNSIGNED);
if (ap->a_mode & VREAD)
mode = NFSV3ACCESS_READ;
else
@@ -496,7 +496,7 @@ nfs_getattr(v)
struct nfsnode *np = VTONFS(vp);
caddr_t cp;
int32_t t1;
- caddr_t bpos, dpos;
+ caddr_t dpos;
int error = 0;
struct mbuf *mreq, *mrep, *md, *mb;
int v3 = NFS_ISV3(vp);
@@ -615,7 +615,7 @@ nfs_setattrrpc(vp, vap, cred, procp)
struct nfsv2_sattr *sp;
caddr_t cp;
int32_t t1;
- caddr_t bpos, dpos, cp2;
+ caddr_t dpos, cp2;
u_int32_t *tl;
int error = 0, wccflag = NFSV3_WCCRATTR;
struct mbuf *mreq, *mrep, *md, *mb;
@@ -625,11 +625,11 @@ nfs_setattrrpc(vp, vap, cred, procp)
nfsm_reqhead(vp, NFSPROC_SETATTR, NFSX_FH(v3) + NFSX_SATTR(v3));
nfsm_fhtom(vp, v3);
if (v3) {
- nfsm_v3attrbuild(&mb, vap, TRUE, &bpos);
- tl = nfsm_build(&mb, NFSX_UNSIGNED, &bpos);
+ nfsm_v3attrbuild(&mb, vap, TRUE);
+ tl = nfsm_build(&mb, NFSX_UNSIGNED);
*tl = nfs_false;
} else {
- sp = nfsm_build(&mb, NFSX_V2SATTR, &bpos);
+ sp = nfsm_build(&mb, NFSX_V2SATTR);
if (vap->va_mode == (mode_t)VNOVAL)
sp->sa_mode = nfs_xdrneg1;
else
@@ -676,7 +676,7 @@ nfs_lookup(v)
caddr_t cp;
int32_t t1;
struct nfsmount *nmp;
- caddr_t bpos, dpos, cp2;
+ caddr_t dpos, cp2;
struct mbuf *mreq, *mrep, *md, *mb;
long len;
nfsfh_t *fhp;
@@ -955,7 +955,7 @@ nfs_readlinkrpc(vp, uiop, cred)
u_int32_t *tl;
caddr_t cp;
int32_t t1;
- caddr_t bpos, dpos, cp2;
+ caddr_t dpos, cp2;
int error = 0, len, attrflag;
struct mbuf *mreq, *mrep, *md, *mb;
int v3 = NFS_ISV3(vp);
@@ -987,7 +987,7 @@ nfs_readrpc(vp, uiop)
u_int32_t *tl;
caddr_t cp;
int32_t t1;
- caddr_t bpos, dpos, cp2;
+ caddr_t dpos, cp2;
struct mbuf *mreq, *mrep, *md, *mb;
struct nfsmount *nmp;
int error = 0, len, retlen, tsiz, eof, attrflag;
@@ -1005,7 +1005,7 @@ nfs_readrpc(vp, uiop)
len = (tsiz > nmp->nm_rsize) ? nmp->nm_rsize : tsiz;
nfsm_reqhead(vp, NFSPROC_READ, NFSX_FH(v3) + NFSX_UNSIGNED * 3);
nfsm_fhtom(vp, v3);
- tl = nfsm_build(&mb, NFSX_UNSIGNED * 3, &bpos);
+ tl = nfsm_build(&mb, NFSX_UNSIGNED * 3);
if (v3) {
txdr_hyper(uiop->uio_offset, tl);
*(tl + 2) = txdr_unsigned(len);
@@ -1052,7 +1052,7 @@ nfs_writerpc(vp, uiop, iomode, must_commit)
u_int32_t *tl;
caddr_t cp;
int32_t t1, backup;
- caddr_t bpos, dpos, cp2;
+ caddr_t dpos, cp2;
struct mbuf *mreq, *mrep, *md, *mb;
struct nfsmount *nmp = VFSTONFS(vp->v_mount);
int error = 0, len, tsiz, wccflag = NFSV3_WCCRATTR, rlen, commit;
@@ -1073,7 +1073,7 @@ nfs_writerpc(vp, uiop, iomode, must_commit)
NFSX_FH(v3) + 5 * NFSX_UNSIGNED + nfsm_rndup(len));
nfsm_fhtom(vp, v3);
if (v3) {
- tl = nfsm_build(&mb, 5 * NFSX_UNSIGNED, &bpos);
+ tl = nfsm_build(&mb, 5 * NFSX_UNSIGNED);
txdr_hyper(uiop->uio_offset, tl);
tl += 2;
*tl++ = txdr_unsigned(len);
@@ -1082,7 +1082,7 @@ nfs_writerpc(vp, uiop, iomode, must_commit)
} else {
u_int32_t x;
- tl = nfsm_build(&mb, 4 * NFSX_UNSIGNED, &bpos);
+ tl = nfsm_build(&mb, 4 * NFSX_UNSIGNED);
/* Set both "begin" and "current" to non-garbage. */
x = txdr_unsigned((u_int32_t)uiop->uio_offset);
*tl++ = x; /* "begin offset" */
@@ -1092,7 +1092,7 @@ nfs_writerpc(vp, uiop, iomode, must_commit)
*tl = x; /* size of this write */
}
- nfsm_uiotombuf(&mb, uiop, len, &bpos);
+ nfsm_uiotombuf(&mb, uiop, len);
nfsm_request(vp, NFSPROC_WRITE, uiop->uio_procp,
VTONFS(vp)->n_wcred);
if (v3) {
@@ -1168,7 +1168,7 @@ nfs_mknodrpc(dvp, vpp, cnp, vap)
struct vnode *newvp = (struct vnode *)0;
struct nfsnode *np;
char *cp2;
- caddr_t bpos, dpos;
+ caddr_t dpos;
int error = 0, wccflag = NFSV3_WCCRATTR, gotvp = 0;
struct mbuf *mreq, *mrep, *md, *mb;
u_int32_t rdev;
@@ -1189,16 +1189,16 @@ nfs_mknodrpc(dvp, vpp, cnp, vap)
nfsm_fhtom(dvp, v3);
nfsm_strtom(cnp->cn_nameptr, cnp->cn_namelen, NFS_MAXNAMLEN);
if (v3) {
- tl = nfsm_build(&mb, NFSX_UNSIGNED, &bpos);
+ tl = nfsm_build(&mb, NFSX_UNSIGNED);
*tl++ = vtonfsv3_type(vap->va_type);
- nfsm_v3attrbuild(&mb, vap, FALSE, &bpos);
+ nfsm_v3attrbuild(&mb, vap, FALSE);
if (vap->va_type == VCHR || vap->va_type == VBLK) {
- tl = nfsm_build(&mb, 2 * NFSX_UNSIGNED, &bpos);
+ tl = nfsm_build(&mb, 2 * NFSX_UNSIGNED);
*tl++ = txdr_unsigned(major(vap->va_rdev));
*tl = txdr_unsigned(minor(vap->va_rdev));
}
} else {
- sp = nfsm_build(&mb, NFSX_V2SATTR, &bpos);
+ sp = nfsm_build(&mb, NFSX_V2SATTR);
sp->sa_mode = vtonfsv2_mode(vap->va_type, vap->va_mode);
sp->sa_uid = nfs_xdrneg1;
sp->sa_gid = nfs_xdrneg1;
@@ -1280,7 +1280,7 @@ nfs_create(v)
int32_t t1;
struct nfsnode *np = (struct nfsnode *)0;
struct vnode *newvp = (struct vnode *)0;
- caddr_t bpos, dpos, cp2;
+ caddr_t dpos, cp2;
int error = 0, wccflag = NFSV3_WCCRATTR, gotvp = 0, fmode = 0;
struct mbuf *mreq, *mrep, *md, *mb;
int v3 = NFS_ISV3(dvp);
@@ -1302,10 +1302,10 @@ again:
nfsm_fhtom(dvp, v3);
nfsm_strtom(cnp->cn_nameptr, cnp->cn_namelen, NFS_MAXNAMLEN);
if (v3) {
- tl = nfsm_build(&mb, NFSX_UNSIGNED, &bpos);
+ tl = nfsm_build(&mb, NFSX_UNSIGNED);
if (fmode & O_EXCL) {
*tl = txdr_unsigned(NFSV3CREATE_EXCLUSIVE);
- tl = nfsm_build(&mb, NFSX_V3CREATEVERF, &bpos);
+ tl = nfsm_build(&mb, NFSX_V3CREATEVERF);
if (TAILQ_FIRST(&in_ifaddr))
*tl++ = TAILQ_FIRST(&in_ifaddr)->ia_addr.sin_addr.s_addr;
else
@@ -1313,10 +1313,10 @@ again:
*tl = ++create_verf;
} else {
*tl = txdr_unsigned(NFSV3CREATE_UNCHECKED);
- nfsm_v3attrbuild(&mb, vap, FALSE, &bpos);
+ nfsm_v3attrbuild(&mb, vap, FALSE);
}
} else {
- sp = nfsm_build(&mb, NFSX_V2SATTR, &bpos);
+ sp = nfsm_build(&mb, NFSX_V2SATTR);
sp->sa_mode = vtonfsv2_mode(vap->va_type, vap->va_mode);
sp->sa_uid = nfs_xdrneg1;
sp->sa_gid = nfs_xdrneg1;
@@ -1463,7 +1463,7 @@ nfs_removerpc(dvp, name, namelen, cred, proc)
u_int32_t *tl;
caddr_t cp;
int32_t t1;
- caddr_t bpos, dpos, cp2;
+ caddr_t dpos, cp2;
int error = 0, wccflag = NFSV3_WCCRATTR;
struct mbuf *mreq, *mrep, *md, *mb;
int v3 = NFS_ISV3(dvp);
@@ -1582,7 +1582,7 @@ nfs_renamerpc(fdvp, fnameptr, fnamelen, tdvp, tnameptr, tnamelen, cred, proc)
u_int32_t *tl;
caddr_t cp;
int32_t t1;
- caddr_t bpos, dpos, cp2;
+ caddr_t dpos, cp2;
int error = 0, fwccflag = NFSV3_WCCRATTR, twccflag = NFSV3_WCCRATTR;
struct mbuf *mreq, *mrep, *md, *mb;
int v3 = NFS_ISV3(fdvp);
@@ -1625,7 +1625,7 @@ nfs_link(v)
u_int32_t *tl;
caddr_t cp;
int32_t t1;
- caddr_t bpos, dpos, cp2;
+ caddr_t dpos, cp2;
int error = 0, wccflag = NFSV3_WCCRATTR, attrflag = 0;
struct mbuf *mreq, *mrep, *md, *mb;
int v3;
@@ -1688,7 +1688,7 @@ nfs_symlink(v)
u_int32_t *tl;
caddr_t cp;
int32_t t1;
- caddr_t bpos, dpos, cp2;
+ caddr_t dpos, cp2;
int slen, error = 0, wccflag = NFSV3_WCCRATTR, gotvp;
struct mbuf *mreq, *mrep, *md, *mb;
struct vnode *newvp = (struct vnode *)0;
@@ -1701,10 +1701,10 @@ nfs_symlink(v)
nfsm_fhtom(dvp, v3);
nfsm_strtom(cnp->cn_nameptr, cnp->cn_namelen, NFS_MAXNAMLEN);
if (v3)
- nfsm_v3attrbuild(&mb, vap, FALSE, &bpos);
+ nfsm_v3attrbuild(&mb, vap, FALSE);
nfsm_strtom(ap->a_target, slen, NFS_MAXPATHLEN);
if (!v3) {
- sp = nfsm_build(&mb, NFSX_V2SATTR, &bpos);
+ sp = nfsm_build(&mb, NFSX_V2SATTR);
sp->sa_mode = vtonfsv2_mode(VLNK, vap->va_mode);
sp->sa_uid = nfs_xdrneg1;
sp->sa_gid = nfs_xdrneg1;
@@ -1749,7 +1749,7 @@ nfs_mkdir(v)
int len;
struct nfsnode *np = (struct nfsnode *)0;
struct vnode *newvp = (struct vnode *)0;
- caddr_t bpos, dpos, cp2;
+ caddr_t dpos, cp2;
int error = 0, wccflag = NFSV3_WCCRATTR;
int gotvp = 0;
struct mbuf *mreq, *mrep, *md, *mb;
@@ -1762,9 +1762,9 @@ nfs_mkdir(v)
nfsm_fhtom(dvp, v3);
nfsm_strtom(cnp->cn_nameptr, len, NFS_MAXNAMLEN);
if (v3) {
- nfsm_v3attrbuild(&mb, vap, FALSE, &bpos);
+ nfsm_v3attrbuild(&mb, vap, FALSE);
} else {
- sp = nfsm_build(&mb, NFSX_V2SATTR, &bpos);
+ sp = nfsm_build(&mb, NFSX_V2SATTR);
sp->sa_mode = vtonfsv2_mode(VDIR, vap->va_mode);
sp->sa_uid = nfs_xdrneg1;
sp->sa_gid = nfs_xdrneg1;
@@ -1820,7 +1820,7 @@ nfs_rmdir(v)
u_int32_t *tl;
caddr_t cp;
int32_t t1;
- caddr_t bpos, dpos, cp2;
+ caddr_t dpos, cp2;
int error = 0, wccflag = NFSV3_WCCRATTR;
struct mbuf *mreq, *mrep, *md, *mb;
int v3 = NFS_ISV3(dvp);
@@ -2044,7 +2044,7 @@ nfs_readdirrpc(struct vnode *vp,
u_int32_t *tl;
caddr_t cp;
int32_t t1;
- caddr_t bpos, dpos, cp2;
+ caddr_t dpos, cp2;
struct mbuf *mreq, *mrep, *md, *mb;
nfsuint64 cookie;
struct nfsmount *nmp = VFSTONFS(vp->v_mount);
@@ -2073,7 +2073,7 @@ nfs_readdirrpc(struct vnode *vp,
NFSX_READDIR(v3));
nfsm_fhtom(vp, v3);
if (v3) {
- tl = nfsm_build(&mb, 5 * NFSX_UNSIGNED, &bpos);
+ tl = nfsm_build(&mb, 5 * NFSX_UNSIGNED);
*tl++ = cookie.nfsuquad[0];
*tl++ = cookie.nfsuquad[1];
if (cookie.nfsuquad[0] == 0 &&
@@ -2085,7 +2085,7 @@ nfs_readdirrpc(struct vnode *vp,
*tl++ = dnp->n_cookieverf.nfsuquad[1];
}
} else {
- tl = nfsm_build(&mb, 2 * NFSX_UNSIGNED, &bpos);
+ tl = nfsm_build(&mb, 2 * NFSX_UNSIGNED);
*tl++ = cookie.nfsuquad[1];
}
*tl = txdr_unsigned(nmp->nm_readdirsize);
@@ -2229,7 +2229,7 @@ nfs_readdirplusrpc(struct vnode *vp, struct uio *uiop, struct ucred *cred,
caddr_t cp;
int32_t t1;
struct vnode *newvp;
- caddr_t bpos, dpos, cp2, dpossav1, dpossav2;
+ caddr_t dpos, cp2, dpossav1, dpossav2;
struct mbuf *mreq, *mrep, *md, *mb, *mdsav1, *mdsav2;
struct nameidata nami, *ndp = &nami;
struct componentname *cnp = &ndp->ni_cnd;
@@ -2261,7 +2261,7 @@ nfs_readdirplusrpc(struct vnode *vp, struct uio *uiop, struct ucred *cred,
nfsm_reqhead(vp, NFSPROC_READDIRPLUS,
NFSX_FH(1) + 6 * NFSX_UNSIGNED);
nfsm_fhtom(vp, 1);
- tl = nfsm_build(&mb, 6 * NFSX_UNSIGNED, &bpos);
+ tl = nfsm_build(&mb, 6 * NFSX_UNSIGNED);
*tl++ = cookie.nfsuquad[0];
*tl++ = cookie.nfsuquad[1];
if (cookie.nfsuquad[0] == 0 &&
@@ -2520,7 +2520,7 @@ nfs_lookitup(dvp, name, len, cred, procp, npp)
int32_t t1;
struct vnode *newvp = (struct vnode *)0;
struct nfsnode *np, *dnp = VTONFS(dvp);
- caddr_t bpos, dpos, cp2;
+ caddr_t dpos, cp2;
int error = 0, fhlen, attrflag;
struct mbuf *mreq, *mrep, *md, *mb;
nfsfh_t *nfhp;
@@ -2591,7 +2591,7 @@ nfs_commit(vp, offset, cnt, procp)
u_int32_t *tl;
int32_t t1;
struct nfsmount *nmp = VFSTONFS(vp->v_mount);
- caddr_t bpos, dpos, cp2;
+ caddr_t dpos, cp2;
int error = 0, wccflag = NFSV3_WCCRATTR;
struct mbuf *mreq, *mrep, *md, *mb;
@@ -2600,7 +2600,7 @@ nfs_commit(vp, offset, cnt, procp)
nfsstats.rpccnt[NFSPROC_COMMIT]++;
nfsm_reqhead(vp, NFSPROC_COMMIT, NFSX_FH(1));
nfsm_fhtom(vp, 1);
- tl = nfsm_build(&mb, 3 * NFSX_UNSIGNED, &bpos);
+ tl = nfsm_build(&mb, 3 * NFSX_UNSIGNED);
txdr_hyper(offset, tl);
tl += 2;
*tl = txdr_unsigned(cnt);
diff --git a/sys/nfs/nfsm_subs.h b/sys/nfs/nfsm_subs.h
index ad3712f2452..39b7bbf49dc 100644
--- a/sys/nfs/nfsm_subs.h
+++ b/sys/nfs/nfsm_subs.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfsm_subs.h,v 1.26 2008/05/27 19:06:28 blambert Exp $ */
+/* $OpenBSD: nfsm_subs.h,v 1.27 2008/06/12 20:24:06 blambert Exp $ */
/* $NetBSD: nfsm_subs.h,v 1.10 1996/03/20 21:59:56 fvdl Exp $ */
/*
@@ -84,24 +84,24 @@
#define nfsm_fhtom(v, v3) \
{ if (v3) { \
nfsm_strtombuf(&mb, VTONFS(v)->n_fhp, \
- VTONFS(v)->n_fhsize, &bpos); \
+ VTONFS(v)->n_fhsize); \
} else { \
- cp = nfsm_build(&mb, NFSX_V2FH, &bpos); \
+ cp = nfsm_build(&mb, NFSX_V2FH); \
bcopy((caddr_t)VTONFS(v)->n_fhp, cp, NFSX_V2FH); \
} }
#define nfsm_srvfhtom(f, v3) \
{ if (v3) { \
- tl = nfsm_build(&mb, NFSX_UNSIGNED + NFSX_V3FH,&bpos); \
+ tl = nfsm_build(&mb, NFSX_UNSIGNED + NFSX_V3FH); \
*tl++ = txdr_unsigned(NFSX_V3FH); \
bcopy((caddr_t)(f), (caddr_t)tl, NFSX_V3FH); \
} else { \
- cp = nfsm_build(&mb, NFSX_V2FH, &bpos); \
+ cp = nfsm_build(&mb, NFSX_V2FH); \
bcopy((caddr_t)(f), cp, NFSX_V2FH); \
} }
#define nfsm_srvpostop_fh(f) \
- { tl = nfsm_build(&mb, 2 * NFSX_UNSIGNED + NFSX_V3FH, &bpos); \
+ { tl = nfsm_build(&mb, 2 * NFSX_UNSIGNED + NFSX_V3FH); \
*tl++ = nfs_true; \
*tl++ = txdr_unsigned(NFSX_V3FH); \
bcopy((caddr_t)(f), (caddr_t)tl, NFSX_V3FH); \
@@ -225,7 +225,7 @@
}
#define nfsm_reqhead(v,a,s) \
- mb = mreq = nfsm_reqh((v),(a),(s),&bpos)
+ mb = mreq = nfsm_reqh((v),(a),(s))
#define nfsm_rndup(a) (((a)+3)&(~0x3))
@@ -244,17 +244,17 @@
error = ENAMETOOLONG; \
goto nfsmout; \
} \
- nfsm_strtombuf(&mb, (a), (s), &bpos)
+ nfsm_strtombuf(&mb, (a), (s))
#define nfsm_reply(s) \
{ \
nfsd->nd_repstat = error; \
if (error && !(nfsd->nd_flag & ND_NFSV3)) \
(void) nfs_rephead(0, nfsd, slp, error, \
- mrq, &mb, &bpos); \
+ mrq, &mb); \
else \
(void) nfs_rephead((s), nfsd, slp, error, \
- mrq, &mb, &bpos); \
+ mrq, &mb); \
if (mrep != NULL) { \
m_freem(mrep); \
mrep = NULL; \
@@ -270,10 +270,10 @@
nfsd->nd_repstat = error; \
if (error && !(v3)) \
(void) nfs_rephead(0, nfsd, slp, error, \
- &mreq, &mb, &bpos); \
+ &mreq, &mb); \
else \
(void) nfs_rephead((s), nfsd, slp, error, \
- &mreq, &mb, &bpos); \
+ &mreq, &mb); \
}
#define nfsm_adv(s) \
@@ -301,7 +301,7 @@
}
#define nfsm_srvpostop_attr(r, a) \
- nfsm_srvpostopattr(nfsd, (r), (a), &mb, &bpos)
+ nfsm_srvpostopattr(nfsd, (r), (a), &mb)
#define nfsm_srvsattr(a) \
{ nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \