NFS update

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4809 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2012-06-07 01:03:34 +00:00
parent 1e5f276ad9
commit d21c3b70dd
6 changed files with 310 additions and 459 deletions
+10 -9
View File
@@ -124,13 +124,13 @@ int nfs_connect(struct nfsmount *nmp)
rpc = (struct rpcclnt *)kzalloc(sizeof(struct rpcclnt));
if (!rpc)
{
fdbg("Failed to allocate rpc structure\n");
fdbg("ERROR: Failed to allocate rpc structure\n");
return -ENOMEM;
}
rpc->rc_prog = &nfs3_program;
fvdbg("nfs connect!\n");
fvdbg("Connecting\n");
/* translate nfsmnt flags -> rpcclnt flags */
@@ -181,12 +181,12 @@ void nfs_safedisconnect(struct nfsmount *nmp)
#endif
int nfs_request(struct nfsmount *nmp, int procnum, FAR const void *datain,
FAR void *dataout)
FAR void *dataout, size_t len)
{
int error;
struct rpcclnt *clnt= nmp->nm_rpcclnt;
struct rpcclnt *clnt= nmp->nm_rpcclnt;
struct rpc_reply_header replyh;
int trylater_delay;
int error;
tryagain:
@@ -194,13 +194,14 @@ tryagain:
error = rpcclnt_request(clnt, procnum, nmp->nm_rpcclnt->rc_prog->prog_id,
nmp->nm_rpcclnt->rc_prog->prog_version, dataout,
datain);
datain, len);
if (error != 0)
{
fdbg("ERROR: rpcclnt_request failed: %d\n", error);
goto out;
}
bcopy(dataout, &replyh, sizeof(replyh));
bcopy(dataout, &replyh, sizeof(struct rpc_reply_header));
if (replyh.rpc_verfi.authtype != 0)
{
@@ -224,12 +225,12 @@ tryagain:
if (error == ESTALE)
{
fdbg("%s: ESTALE on mount from server \n",
fdbg("ERROR %s: ESTALE on mount from server\n",
nmp->nm_rpcclnt->rc_prog->prog_name);
}
else
{
fdbg("%s: unknown error %d from server \n",
fdbg("ERROR %s: unknown error %d from server\n",
nmp->nm_rpcclnt->rc_prog->prog_name, error);
}
+1 -1
View File
@@ -61,7 +61,7 @@ EXTERN void nfs_disconnect(struct nfsmount *);
EXTERN int nfs_sigintr(struct nfsmount *, struct nfsreq *, cthread_t *);
EXTERN void nfs_safedisconnect(struct nfsmount *);
#endif
EXTERN int nfs_request(struct nfsmount *, int, FAR const void *, FAR void *);
EXTERN int nfs_request(struct nfsmount *, int, FAR const void *, FAR void *, size_t);
#undef COMP
#ifdef COMP
EXTERN int nfs_nmcancelreqs(struct nfsmount *);
+152 -113
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -543,7 +543,7 @@ int rpcclnt_reconnect(struct rpctask *);
void rpcclnt_disconnect(struct rpcclnt *);
int rpcclnt_umount(struct rpcclnt *);
void rpcclnt_safedisconnect(struct rpcclnt *);
int rpcclnt_request(struct rpcclnt *, int, int, int, void *, FAR const void *);
int rpcclnt_request(struct rpcclnt *, int, int, int, void *, FAR const void *, size_t);
#undef COMP
#ifdef COMP
int rpcclnt_cancelreqs(struct rpcclnt *);
+133 -322
View File
File diff suppressed because it is too large Load Diff
+13 -13
View File
@@ -63,26 +63,26 @@
struct nfs_args
{
uint8_t version; /* args structure version number */
struct sockaddr addr; /* file server address */
uint8_t addrlen; /* length of address */
uint8_t version; /* Args structure version number */
uint8_t addrlen; /* Length of address */
uint8_t sotype; /* Socket type */
uint8_t proto; /* and Protocol */
int flags; /* flags */
int wsize; /* write size in bytes */
int rsize; /* read size in bytes */
int flags; /* Flags */
int wsize; /* Write size in bytes */
int rsize; /* Read size in bytes */
int readdirsize; /* readdir size in bytes */
int timeo; /* initial timeout in .1 secs */
int retrans; /* times to retry send */
int timeo; /* Initial timeout in .1 secs */
int retrans; /* Times to retry send */
//int maxgrouplist; /* Max. size of group list */
//int readahead; /* # of blocks to readahead */
//int leaseterm; /* Term (sec) of lease */
//int deadthresh; /* Retrans threshold */
char *path; /* server's path of the directory being mount */
int acregmin; /* cache attrs for reg files min time */
int acregmax; /* cache attrs for reg files max time */
int acdirmin; /* cache attrs for dirs min time */
int acdirmax; /* cache attrs for dirs max time */
char *path; /* Server's path of the directory being mount */
int acregmin; /* Cache attrs for reg files min time */
int acregmax; /* Cache attrs for reg files max time */
int acdirmin; /* Cache attrs for dirs min time */
int acdirmax; /* Cache attrs for dirs max time */
struct sockaddr addr; /* File server address (requires 32-bit alignment) */
};
/****************************************************************************