summaryrefslogtreecommitdiff
path: root/nuttx/fs/nfs/nfs_socket.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-04-14 00:27:44 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-04-14 00:27:44 +0000
commit2d21e7c1871fba26eded74e19451c75a53252010 (patch)
tree403582e0c293d0bef2e51306de8d6a2982a7f279 /nuttx/fs/nfs/nfs_socket.c
parent2bdc64a2f96ff952826ad25aecd426f6788c7c31 (diff)
downloadpx4-nuttx-2d21e7c1871fba26eded74e19451c75a53252010.tar.gz
px4-nuttx-2d21e7c1871fba26eded74e19451c75a53252010.tar.bz2
px4-nuttx-2d21e7c1871fba26eded74e19451c75a53252010.zip
NFS client update
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4605 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/fs/nfs/nfs_socket.c')
-rw-r--r--nuttx/fs/nfs/nfs_socket.c57
1 files changed, 36 insertions, 21 deletions
diff --git a/nuttx/fs/nfs/nfs_socket.c b/nuttx/fs/nfs/nfs_socket.c
index c1953369c..663cf8e26 100644
--- a/nuttx/fs/nfs/nfs_socket.c
+++ b/nuttx/fs/nfs/nfs_socket.c
@@ -61,11 +61,13 @@
/* Flag translations */
-#define nfsmnt_to_rpcclnt(nf, rf, name) do { \
- if (nf & NFSMNT_##name) { \
- rf |= RPCCLNT_##name; \
- } \
-} while(0)
+#define nfsmnt_to_rpcclnt(nf, rf, name) do \
+ { \
+ if (nf & NFSMNT_##name) \
+ { \
+ rf |= RPCCLNT_##name; \
+ } \
+ } while(0)
/****************************************************************************
* Private Variables
@@ -101,15 +103,18 @@ int nfsx_connect(struct nfsmount *nmp)
int error = 0;
if (nmp == NULL)
- return EFAULT;
+ {
+ return EFAULT;
+ }
rpc = &nmp->nm_rpcclnt;
rpc->rc_prog = &nfs3_program;
- printf("nfsxconnect!\n");
+ nvdbg("nfsxconnect!\n");
/* translate nfsmnt flags -> rpcclnt flags */
+
rpc->rc_flag = 0;
nfsmnt_to_rpcclnt(nmp->nm_flag, rpc->rc_flag, SOFT);
nfsmnt_to_rpcclnt(nmp->nm_flag, rpc->rc_flag, INT);
@@ -132,11 +137,14 @@ int nfsx_connect(struct nfsmount *nmp)
rpc->rc_retry = nmp->nm_retry;
/* XXX v2,3 need to use this */
+
rpc->rc_proctlen = 0;
rpc->rc_proct = NULL;
if (error)
- return error;
+ {
+ return error;
+ }
return rpcclnt_connect(rpc);
}
@@ -155,7 +163,7 @@ void nfsx_safedisconnect(struct nfsmount *nmp)
}
#endif
-int nfsx_request_xx(struct nfsmount *nm, int procnum, void *data)
+int nfsx_request_xx(struct nfsmount *nm, int procnum,void *datain, void *dataout)
{
int error;
struct nfsmount *nmp;
@@ -170,10 +178,12 @@ tryagain:
memset(reply, 0, sizeof(struct rpc_reply));
- if ((error = rpcclnt_request(clnt, procnum, reply)) != 0)
- goto out;
+ if ((error = rpcclnt_request(clnt, procnum, reply, datain)) != 0)
+ {
+ goto out;
+ }
- data = reply->stat.where;
+ dataout = reply->stat.where;
if (reply->rpc_verfi.authtype != 0)
{
@@ -190,22 +200,27 @@ tryagain:
goto tryagain;
}
- /*
- ** If the File Handle was stale, invalidate the
- ** lookup cache, just in case.
- **/
+ /* If the File Handle was stale, invalidate the
+ * lookup cache, just in case.
+ */
+
if (error == ESTALE)
- printf("%s: ESTALE on mount from server \n",
- nmp->nm_rpcclnt.rc_prog->prog_name);
+ {
+ ndbg("%s: ESTALE on mount from server \n",
+ nmp->nm_rpcclnt.rc_prog->prog_name);
+ }
else
- printf("%s: unknown error %d from server \n",
+ {
+ ndbg("%s: unknown error %d from server \n",
nmp->nm_rpcclnt.rc_prog->prog_name, error);
+ }
+
goto out;
}
- return (0);
+ return 0;
out:
- return (error);
+ return error;
}
/* terminate any outstanding RPCs. */