summaryrefslogtreecommitdiff
path: root/nuttx/fs/nfs/rpc_clnt.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-06-10 23:17:10 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-06-10 23:17:10 +0000
commit2e3f4fdf96579fbcc0f2c9d017ceb4cc6dd5ef2c (patch)
tree3c82b2818e6362433b43db3bf37e4799ab287b86 /nuttx/fs/nfs/rpc_clnt.c
parentbd4defc1489e67d10a8ebbadc0ef91d48ff584fa (diff)
downloadpx4-nuttx-2e3f4fdf96579fbcc0f2c9d017ceb4cc6dd5ef2c.tar.gz
px4-nuttx-2e3f4fdf96579fbcc0f2c9d017ceb4cc6dd5ef2c.tar.bz2
px4-nuttx-2e3f4fdf96579fbcc0f2c9d017ceb4cc6dd5ef2c.zip
NFS update
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4825 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/fs/nfs/rpc_clnt.c')
-rw-r--r--nuttx/fs/nfs/rpc_clnt.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/nuttx/fs/nfs/rpc_clnt.c b/nuttx/fs/nfs/rpc_clnt.c
index 8fc3fb5d7..afa383d9c 100644
--- a/nuttx/fs/nfs/rpc_clnt.c
+++ b/nuttx/fs/nfs/rpc_clnt.c
@@ -4,6 +4,7 @@
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
* Copyright (C) 2012 Jose Pablo Rojas Vargas. All rights reserved.
* Author: Jose Pablo Rojas Vargas <jrojas@nx-engineering.com>
+ * Gregory Nutt <gnutt@nuttx.org>
*
* Leveraged from OpenBSD:
*
@@ -1137,15 +1138,18 @@ static int rpcclnt_buildheader(struct rpcclnt *rpc, int procid, int prog, int ve
case NFSPROC_READ:
{
- /* Copy the variable, caller-provided data into the call message structure */
+ /* Copy the variable length, caller-provided data into the call
+ * message structure.
+ */
struct rpc_call_read *callmsg = (struct rpc_call_read *)msgbuf;
memcpy(&callmsg->read, request, *reqlen);
- /* Return the full size of the message (including messages headers) */
+ /* Return the full size of the message (the size of variable data
+ * plus the size of the messages header).
+ */
- DEBUGASSERT(*reqlen == sizeof(struct READ3args));
- *reqlen = sizeof(struct rpc_call_read);
+ *reqlen += sizeof(struct rpc_call_header);
/* Format the message header */
@@ -1156,15 +1160,18 @@ static int rpcclnt_buildheader(struct rpcclnt *rpc, int procid, int prog, int ve
case NFSPROC_WRITE:
{
- /* Copy the variable, caller-provided data into the call message structure */
+ /* Copy the variable length, caller-provided data into the call
+ * message structure.
+ */
struct rpc_call_write *callmsg = (struct rpc_call_write *)msgbuf;
memcpy(&callmsg->write, request, *reqlen);
- /* Return the full size of the message (including messages headers) */
+ /* Return the full size of the message (the size of variable data
+ * plus the size of the messages header).
+ */
- DEBUGASSERT(*reqlen == sizeof(struct WRITE3args));
- *reqlen = sizeof(struct rpc_call_write);
+ *reqlen += sizeof(struct rpc_call_header);
/* Format the message header */