diff options
author | peter <peter@FreeBSD.org> | 1998-05-31 19:28:15 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1998-05-31 19:28:15 +0000 |
commit | 2a5188e78c5774fe3e4c4d12fb905417c8e87853 (patch) | |
tree | f1a708334f90edce987a4b8a223335f181162839 /sys | |
parent | da4830ce17965e90430dd7dbe60701d837b6e94c (diff) | |
download | FreeBSD-src-2a5188e78c5774fe3e4c4d12fb905417c8e87853.zip FreeBSD-src-2a5188e78c5774fe3e4c4d12fb905417c8e87853.tar.gz |
Fully fill in nfsv2 write rpc requests rather than leaving garbage.
Obtained from: NetBSD
Diffstat (limited to 'sys')
-rw-r--r-- | sys/nfs/nfs_vnops.c | 15 | ||||
-rw-r--r-- | sys/nfsclient/nfs_vnops.c | 15 |
2 files changed, 22 insertions, 8 deletions
diff --git a/sys/nfs/nfs_vnops.c b/sys/nfs/nfs_vnops.c index 2acfb31..91e70a0 100644 --- a/sys/nfs/nfs_vnops.c +++ b/sys/nfs/nfs_vnops.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_vnops.c 8.16 (Berkeley) 5/27/95 - * $Id: nfs_vnops.c,v 1.99 1998/05/31 19:00:18 peter Exp $ + * $Id: nfs_vnops.c,v 1.100 1998/05/31 19:24:19 peter Exp $ */ @@ -1128,12 +1128,19 @@ nfs_writerpc(vp, uiop, cred, iomode, must_commit) tl += 2; *tl++ = txdr_unsigned(len); *tl++ = txdr_unsigned(*iomode); + *tl = txdr_unsigned(len); } else { + register u_long x; + nfsm_build(tl, u_long *, 4 * NFSX_UNSIGNED); - *++tl = txdr_unsigned(uiop->uio_offset); - tl += 2; + /* Set both "begin" and "current" to non-garbage. */ + x = txdr_unsigned((u_long)uiop->uio_offset); + *tl++ = x; /* "begin offset" */ + *tl++ = x; /* "current offset" */ + x = txdr_unsigned(len); + *tl++ = x; /* total to this offset */ + *tl = x; /* size of this write */ } - *tl = txdr_unsigned(len); nfsm_uiotom(uiop, len); nfsm_request(vp, NFSPROC_WRITE, uiop->uio_procp, cred); if (v3) { diff --git a/sys/nfsclient/nfs_vnops.c b/sys/nfsclient/nfs_vnops.c index 2acfb31..91e70a0 100644 --- a/sys/nfsclient/nfs_vnops.c +++ b/sys/nfsclient/nfs_vnops.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_vnops.c 8.16 (Berkeley) 5/27/95 - * $Id: nfs_vnops.c,v 1.99 1998/05/31 19:00:18 peter Exp $ + * $Id: nfs_vnops.c,v 1.100 1998/05/31 19:24:19 peter Exp $ */ @@ -1128,12 +1128,19 @@ nfs_writerpc(vp, uiop, cred, iomode, must_commit) tl += 2; *tl++ = txdr_unsigned(len); *tl++ = txdr_unsigned(*iomode); + *tl = txdr_unsigned(len); } else { + register u_long x; + nfsm_build(tl, u_long *, 4 * NFSX_UNSIGNED); - *++tl = txdr_unsigned(uiop->uio_offset); - tl += 2; + /* Set both "begin" and "current" to non-garbage. */ + x = txdr_unsigned((u_long)uiop->uio_offset); + *tl++ = x; /* "begin offset" */ + *tl++ = x; /* "current offset" */ + x = txdr_unsigned(len); + *tl++ = x; /* total to this offset */ + *tl = x; /* size of this write */ } - *tl = txdr_unsigned(len); nfsm_uiotom(uiop, len); nfsm_request(vp, NFSPROC_WRITE, uiop->uio_procp, cred); if (v3) { |