diff options
author | patacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679> | 2012-06-13 00:46:44 +0000 |
---|---|---|
committer | patacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679> | 2012-06-13 00:46:44 +0000 |
commit | db3aa46fc486bb9f37bf3b7785335ca38634b18c (patch) | |
tree | 5bb2ed7cacdc868579ee14e01c172cf6b35ec8a4 | |
parent | b9c25afea722efbedb4ab585c93fdfc2d3e0dcae (diff) |
NFS update
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4836 7fd9a85b-ad96-42d3-883c-3090e2eb8679
-rw-r--r-- | nuttx/fs/nfs/nfs_proto.h | 8 | ||||
-rw-r--r-- | nuttx/fs/nfs/nfs_util.c | 2 | ||||
-rw-r--r-- | nuttx/fs/nfs/nfs_vfsops.c | 11 | ||||
-rw-r--r-- | nuttx/fs/nfs/rpc.h | 5 | ||||
-rw-r--r-- | nuttx/fs/nfs/rpc_clnt.c | 32 |
5 files changed, 13 insertions, 45 deletions
diff --git a/nuttx/fs/nfs/nfs_proto.h b/nuttx/fs/nfs/nfs_proto.h index c666c21544..245f3e189f 100644 --- a/nuttx/fs/nfs/nfs_proto.h +++ b/nuttx/fs/nfs/nfs_proto.h @@ -296,6 +296,7 @@ typedef enum NFFIFO = 7 /* Named FIFO */ } nfstype; +#if 0 typedef struct { int32_t val[2]; @@ -321,10 +322,11 @@ struct fhandle }; typedef struct fhandle fhandle_t; +#endif -/* File Handle (32 bytes for version 2), variable up to 64 for version 3. - * This structures a variable sized and are provided only for setting aside - * maximum memory allocatins for a file handle. +/* File Handle variable is up to 64 bytes for version 3. This structures a + * ariable sized and are provided only for setting aside maximum memory + * allocations for a file handle. */ struct nfsfh diff --git a/nuttx/fs/nfs/nfs_util.c b/nuttx/fs/nfs/nfs_util.c index 3206014c00..ae60429e79 100644 --- a/nuttx/fs/nfs/nfs_util.c +++ b/nuttx/fs/nfs/nfs_util.c @@ -331,7 +331,7 @@ int nfs_lookup(struct nfsmount *nmp, FAR const char *filename, namelen = strlen(filename); if (namelen > NAME_MAX) { - fdbg("Length of \"%s\%too big: %d\n", namelen); + fdbg("Length of the string is too big: %d\n", namelen); return E2BIG; } diff --git a/nuttx/fs/nfs/nfs_vfsops.c b/nuttx/fs/nfs/nfs_vfsops.c index 3b5a12cbe2..b8b8eb0311 100644 --- a/nuttx/fs/nfs/nfs_vfsops.c +++ b/nuttx/fs/nfs/nfs_vfsops.c @@ -1890,17 +1890,6 @@ static int nfs_remove(struct inode *mountpt, const char *relpath) goto errout_with_semaphore; } - /* We found something at this path. Make sure that it is not a directory. */ - -#if 0 /* We have the attributes of the directory, not of the object to be deleted */ - if (fxdr_unsigned(uint32_t, fattr.fa_type) == NFDIR) - { - fdbg("ERROR: \"%s\" is a directory\n", relpath); - error = EISDIR; - goto errout_with_semaphore; - } -#endif - /* Create the REMOVE RPC call arguments */ ptr = (FAR uint32_t *)&remove; diff --git a/nuttx/fs/nfs/rpc.h b/nuttx/fs/nfs/rpc.h index b6ff3dd5b3..dcdb0f59c1 100644 --- a/nuttx/fs/nfs/rpc.h +++ b/nuttx/fs/nfs/rpc.h @@ -202,11 +202,6 @@ * Public Types ****************************************************************************/ -struct xidr -{ - uint32_t xid; -}; - /* Global RPC statistics */ #ifdef CONFIG_NFS_STATISTICS diff --git a/nuttx/fs/nfs/rpc_clnt.c b/nuttx/fs/nfs/rpc_clnt.c index 9cbc153391..f83faf5c4e 100644 --- a/nuttx/fs/nfs/rpc_clnt.c +++ b/nuttx/fs/nfs/rpc_clnt.c @@ -166,8 +166,8 @@ static uint32_t rpcclnt_newxid(void); static void rpcclnt_fmtheader(FAR struct rpc_call_header *ch, uint32_t xid, int procid, int prog, int vers); static int rpcclnt_buildheader(struct rpcclnt *rpc, int procid, int prog, int vers, - struct xidr *value, FAR const void *request, - size_t *reqlen, FAR void *msgbuf); + FAR const void *request, size_t *reqlen, + FAR void *msgbuf); /**************************************************************************** * Private Functions @@ -553,8 +553,7 @@ static void rpcclnt_fmtheader(FAR struct rpc_call_header *ch, /* Build the RPC header and fill in the authorization info. */ static int rpcclnt_buildheader(struct rpcclnt *rpc, int procid, int prog, int vers, - struct xidr *value, FAR const void *request, - size_t *reqlen, FAR void *msgbuf) + FAR const void *request, size_t *reqlen, FAR void *msgbuf) { uint32_t xid; @@ -583,7 +582,6 @@ static int rpcclnt_buildheader(struct rpcclnt *rpc, int procid, int prog, int ve /* Format the message header */ rpcclnt_fmtheader(&callmsg->ch, xid, prog, vers, procid); - value->xid = callmsg->ch.rp_xid; return 0; } } @@ -604,7 +602,6 @@ static int rpcclnt_buildheader(struct rpcclnt *rpc, int procid, int prog, int ve /* Format the message header */ rpcclnt_fmtheader(&callmsg->ch, xid, prog, vers, procid); - value->xid = callmsg->ch.rp_xid; return 0; } else if (procid == RPCMNT_MOUNT) @@ -622,7 +619,6 @@ static int rpcclnt_buildheader(struct rpcclnt *rpc, int procid, int prog, int ve /* Format the message header */ rpcclnt_fmtheader(&callmsg->ch, xid, prog, vers, procid); - value->xid = callmsg->ch.rp_xid; return 0; } } @@ -648,7 +644,6 @@ static int rpcclnt_buildheader(struct rpcclnt *rpc, int procid, int prog, int ve /* Format the message header */ rpcclnt_fmtheader(&callmsg->ch, xid, prog, vers, procid); - value->xid = callmsg->ch.rp_xid; return 0; } @@ -670,7 +665,6 @@ static int rpcclnt_buildheader(struct rpcclnt *rpc, int procid, int prog, int ve /* Format the message header */ rpcclnt_fmtheader(&callmsg->ch, xid, prog, vers, procid); - value->xid = callmsg->ch.rp_xid; return 0; } @@ -692,7 +686,6 @@ static int rpcclnt_buildheader(struct rpcclnt *rpc, int procid, int prog, int ve /* Format the message header */ rpcclnt_fmtheader(&callmsg->ch, xid, prog, vers, procid); - value->xid = callmsg->ch.rp_xid; return 0; } @@ -714,7 +707,6 @@ static int rpcclnt_buildheader(struct rpcclnt *rpc, int procid, int prog, int ve /* Format the message header */ rpcclnt_fmtheader(&callmsg->ch, xid, prog, vers, procid); - value->xid = callmsg->ch.rp_xid; return 0; } @@ -736,7 +728,6 @@ static int rpcclnt_buildheader(struct rpcclnt *rpc, int procid, int prog, int ve /* Format the message header */ rpcclnt_fmtheader(&callmsg->ch, xid, prog, vers, procid); - value->xid = callmsg->ch.rp_xid; return 0; } @@ -755,7 +746,6 @@ static int rpcclnt_buildheader(struct rpcclnt *rpc, int procid, int prog, int ve /* Format the message header */ rpcclnt_fmtheader(&callmsg->ch, xid, prog, vers, procid); - value->xid = callmsg->ch.rp_xid; return 0; } @@ -777,7 +767,6 @@ static int rpcclnt_buildheader(struct rpcclnt *rpc, int procid, int prog, int ve /* Format the message header */ rpcclnt_fmtheader(&callmsg->ch, xid, prog, vers, procid); - value->xid = callmsg->ch.rp_xid; return 0; } @@ -796,7 +785,6 @@ static int rpcclnt_buildheader(struct rpcclnt *rpc, int procid, int prog, int ve /* Format the message header */ rpcclnt_fmtheader(&callmsg->ch, xid, prog, vers, procid); - value->xid = callmsg->ch.rp_xid; return 0; } @@ -818,7 +806,6 @@ static int rpcclnt_buildheader(struct rpcclnt *rpc, int procid, int prog, int ve /* Format the message header */ rpcclnt_fmtheader(&callmsg->ch, xid, prog, vers, procid); - value->xid = callmsg->ch.rp_xid; return 0; } @@ -840,7 +827,6 @@ static int rpcclnt_buildheader(struct rpcclnt *rpc, int procid, int prog, int ve /* Format the message header */ rpcclnt_fmtheader(&callmsg->ch, xid, prog, vers, procid); - value->xid = callmsg->ch.rp_xid; return 0; } @@ -862,7 +848,6 @@ static int rpcclnt_buildheader(struct rpcclnt *rpc, int procid, int prog, int ve /* Format the message header */ rpcclnt_fmtheader(&callmsg->ch, xid, prog, vers, procid); - value->xid = callmsg->ch.rp_xid; return 0; } @@ -881,7 +866,6 @@ static int rpcclnt_buildheader(struct rpcclnt *rpc, int procid, int prog, int ve /* Format the message header */ rpcclnt_fmtheader(&callmsg->ch, xid, prog, vers, procid); - value->xid = callmsg->ch.rp_xid; return 0; } @@ -1253,12 +1237,10 @@ bad: */ int rpcclnt_request(FAR struct rpcclnt *rpc, int procnum, int prog, - int version, - FAR const void *request, size_t reqlen, + int version, FAR const void *request, size_t reqlen, FAR void *response, size_t resplen) { struct rpc_reply_header *replymsg; - struct xidr value; uint32_t tmp; int retries; int error = 0; @@ -1312,7 +1294,7 @@ int rpcclnt_request(FAR struct rpcclnt *rpc, int procnum, int prog, /* Construct the RPC call messasge header */ - error = rpcclnt_buildheader(rpc, procnum, prog, version, &value, + error = rpcclnt_buildheader(rpc, procnum, prog, version, request, &reqlen, callmsg); if (error != OK) { @@ -1324,7 +1306,7 @@ int rpcclnt_request(FAR struct rpcclnt *rpc, int procnum, int prog, * number of re-tries will be attempted, but only for the case of response * timeouts. */ - + retries = 0; do { /* Do the client side RPC. */ @@ -1352,7 +1334,7 @@ int rpcclnt_request(FAR struct rpcclnt *rpc, int procnum, int prog, retries++; } - while (rpc->rc_callflags |= RPCCALL_MUSTRESEND && retries <= RPC_MAXREXMIT); + while ((rpc->rc_callflags & RPCCALL_MUSTRESEND) != 0 && retries <= RPC_MAXREXMIT); if (error != OK) { |