summaryrefslogtreecommitdiff
path: root/nuttx/fs/nfs/nfs_socket.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-04-25 23:22:09 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-04-25 23:22:09 +0000
commit5145ba33ec23c19f84c0d56dc182ea90f7a437d6 (patch)
tree6d8506f771c94896ef7fb4877589980ab413ee05 /nuttx/fs/nfs/nfs_socket.c
parent29d916f11e865afefe144aba44146a7d4acca5e4 (diff)
downloadpx4-nuttx-5145ba33ec23c19f84c0d56dc182ea90f7a437d6.tar.gz
px4-nuttx-5145ba33ec23c19f84c0d56dc182ea90f7a437d6.tar.bz2
px4-nuttx-5145ba33ec23c19f84c0d56dc182ea90f7a437d6.zip
NFS update
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4657 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/fs/nfs/nfs_socket.c')
-rw-r--r--nuttx/fs/nfs/nfs_socket.c52
1 files changed, 24 insertions, 28 deletions
diff --git a/nuttx/fs/nfs/nfs_socket.c b/nuttx/fs/nfs/nfs_socket.c
index 53a68ef1a..1ddfe63c3 100644
--- a/nuttx/fs/nfs/nfs_socket.c
+++ b/nuttx/fs/nfs/nfs_socket.c
@@ -112,54 +112,50 @@ void nfs_init(void)
int nfs_connect(struct nfsmount *nmp)
{
- struct rpcclnt *rpc;
- int error = 0;
+ struct rpcclnt rpc;
if (nmp == NULL)
{
return EFAULT;
}
- rpc = nmp->nm_rpcclnt;
+ //memset(rpc, 0, sizeof(*rpc));
- rpc->rc_prog = &nfs3_program;
+ rpc.rc_prog = &nfs3_program;
- nvdbg("nfsxconnect!\n");
+ nvdbg("nfs connect!\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);
- nfsmnt_to_rpcclnt(nmp->nm_flag, rpc->rc_flag, NOCONN);
- nfsmnt_to_rpcclnt(nmp->nm_flag, rpc->rc_flag, DUMBTIMR);
+ rpc.rc_flag = 0;
+ nfsmnt_to_rpcclnt(nmp->nm_flag, rpc.rc_flag, SOFT);
+ nfsmnt_to_rpcclnt(nmp->nm_flag, rpc.rc_flag, INT);
+ nfsmnt_to_rpcclnt(nmp->nm_flag, rpc.rc_flag, NOCONN);
+ nfsmnt_to_rpcclnt(nmp->nm_flag, rpc.rc_flag, DUMBTIMR);
//rpc->rc_flag |= RPCCLNT_REDIRECT; /* Make this a mount option. */
- rpc->rc_authtype = RPCAUTH_NULL; /* for now */
+ rpc.rc_authtype = RPCAUTH_NULL; /* for now */
//rpc->rc_servername = nmp->nm_mountp->mnt_stat.f_mntfromname;
- rpc->rc_name = nmp->nm_nam;
+ rpc.rc_name = nmp->nm_nam;
- rpc->rc_sotype = nmp->nm_sotype;
- rpc->rc_soproto = nmp->nm_soproto;
- rpc->rc_rsize = (nmp->nm_rsize > nmp->nm_readdirsize) ?
+ rpc.rc_sotype = nmp->nm_sotype;
+ rpc.rc_soproto = nmp->nm_soproto;
+ rpc.rc_rsize = (nmp->nm_rsize > nmp->nm_readdirsize) ?
nmp->nm_rsize : nmp->nm_readdirsize;
- rpc->rc_wsize = nmp->nm_wsize;
- rpc->rc_deadthresh = nmp->nm_deadthresh;
- rpc->rc_timeo = nmp->nm_timeo;
- rpc->rc_retry = nmp->nm_retry;
+ rpc.rc_wsize = nmp->nm_wsize;
+ rpc.rc_deadthresh = nmp->nm_deadthresh;
+ rpc.rc_timeo = nmp->nm_timeo;
+ rpc.rc_retry = nmp->nm_retry;
- /* XXX v2,3 need to use this */
+ /* v3 need to use this */
- rpc->rc_proctlen = 0;
- rpc->rc_proct = NULL;
-
- if (error)
- {
- return error;
- }
+ rpc.rc_proctlen = 0;
+ rpc.rc_proct = NULL;
+
+ nmp->nm_rpcclnt = &rpc;
- return rpcclnt_connect(rpc);
+ return rpcclnt_connect(&rpc);
}
/* NFS disconnect. Clean up and unlink. */