summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/nfs/nfs_common.c8
-rw-r--r--sys/nfs/nfs_common.h9
-rw-r--r--sys/nfsclient/nfs_subs.c40
-rw-r--r--sys/nfsclient/nfs_vnops.c36
-rw-r--r--sys/nfsserver/nfs_serv.c48
-rw-r--r--sys/nfsserver/nfs_srvsock.c4
-rw-r--r--sys/nfsserver/nfs_srvsubs.c16
7 files changed, 81 insertions, 80 deletions
diff --git a/sys/nfs/nfs_common.c b/sys/nfs/nfs_common.c
index d51edc5..5635945 100644
--- a/sys/nfs/nfs_common.c
+++ b/sys/nfs/nfs_common.c
@@ -245,10 +245,11 @@ nfs_adv(struct mbuf **mdp, caddr_t *dposp, int offs, int left)
return (0);
}
-void
-nfsm_build_xx(void **a, int s, struct mbuf **mb, caddr_t *bpos)
+void *
+nfsm_build_xx(int s, struct mbuf **mb, caddr_t *bpos)
{
struct mbuf *mb2;
+ void *ret;
if (s > M_TRAILINGSPACE(*mb)) {
MGET(mb2, M_TRYWAIT, MT_DATA);
@@ -259,9 +260,10 @@ nfsm_build_xx(void **a, int s, struct mbuf **mb, caddr_t *bpos)
(*mb)->m_len = 0;
*bpos = mtod(*mb, caddr_t);
}
- *a = *bpos;
+ ret = *bpos;
(*mb)->m_len += s;
*bpos += s;
+ return ret;
}
int
diff --git a/sys/nfs/nfs_common.h b/sys/nfs/nfs_common.h
index 825ab35..c43dd3e 100644
--- a/sys/nfs/nfs_common.h
+++ b/sys/nfs/nfs_common.h
@@ -56,7 +56,7 @@ extern nfstype nfsv3_type[];
} while (0)
int nfs_adv(struct mbuf **, caddr_t *, int, int);
-void nfsm_build_xx(void **a, int s, struct mbuf **mb, caddr_t *bpos);
+void *nfsm_build_xx(int s, struct mbuf **mb, caddr_t *bpos);
int nfsm_dissect_xx(void **a, int s, struct mbuf **md, caddr_t *dpos);
int nfsm_strsiz_xx(int *s, int m, u_int32_t **tl, struct mbuf **mb,
caddr_t *bpos);
@@ -64,11 +64,8 @@ int nfsm_adv_xx(int s, u_int32_t **tl, struct mbuf **md, caddr_t *dpos);
u_quad_t nfs_curusec(void);
int nfsm_disct(struct mbuf **, caddr_t *, int, int, caddr_t *);
-#define nfsm_build(a, c, s) \
-do { \
- nfsm_build_xx((void **)&(a), (s), &mb, &bpos); \
-} while (0)
-
+#define nfsm_build(c, s) \
+ (c)nfsm_build_xx((s), &mb, &bpos); \
/* XXX 'c' arg (type) is not used */
#define nfsm_dissect(a, c, s) \
diff --git a/sys/nfsclient/nfs_subs.c b/sys/nfsclient/nfs_subs.c
index cd47a0a..2536b17 100644
--- a/sys/nfsclient/nfs_subs.c
+++ b/sys/nfsclient/nfs_subs.c
@@ -183,7 +183,7 @@ nfsm_rpchead(struct ucred *cr, int nmflag, int procid, int auth_type,
/*
* First the RPC header.
*/
- nfsm_build(tl, u_int32_t *, 8 * NFSX_UNSIGNED);
+ tl = nfsm_build(u_int32_t *, 8 * NFSX_UNSIGNED);
/* Get a pretty random xid to start with */
if (!nfs_xid)
@@ -213,7 +213,7 @@ nfsm_rpchead(struct ucred *cr, int nmflag, int procid, int auth_type,
*tl = txdr_unsigned(authsiz);
switch (auth_type) {
case RPCAUTH_UNIX:
- nfsm_build(tl, u_int32_t *, auth_len);
+ tl = nfsm_build(u_int32_t *, auth_len);
*tl++ = 0; /* stamp ?? */
*tl++ = 0; /* NULL hostname */
*tl++ = txdr_unsigned(cr->cr_uid);
@@ -228,7 +228,7 @@ nfsm_rpchead(struct ucred *cr, int nmflag, int procid, int auth_type,
/*
* And the verifier...
*/
- nfsm_build(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
+ tl = nfsm_build(u_int32_t *, 2 * NFSX_UNSIGNED);
*tl++ = txdr_unsigned(RPCAUTH_NULL);
*tl = 0;
mb->m_next = mrest;
@@ -948,7 +948,7 @@ nfsm_strtom_xx(const char *a, int s, int m,
return ENAMETOOLONG;
t1 = nfsm_rndup(s) + NFSX_UNSIGNED;
if (t1 <= M_TRAILINGSPACE(*mb)) {
- nfsm_build_xx((void **)tl, t1, mb, bpos);
+ *tl = nfsm_build_xx(t1, mb, bpos);
*(*tl)++ = txdr_unsigned(s);
*((*tl) + ((t1 >> 2) - 2)) = 0;
bcopy(a, *tl, s);
@@ -970,7 +970,7 @@ nfsm_fhtom_xx(struct vnode *v, int v3,
if (v3) {
t1 = nfsm_rndup(VTONFS(v)->n_fhsize) + NFSX_UNSIGNED;
if (t1 < M_TRAILINGSPACE(*mb)) {
- nfsm_build_xx((void **)tl, t1, mb, bpos);
+ *tl = nfsm_build_xx(t1, mb, bpos);
*(*tl)++ = txdr_unsigned(VTONFS(v)->n_fhsize);
*((*tl) + ((t1 >> 2) - 2)) = 0;
bcopy(VTONFS(v)->n_fhp, *tl, VTONFS(v)->n_fhsize);
@@ -982,7 +982,7 @@ nfsm_fhtom_xx(struct vnode *v, int v3,
return t1;
}
} else {
- nfsm_build_xx((void **)&cp, NFSX_V2FH, mb, bpos);
+ cp = nfsm_build_xx(NFSX_V2FH, mb, bpos);
bcopy(VTONFS(v)->n_fhp, cp, NFSX_V2FH);
}
return 0;
@@ -994,61 +994,61 @@ nfsm_v3attrbuild_xx(struct vattr *va, int full,
{
if (va->va_mode != (mode_t)VNOVAL) {
- nfsm_build_xx((void **)tl, 2 * NFSX_UNSIGNED, mb, bpos);
+ *tl = nfsm_build_xx(2 * NFSX_UNSIGNED, mb, bpos);
*(*tl)++ = nfs_true;
**tl = txdr_unsigned(va->va_mode);
} else {
- nfsm_build_xx((void **)tl, NFSX_UNSIGNED, mb, bpos);
+ *tl = nfsm_build_xx(NFSX_UNSIGNED, mb, bpos);
**tl = nfs_false;
}
if (full && va->va_uid != (uid_t)VNOVAL) {
- nfsm_build_xx((void **)tl, 2 * NFSX_UNSIGNED, mb, bpos);
+ *tl = nfsm_build_xx(2 * NFSX_UNSIGNED, mb, bpos);
*(*tl)++ = nfs_true;
**tl = txdr_unsigned(va->va_uid);
} else {
- nfsm_build_xx((void **)tl, NFSX_UNSIGNED, mb, bpos);
+ *tl = nfsm_build_xx(NFSX_UNSIGNED, mb, bpos);
**tl = nfs_false;
}
if (full && va->va_gid != (gid_t)VNOVAL) {
- nfsm_build_xx((void **)tl, 2 * NFSX_UNSIGNED, mb, bpos);
+ *tl = nfsm_build_xx(2 * NFSX_UNSIGNED, mb, bpos);
*(*tl)++ = nfs_true;
**tl = txdr_unsigned(va->va_gid);
} else {
- nfsm_build_xx((void **)tl, NFSX_UNSIGNED, mb, bpos);
+ *tl = nfsm_build_xx(NFSX_UNSIGNED, mb, bpos);
**tl = nfs_false;
}
if (full && va->va_size != VNOVAL) {
- nfsm_build_xx((void **)tl, 3 * NFSX_UNSIGNED, mb, bpos);
+ *tl = nfsm_build_xx(3 * NFSX_UNSIGNED, mb, bpos);
*(*tl)++ = nfs_true;
txdr_hyper(va->va_size, *tl);
} else {
- nfsm_build_xx((void **)tl, NFSX_UNSIGNED, mb, bpos);
+ *tl = nfsm_build_xx(NFSX_UNSIGNED, mb, bpos);
**tl = nfs_false;
}
if (va->va_atime.tv_sec != VNOVAL) {
if (va->va_atime.tv_sec != time_second) {
- nfsm_build_xx((void **)tl, 3 * NFSX_UNSIGNED, mb, bpos);
+ *tl = nfsm_build_xx(3 * NFSX_UNSIGNED, mb, bpos);
*(*tl)++ = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT);
txdr_nfsv3time(&va->va_atime, *tl);
} else {
- nfsm_build_xx((void **)tl, NFSX_UNSIGNED, mb, bpos);
+ *tl = nfsm_build_xx(NFSX_UNSIGNED, mb, bpos);
**tl = txdr_unsigned(NFSV3SATTRTIME_TOSERVER);
}
} else {
- nfsm_build_xx((void **)tl, NFSX_UNSIGNED, mb, bpos);
+ *tl = nfsm_build_xx(NFSX_UNSIGNED, mb, bpos);
**tl = txdr_unsigned(NFSV3SATTRTIME_DONTCHANGE);
}
if (va->va_mtime.tv_sec != VNOVAL) {
if (va->va_mtime.tv_sec != time_second) {
- nfsm_build_xx((void **)tl, 3 * NFSX_UNSIGNED, mb, bpos);
+ *tl = nfsm_build_xx(3 * NFSX_UNSIGNED, mb, bpos);
*(*tl)++ = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT);
txdr_nfsv3time(&va->va_mtime, *tl);
} else {
- nfsm_build_xx((void **)tl, NFSX_UNSIGNED, mb, bpos);
+ *tl = nfsm_build_xx(NFSX_UNSIGNED, mb, bpos);
**tl = txdr_unsigned(NFSV3SATTRTIME_TOSERVER);
}
} else {
- nfsm_build_xx((void **)tl, NFSX_UNSIGNED, mb, bpos);
+ *tl = nfsm_build_xx(NFSX_UNSIGNED, mb, bpos);
**tl = txdr_unsigned(NFSV3SATTRTIME_DONTCHANGE);
}
}
diff --git a/sys/nfsclient/nfs_vnops.c b/sys/nfsclient/nfs_vnops.c
index 4fc4521..2473f3d 100644
--- a/sys/nfsclient/nfs_vnops.c
+++ b/sys/nfsclient/nfs_vnops.c
@@ -278,7 +278,7 @@ nfs3_access_otw(struct vnode *vp, int wmode, struct thread *td,
mb = mreq;
bpos = mtod(mb, caddr_t);
nfsm_fhtom(vp, v3);
- nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
+ tl = nfsm_build(u_int32_t *, NFSX_UNSIGNED);
*tl = txdr_unsigned(wmode);
nfsm_request(vp, NFSPROC_ACCESS, td, cred);
nfsm_postop_attr(vp, attrflag);
@@ -694,10 +694,10 @@ nfs_setattrrpc(struct vnode *vp, struct vattr *vap, struct ucred *cred,
nfsm_fhtom(vp, v3);
if (v3) {
nfsm_v3attrbuild(vap, TRUE);
- nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
+ tl = nfsm_build(u_int32_t *, NFSX_UNSIGNED);
*tl = nfs_false;
} else {
- nfsm_build(sp, struct nfsv2_sattr *, NFSX_V2SATTR);
+ sp = nfsm_build(struct nfsv2_sattr *, NFSX_V2SATTR);
if (vap->va_mode == (mode_t)VNOVAL)
sp->sa_mode = nfs_xdrneg1;
else
@@ -1024,7 +1024,7 @@ nfs_readrpc(struct vnode *vp, struct uio *uiop, struct ucred *cred)
mb = mreq;
bpos = mtod(mb, caddr_t);
nfsm_fhtom(vp, v3);
- nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED * 3);
+ tl = nfsm_build(u_int32_t *, NFSX_UNSIGNED * 3);
if (v3) {
txdr_hyper(uiop->uio_offset, tl);
*(tl + 2) = txdr_unsigned(len);
@@ -1090,7 +1090,7 @@ nfs_writerpc(struct vnode *vp, struct uio *uiop, struct ucred *cred,
bpos = mtod(mb, caddr_t);
nfsm_fhtom(vp, v3);
if (v3) {
- nfsm_build(tl, u_int32_t *, 5 * NFSX_UNSIGNED);
+ tl = nfsm_build(u_int32_t *, 5 * NFSX_UNSIGNED);
txdr_hyper(uiop->uio_offset, tl);
tl += 2;
*tl++ = txdr_unsigned(len);
@@ -1099,7 +1099,7 @@ nfs_writerpc(struct vnode *vp, struct uio *uiop, struct ucred *cred,
} else {
u_int32_t x;
- nfsm_build(tl, u_int32_t *, 4 * NFSX_UNSIGNED);
+ tl = nfsm_build(u_int32_t *, 4 * NFSX_UNSIGNED);
/* Set both "begin" and "current" to non-garbage. */
x = txdr_unsigned((u_int32_t)uiop->uio_offset);
*tl++ = x; /* "begin offset" */
@@ -1207,16 +1207,16 @@ nfs_mknodrpc(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp,
nfsm_fhtom(dvp, v3);
nfsm_strtom(cnp->cn_nameptr, cnp->cn_namelen, NFS_MAXNAMLEN);
if (v3) {
- nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
+ tl = nfsm_build(u_int32_t *, NFSX_UNSIGNED);
*tl++ = vtonfsv3_type(vap->va_type);
nfsm_v3attrbuild(vap, FALSE);
if (vap->va_type == VCHR || vap->va_type == VBLK) {
- nfsm_build(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
+ tl = nfsm_build(u_int32_t *, 2 * NFSX_UNSIGNED);
*tl++ = txdr_unsigned(umajor(vap->va_rdev));
*tl = txdr_unsigned(uminor(vap->va_rdev));
}
} else {
- nfsm_build(sp, struct nfsv2_sattr *, NFSX_V2SATTR);
+ sp = nfsm_build(struct nfsv2_sattr *, NFSX_V2SATTR);
sp->sa_mode = vtonfsv2_mode(vap->va_type, vap->va_mode);
sp->sa_uid = nfs_xdrneg1;
sp->sa_gid = nfs_xdrneg1;
@@ -1308,10 +1308,10 @@ again:
nfsm_fhtom(dvp, v3);
nfsm_strtom(cnp->cn_nameptr, cnp->cn_namelen, NFS_MAXNAMLEN);
if (v3) {
- nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
+ tl = nfsm_build(u_int32_t *, NFSX_UNSIGNED);
if (fmode & O_EXCL) {
*tl = txdr_unsigned(NFSV3CREATE_EXCLUSIVE);
- nfsm_build(tl, u_int32_t *, NFSX_V3CREATEVERF);
+ tl = nfsm_build(u_int32_t *, NFSX_V3CREATEVERF);
#ifdef INET
if (!TAILQ_EMPTY(&in_ifaddrhead))
*tl++ = IA_SIN(TAILQ_FIRST(&in_ifaddrhead))->sin_addr.s_addr;
@@ -1324,7 +1324,7 @@ again:
nfsm_v3attrbuild(vap, FALSE);
}
} else {
- nfsm_build(sp, struct nfsv2_sattr *, NFSX_V2SATTR);
+ sp = nfsm_build(struct nfsv2_sattr *, NFSX_V2SATTR);
sp->sa_mode = vtonfsv2_mode(vap->va_type, vap->va_mode);
sp->sa_uid = nfs_xdrneg1;
sp->sa_gid = nfs_xdrneg1;
@@ -1702,7 +1702,7 @@ nfs_symlink(struct vop_symlink_args *ap)
}
nfsm_strtom(ap->a_target, slen, NFS_MAXPATHLEN);
if (!v3) {
- nfsm_build(sp, struct nfsv2_sattr *, NFSX_V2SATTR);
+ sp = nfsm_build(struct nfsv2_sattr *, NFSX_V2SATTR);
sp->sa_mode = vtonfsv2_mode(VLNK, vap->va_mode);
sp->sa_uid = nfs_xdrneg1;
sp->sa_gid = nfs_xdrneg1;
@@ -1800,7 +1800,7 @@ nfs_mkdir(struct vop_mkdir_args *ap)
if (v3) {
nfsm_v3attrbuild(vap, FALSE);
} else {
- nfsm_build(sp, struct nfsv2_sattr *, NFSX_V2SATTR);
+ sp = nfsm_build(struct nfsv2_sattr *, NFSX_V2SATTR);
sp->sa_mode = vtonfsv2_mode(VDIR, vap->va_mode);
sp->sa_uid = nfs_xdrneg1;
sp->sa_gid = nfs_xdrneg1;
@@ -1971,13 +1971,13 @@ nfs_readdirrpc(struct vnode *vp, struct uio *uiop, struct ucred *cred)
bpos = mtod(mb, caddr_t);
nfsm_fhtom(vp, v3);
if (v3) {
- nfsm_build(tl, u_int32_t *, 5 * NFSX_UNSIGNED);
+ tl = nfsm_build(u_int32_t *, 5 * NFSX_UNSIGNED);
*tl++ = cookie.nfsuquad[0];
*tl++ = cookie.nfsuquad[1];
*tl++ = dnp->n_cookieverf.nfsuquad[0];
*tl++ = dnp->n_cookieverf.nfsuquad[1];
} else {
- nfsm_build(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
+ tl = nfsm_build(u_int32_t *, 2 * NFSX_UNSIGNED);
*tl++ = cookie.nfsuquad[0];
}
*tl = txdr_unsigned(nmp->nm_readdirsize);
@@ -2162,7 +2162,7 @@ nfs_readdirplusrpc(struct vnode *vp, struct uio *uiop, struct ucred *cred)
mb = mreq;
bpos = mtod(mb, caddr_t);
nfsm_fhtom(vp, 1);
- nfsm_build(tl, u_int32_t *, 6 * NFSX_UNSIGNED);
+ tl = nfsm_build(u_int32_t *, 6 * NFSX_UNSIGNED);
*tl++ = cookie.nfsuquad[0];
*tl++ = cookie.nfsuquad[1];
*tl++ = dnp->n_cookieverf.nfsuquad[0];
@@ -2493,7 +2493,7 @@ nfs_commit(struct vnode *vp, u_quad_t offset, int cnt, struct ucred *cred,
mb = mreq;
bpos = mtod(mb, caddr_t);
nfsm_fhtom(vp, 1);
- nfsm_build(tl, u_int32_t *, 3 * NFSX_UNSIGNED);
+ tl = nfsm_build(u_int32_t *, 3 * NFSX_UNSIGNED);
txdr_hyper(offset, tl);
tl += 2;
*tl = txdr_unsigned(cnt);
diff --git a/sys/nfsserver/nfs_serv.c b/sys/nfsserver/nfs_serv.c
index 901250f..9e6a445 100644
--- a/sys/nfsserver/nfs_serv.c
+++ b/sys/nfsserver/nfs_serv.c
@@ -219,7 +219,7 @@ nfsrv3_access(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
vp = NULL;
nfsm_reply(NFSX_POSTOPATTR(1) + NFSX_UNSIGNED);
nfsm_srvpostop_attr(getret, vap);
- nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
+ tl = nfsm_build(u_int32_t *, NFSX_UNSIGNED);
*tl = txdr_unsigned(nfsmode);
nfsmout:
if (vp)
@@ -266,7 +266,8 @@ nfsrv_getattr(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
error = 0;
goto nfsmout;
}
- nfsm_build(fp, struct nfs_fattr *, NFSX_FATTR(nfsd->nd_flag & ND_NFSV3));
+ fp = nfsm_build(struct nfs_fattr *,
+ NFSX_FATTR(nfsd->nd_flag & ND_NFSV3));
nfsm_srvfillattr(vap, fp);
/* fall through */
@@ -420,7 +421,7 @@ out:
goto nfsmout;
} else {
/* v2 non-error case (see nfsm_reply). */
- nfsm_build(fp, struct nfs_fattr *, NFSX_V2FATTR);
+ fp = nfsm_build(struct nfs_fattr *, NFSX_V2FATTR);
nfsm_srvfillattr(vap, fp);
}
/* fall through */
@@ -607,7 +608,7 @@ nfsrv_lookup(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
nfsm_srvpostop_attr(0, vap);
nfsm_srvpostop_attr(dirattr_ret, &dirattr);
} else {
- nfsm_build(fp, struct nfs_fattr *, NFSX_V2FATTR);
+ fp = nfsm_build(struct nfs_fattr *, NFSX_V2FATTR);
nfsm_srvfillattr(vap, fp);
}
@@ -716,7 +717,7 @@ out:
tlen = nfsm_rndup(len);
nfsm_adj(mp3, NFS_MAXPATHLEN-tlen, tlen-len);
}
- nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
+ tl = nfsm_build(u_int32_t *, NFSX_UNSIGNED);
*tl = txdr_unsigned(len);
mb->m_next = mp3;
mp3 = NULL;
@@ -878,12 +879,12 @@ nfsrv_read(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
nfsm_reply(NFSX_POSTOPORFATTR(v3) + 3 * NFSX_UNSIGNED+nfsm_rndup(cnt));
if (v3) {
- nfsm_build(tl, u_int32_t *, NFSX_V3FATTR + 4 * NFSX_UNSIGNED);
+ tl = nfsm_build(u_int32_t *, NFSX_V3FATTR + 4 * NFSX_UNSIGNED);
*tl++ = nfs_true;
fp = (struct nfs_fattr *)tl;
tl += (NFSX_V3FATTR / sizeof (u_int32_t));
} else {
- nfsm_build(tl, u_int32_t *, NFSX_V2FATTR + NFSX_UNSIGNED);
+ tl = nfsm_build(u_int32_t *, NFSX_V2FATTR + NFSX_UNSIGNED);
fp = (struct nfs_fattr *)tl;
tl += (NFSX_V2FATTR / sizeof (u_int32_t));
}
@@ -1158,7 +1159,7 @@ ereply:
error = 0;
goto nfsmout;
}
- nfsm_build(tl, u_int32_t *, 4 * NFSX_UNSIGNED);
+ tl = nfsm_build(u_int32_t *, 4 * NFSX_UNSIGNED);
*tl++ = txdr_unsigned(retlen);
/*
* If nfs_async is set, then pretend the write was FILESYNC.
@@ -1178,7 +1179,7 @@ ereply:
*tl = txdr_unsigned(nfsver.tv_usec);
} else {
/* v2, non-error case (see nfsm_reply). */
- nfsm_build(fp, struct nfs_fattr *, NFSX_V2FATTR);
+ fp = nfsm_build(struct nfs_fattr *, NFSX_V2FATTR);
nfsm_srvfillattr(vap, fp);
}
nfsmout:
@@ -1455,7 +1456,7 @@ loop1:
NFSX_WRITEVERF(v3));
if (v3) {
nfsm_srvwcc_data(forat_ret, &forat, aftat_ret, &va);
- nfsm_build(tl, u_int32_t *, 4 * NFSX_UNSIGNED);
+ tl = nfsm_build(u_int32_t *, 4 * NFSX_UNSIGNED);
*tl++ = txdr_unsigned(nfsd->nd_len);
*tl++ = txdr_unsigned(swp->nd_stable);
/*
@@ -1468,7 +1469,7 @@ loop1:
*tl++ = txdr_unsigned(nfsver.tv_sec);
*tl = txdr_unsigned(nfsver.tv_usec);
} else {
- nfsm_build(fp, struct nfs_fattr *, NFSX_V2FATTR);
+ fp = nfsm_build(struct nfs_fattr *, NFSX_V2FATTR);
nfsm_srvfillattr(&va, fp);
}
}
@@ -1828,7 +1829,7 @@ ereply:
} else {
/* v2 non-error case (see nfsm_reply). */
nfsm_srvfhtom(fhp, v3);
- nfsm_build(fp, struct nfs_fattr *, NFSX_V2FATTR);
+ fp = nfsm_build(struct nfs_fattr *, NFSX_V2FATTR);
nfsm_srvfillattr(vap, fp);
}
goto nfsmout;
@@ -2793,7 +2794,7 @@ out:
} else {
/* v2, non-error case (see nfsm_reply) */
nfsm_srvfhtom(fhp, v3);
- nfsm_build(fp, struct nfs_fattr *, NFSX_V2FATTR);
+ fp = nfsm_build(struct nfs_fattr *, NFSX_V2FATTR);
nfsm_srvfillattr(vap, fp);
}
error = 0;
@@ -3115,11 +3116,11 @@ again:
2 * NFSX_UNSIGNED);
if (v3) {
nfsm_srvpostop_attr(getret, &at);
- nfsm_build(tl, u_int32_t *, 4 * NFSX_UNSIGNED);
+ tl = nfsm_build(u_int32_t *, 4 * NFSX_UNSIGNED);
txdr_hyper(at.va_filerev, tl);
tl += 2;
} else
- nfsm_build(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
+ tl = nfsm_build(u_int32_t *, 2 * NFSX_UNSIGNED);
*tl++ = nfs_false;
*tl = nfs_true;
FREE((caddr_t)rbuf, M_TEMP);
@@ -3162,7 +3163,7 @@ again:
nfsm_reply(NFSX_POSTOPATTR(v3) + NFSX_COOKIEVERF(v3) + siz);
if (v3) {
nfsm_srvpostop_attr(getret, &at);
- nfsm_build(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
+ tl = nfsm_build(u_int32_t *, 2 * NFSX_UNSIGNED);
txdr_hyper(at.va_filerev, tl);
}
mp = mb;
@@ -3387,7 +3388,7 @@ again:
nfsm_reply(NFSX_V3POSTOPATTR + NFSX_V3COOKIEVERF +
2 * NFSX_UNSIGNED);
nfsm_srvpostop_attr(getret, &at);
- nfsm_build(tl, u_int32_t *, 4 * NFSX_UNSIGNED);
+ tl = nfsm_build(u_int32_t *, 4 * NFSX_UNSIGNED);
txdr_hyper(at.va_filerev, tl);
tl += 2;
*tl++ = nfs_false;
@@ -3446,10 +3447,11 @@ again:
vput(nvp);
nvp = NULL;
- dirlen = len = NFSX_V3POSTOPATTR + NFSX_V3COOKIEVERF + 2 * NFSX_UNSIGNED;
+ dirlen = len = NFSX_V3POSTOPATTR + NFSX_V3COOKIEVERF +
+ 2 * NFSX_UNSIGNED;
nfsm_reply(cnt);
nfsm_srvpostop_attr(getret, &at);
- nfsm_build(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
+ tl = nfsm_build(u_int32_t *, 2 * NFSX_UNSIGNED);
txdr_hyper(at.va_filerev, tl);
mp = mb;
bp = bpos;
@@ -3719,7 +3721,7 @@ ereply:
nfsm_reply(NFSX_V3WCCDATA + NFSX_V3WRITEVERF);
nfsm_srvwcc_data(for_ret, &bfor, aft_ret, &aft);
if (!error) {
- nfsm_build(tl, u_int32_t *, NFSX_V3WRITEVERF);
+ tl = nfsm_build(u_int32_t *, NFSX_V3WRITEVERF);
if (nfsver.tv_sec == 0)
nfsver = boottime;
*tl++ = txdr_unsigned(nfsver.tv_sec);
@@ -3782,7 +3784,7 @@ nfsrv_statfs(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
error = 0;
goto nfsmout;
}
- nfsm_build(sfp, struct nfs_statfs *, NFSX_STATFS(v3));
+ sfp = nfsm_build(struct nfs_statfs *, NFSX_STATFS(v3));
if (v3) {
tval = (u_quad_t)sf->f_blocks;
tval *= (u_quad_t)sf->f_bsize;
@@ -3859,7 +3861,7 @@ nfsrv_fsinfo(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
vp = NULL;
nfsm_reply(NFSX_V3POSTOPATTR + NFSX_V3FSINFO);
nfsm_srvpostop_attr(getret, &at);
- nfsm_build(sip, struct nfsv3_fsinfo *, NFSX_V3FSINFO);
+ sip = nfsm_build(struct nfsv3_fsinfo *, NFSX_V3FSINFO);
/*
* XXX
@@ -3940,7 +3942,7 @@ nfsrv_pathconf(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
error = 0;
goto nfsmout;
}
- nfsm_build(pc, struct nfsv3_pathconf *, NFSX_V3PATHCONF);
+ pc = nfsm_build(struct nfsv3_pathconf *, NFSX_V3PATHCONF);
pc->pc_linkmax = txdr_unsigned(linkmax);
pc->pc_namemax = txdr_unsigned(namemax);
diff --git a/sys/nfsserver/nfs_srvsock.c b/sys/nfsserver/nfs_srvsock.c
index 0c36faa..c93d431 100644
--- a/sys/nfsserver/nfs_srvsock.c
+++ b/sys/nfsserver/nfs_srvsock.c
@@ -191,7 +191,7 @@ nfs_rephead(int siz, struct nfsrv_descript *nd, struct nfssvc_sock *slp,
break;
case EPROGMISMATCH:
*tl = txdr_unsigned(RPC_PROGMISMATCH);
- nfsm_build(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
+ tl = nfsm_build(u_int32_t *, 2 * NFSX_UNSIGNED);
*tl++ = txdr_unsigned(2);
*tl = txdr_unsigned(3);
break;
@@ -204,7 +204,7 @@ nfs_rephead(int siz, struct nfsrv_descript *nd, struct nfssvc_sock *slp,
default:
*tl = 0;
if (err != NFSERR_RETVOID) {
- nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
+ tl = nfsm_build(u_int32_t *, NFSX_UNSIGNED);
if (err)
*tl = txdr_unsigned(nfsrv_errmap(nd, err));
else
diff --git a/sys/nfsserver/nfs_srvsubs.c b/sys/nfsserver/nfs_srvsubs.c
index 3b65b69..672ec12 100644
--- a/sys/nfsserver/nfs_srvsubs.c
+++ b/sys/nfsserver/nfs_srvsubs.c
@@ -931,10 +931,10 @@ nfsm_srvwcc(struct nfsrv_descript *nfsd, int before_ret,
u_int32_t *tl;
if (before_ret) {
- nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
+ tl = nfsm_build(u_int32_t *, NFSX_UNSIGNED);
*tl = nfs_false;
} else {
- nfsm_build(tl, u_int32_t *, 7 * NFSX_UNSIGNED);
+ tl = nfsm_build(u_int32_t *, 7 * NFSX_UNSIGNED);
*tl++ = nfs_true;
txdr_hyper(before_vap->va_size, tl);
tl += 2;
@@ -957,10 +957,10 @@ nfsm_srvpostopattr(struct nfsrv_descript *nfsd, int after_ret,
struct nfs_fattr *fp;
if (after_ret) {
- nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
+ tl = nfsm_build(u_int32_t *, NFSX_UNSIGNED);
*tl = nfs_false;
} else {
- nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED + NFSX_V3FATTR);
+ tl = nfsm_build(u_int32_t *, NFSX_UNSIGNED + NFSX_V3FATTR);
*tl++ = nfs_true;
fp = (struct nfs_fattr *)tl;
nfsm_srvfattr(nfsd, after_vap, fp);
@@ -1208,12 +1208,11 @@ nfsm_srvfhtom_xx(fhandle_t *f, int v3,
u_int32_t *cp;
if (v3) {
- nfsm_build_xx((void **)tl, NFSX_UNSIGNED + NFSX_V3FH, mb,
- bpos);
+ *tl = nfsm_build_xx(NFSX_UNSIGNED + NFSX_V3FH, mb, bpos);
*(*tl)++ = txdr_unsigned(NFSX_V3FH);
bcopy(f, (*tl), NFSX_V3FH);
} else {
- nfsm_build_xx((void **)&cp, NFSX_V2FH, mb, bpos);
+ cp = nfsm_build_xx(NFSX_V2FH, mb, bpos);
bcopy(f, cp, NFSX_V2FH);
}
}
@@ -1222,7 +1221,8 @@ void
nfsm_srvpostop_fh_xx(fhandle_t *f,
u_int32_t **tl, struct mbuf **mb, caddr_t *bpos)
{
- nfsm_build_xx((void **)tl, 2 * NFSX_UNSIGNED + NFSX_V3FH, mb, bpos);
+
+ *tl = nfsm_build_xx(2 * NFSX_UNSIGNED + NFSX_V3FH, mb, bpos);
*(*tl)++ = nfs_true;
*(*tl)++ = txdr_unsigned(NFSX_V3FH);
bcopy(f, (*tl), NFSX_V3FH);
OpenPOWER on IntegriCloud