diff options
author | patacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679> | 2012-06-11 23:51:39 +0000 |
---|---|---|
committer | patacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679> | 2012-06-11 23:51:39 +0000 |
commit | 9aec5418015792440adfccfcec6341738aef8659 (patch) | |
tree | e0f4c75c1f4315317ee887fcb05202c0074ac539 /nuttx | |
parent | 23817b959fb904906e58500abc2d47804b1dd925 (diff) | |
download | px4-firmware-9aec5418015792440adfccfcec6341738aef8659.tar.gz px4-firmware-9aec5418015792440adfccfcec6341738aef8659.tar.bz2 px4-firmware-9aec5418015792440adfccfcec6341738aef8659.zip |
NFS update
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4831 7fd9a85b-ad96-42d3-883c-3090e2eb8679
Diffstat (limited to 'nuttx')
-rw-r--r-- | nuttx/fs/nfs/nfs_vfsops.c | 49 |
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 */ |