summaryrefslogtreecommitdiff
path: root/nuttx/fs/nfs
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-06-11 23:51:39 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-06-11 23:51:39 +0000
commitc5af86030963729f5b208777284c01bb394a5d39 (patch)
treee0f4c75c1f4315317ee887fcb05202c0074ac539 /nuttx/fs/nfs
parent4041ad545516f94eb7de87c8709fbb0f226f291b (diff)
downloadpx4-nuttx-c5af86030963729f5b208777284c01bb394a5d39.tar.gz
px4-nuttx-c5af86030963729f5b208777284c01bb394a5d39.tar.bz2
px4-nuttx-c5af86030963729f5b208777284c01bb394a5d39.zip
NFS update
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4831 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/fs/nfs')
-rw-r--r--nuttx/fs/nfs/nfs_vfsops.c49
1 files changed, 18 insertions, 31 deletions
diff --git a/nuttx/fs/nfs/nfs_vfsops.c b/nuttx/fs/nfs/nfs_vfsops.c
index 6d78a2cec..5bb6f188f 100644
--- a/nuttx/fs/nfs/nfs_vfsops.c
+++ b/nuttx/fs/nfs/nfs_vfsops.c
@@ -282,35 +282,28 @@ static int nfs_filecreate(FAR struct nfsmount *nmp, struct nfsnode *np,
/* Set the user ID to zero */
- *ptr++ = nfs_true; /* True: Uid value follows */
- reqlen += sizeof(uint32_t);
-
- *ptr++ = 0;
- reqlen += sizeof(uint32_t);
+ *ptr++ = nfs_true; /* True: Uid value follows */
+ *ptr++ = 0; /* UID = 0 (nobody) */
+ reqlen += 2*sizeof(uint32_t);
/* Set the group ID to one */
- *ptr++ = nfs_true; /* True: Gid value follows */
- reqlen += sizeof(uint32_t);
-
- *ptr++ = HTONL(1);
- reqlen += sizeof(uint32_t);
+ *ptr++ = nfs_true; /* True: Gid value follows */
+ *ptr++ = HTONL(1); /* GID = 1 (nogroup) */
+ reqlen += 2*sizeof(uint32_t);
/* Set the size to zero */
- *ptr++ = nfs_true; /* True: Size value follows */
- reqlen += sizeof(uint32_t);
-
+ *ptr++ = nfs_true; /* True: Size value follows */
+ *ptr++ = 0; /* Size = 0 */
*ptr++ = 0;
- reqlen += sizeof(uint32_t);
+ reqlen += 3*sizeof(uint32_t);
/* Don't change times */
*ptr++ = HTONL(NFSV3SATTRTIME_DONTCHANGE); /* Don't change atime */
- reqlen += sizeof(uint32_t);
-
*ptr++ = HTONL(NFSV3SATTRTIME_DONTCHANGE); /* Don't change mtime */
- reqlen += sizeof(uint32_t);
+ reqlen += 2*sizeof(uint32_t);
}
/* Send the NFS request. Note there is special logic here to handle version 3
@@ -936,7 +929,7 @@ static ssize_t nfs_write(FAR struct file *filep, const char *buffer,
/* Copy the file offset */
txdr_hyper((uint64_t)filep->f_pos, ptr);
- ptr += 2;
+ ptr += 2;
reqlen += 2*sizeof(uint32_t);
/* Copy the count and stable values */
@@ -2082,19 +2075,15 @@ static int nfs_mkdir(struct inode *mountpt, const char *relpath, mode_t mode)
/* Set the user ID to zero */
- *ptr++ = nfs_true; /* True: Uid value follows */
- reqlen += sizeof(uint32_t);
-
- *ptr++ = 0;
- reqlen += sizeof(uint32_t);
+ *ptr++ = nfs_true; /* True: Uid value follows */
+ *ptr++ = 0; /* UID = 0 (nobody) */
+ reqlen += 2*sizeof(uint32_t);
/* Set the group ID to one */
- *ptr++ = nfs_true; /* True: Gid value follows */
- reqlen += sizeof(uint32_t);
-
- *ptr++ = HTONL(1);
- reqlen += sizeof(uint32_t);
+ *ptr++ = nfs_true; /* True: Gid value follows */
+ *ptr++ = HTONL(1); /* GID = 1 (nogroup) */
+ reqlen += 2*sizeof(uint32_t);
/* No size */
@@ -2104,10 +2093,8 @@ static int nfs_mkdir(struct inode *mountpt, const char *relpath, mode_t mode)
/* Don't change times */
*ptr++ = HTONL(NFSV3SATTRTIME_DONTCHANGE); /* Don't change atime */
- reqlen += sizeof(uint32_t);
-
*ptr++ = HTONL(NFSV3SATTRTIME_DONTCHANGE); /* Don't change mtime */
- reqlen += sizeof(uint32_t);
+ reqlen += 2*sizeof(uint32_t);
/* Perform the MKDIR RPC */