summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-04-23 20:33:25 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-04-23 20:33:25 +0000
commitfaf5098e0f900b5e5fcd6bea40e6ff9ff184e137 (patch)
tree34fc95aa94c99c8990295e1c6db3fe3411a29204
parent942bbb7ad67be9b4117e752fcb4bcac280452f9f (diff)
downloadnuttx-faf5098e0f900b5e5fcd6bea40e6ff9ff184e137.tar.gz
nuttx-faf5098e0f900b5e5fcd6bea40e6ff9ff184e137.tar.bz2
nuttx-faf5098e0f900b5e5fcd6bea40e6ff9ff184e137.zip
NFS updates
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4647 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r--apps/nshlib/nsh_fscmds.c16
-rw-r--r--nuttx/fs/Makefile2
-rw-r--r--nuttx/fs/nfs/Make.defs2
-rw-r--r--nuttx/fs/nfs/nfs_socket.c5
-rw-r--r--nuttx/fs/nfs/nfs_vfsops.c1
-rw-r--r--nuttx/include/nuttx/fs/nfs.h40
-rw-r--r--nuttx/net/net_monitor.c1
7 files changed, 13 insertions, 54 deletions
diff --git a/apps/nshlib/nsh_fscmds.c b/apps/nshlib/nsh_fscmds.c
index db01d6d90..b1a0963cf 100644
--- a/apps/nshlib/nsh_fscmds.c
+++ b/apps/nshlib/nsh_fscmds.c
@@ -55,7 +55,7 @@
# include <nuttx/fs/mkfatfs.h>
# endif
# ifdef CONFIG_NFS
-# include <netinet/in.h>
+# include <sys/socket.h>
# include <nuttx/fs/nfs.h>
# endif
#endif
@@ -1230,8 +1230,8 @@ int cmd_nfsmount(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
#else
struct in_addr inaddr;
#endif
+ bool tcp = false;
int ret;
- int tcp = 0;
/* Get the NFS mount options */
@@ -1267,15 +1267,11 @@ int cmd_nfsmount(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
if (protocol)
{
- if (!strncmp(protocol, "tcp", 3))
+ if (strncmp(protocol, "tcp", 3) == 0)
{
- tcp = 1;
+ tcp = true;
}
- else if (!strncmp(protocol, "udp", 3))
- {
- tcp = 0;
- }
- else
+ else if (!strncmp(protocol, "udp", 3) != 0)
{
nsh_output(vtbl, g_fmtarginvalid, argv[0]);
badarg = true;
@@ -1344,7 +1340,7 @@ int cmd_nfsmount(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
memset(&data, 0, sizeof(data));
data.version = 3;
data.proto = (tcp) ? 6 : 17;
- dato.sotype = (tcp) ? 0 : 1;
+ data.sotype = (tcp) ? 0 : 1;
sin->sin_family = 2;
sin->sin_port = htons(2049);
sin->sin_addr = inaddr;
diff --git a/nuttx/fs/Makefile b/nuttx/fs/Makefile
index 57a01c9c4..00227e1d0 100644
--- a/nuttx/fs/Makefile
+++ b/nuttx/fs/Makefile
@@ -115,7 +115,7 @@ $(BIN): $(OBJS)
done ; )
.depend: Makefile $(SRCS)
- @$(MKDEP) --dep-path . $(MMAPDEPPATH) $(FATDEPPATH) $(ROMFSDEPPATH) $(NXFFSDEPPATH) \
+ @$(MKDEP) --dep-path . $(MMAPDEPPATH) $(FATDEPPATH) $(ROMFSDEPPATH) $(NXFFSDEPPATH) $(NFSDEPPATH) \
$(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
@touch $@
diff --git a/nuttx/fs/nfs/Make.defs b/nuttx/fs/nfs/Make.defs
index bfe1265c3..c3c323bc3 100644
--- a/nuttx/fs/nfs/Make.defs
+++ b/nuttx/fs/nfs/Make.defs
@@ -46,5 +46,5 @@ CSRCS += rpc_clnt.c nfs_socket.c nfs_util.c nfs_vfsops.c
# Argument for dependency checking
-NFSDEPPATH = --dep-path rpc
+NFSDEPPATH = --dep-path nfs
endif
diff --git a/nuttx/fs/nfs/nfs_socket.c b/nuttx/fs/nfs/nfs_socket.c
index feb405719..d659a097e 100644
--- a/nuttx/fs/nfs/nfs_socket.c
+++ b/nuttx/fs/nfs/nfs_socket.c
@@ -48,6 +48,7 @@
#include <nuttx/fs/nfs.h>
+#include "nfs.h"
#include "rpc.h"
#include "rpc_v2.h"
#include "nfs_proto.h"
@@ -219,12 +220,12 @@ tryagain:
if (error == ESTALE)
{
ndbg("%s: ESTALE on mount from server \n",
- nmp->nm_rpcclnt.rc_prog->prog_name);
+ nmp->nm_rpcclnt->rc_prog->prog_name);
}
else
{
ndbg("%s: unknown error %d from server \n",
- nmp->nm_rpcclnt.rc_prog->prog_name, error);
+ nmp->nm_rpcclnt->rc_prog->prog_name, error);
}
goto out;
diff --git a/nuttx/fs/nfs/nfs_vfsops.c b/nuttx/fs/nfs/nfs_vfsops.c
index 89f135d7c..478271419 100644
--- a/nuttx/fs/nfs/nfs_vfsops.c
+++ b/nuttx/fs/nfs/nfs_vfsops.c
@@ -69,6 +69,7 @@
#include <net/if.h>
#include <netinet/in.h>
+#include "nfs.h"
#include "rpc_v2.h"
#include "rpc.h"
#include "nfs_proto.h"
diff --git a/nuttx/include/nuttx/fs/nfs.h b/nuttx/include/nuttx/fs/nfs.h
index b0ded4db4..08f9b94ca 100644
--- a/nuttx/include/nuttx/fs/nfs.h
+++ b/nuttx/include/nuttx/fs/nfs.h
@@ -269,46 +269,6 @@ struct nfsd_srvargs
};
#endif
-/* Stats structure */
-
-struct nfsstats
-{
- uint64_t attrcache_hits;
- uint64_t attrcache_misses;
- uint64_t lookupcache_hits;
- uint64_t lookupcache_misses;
- uint64_t direofcache_hits;
- uint64_t direofcache_misses;
- uint64_t biocache_reads;
- uint64_t read_bios;
- uint64_t read_physios;
- uint64_t biocache_writes;
- uint64_t write_bios;
- uint64_t write_physios;
- uint64_t biocache_readlinks;
- uint64_t readlink_bios;
- uint64_t biocache_readdirs;
- uint64_t readdir_bios;
- uint64_t rpccnt[NFS_NPROCS];
- uint64_t rpcretries;
- uint64_t srvrpccnt[NFS_NPROCS];
- uint64_t srvrpc_errs;
- uint64_t srv_errs;
- uint64_t rpcrequests;
- uint64_t rpctimeouts;
- uint64_t rpcunexpected;
- uint64_t rpcinvalid;
- uint64_t srvcache_inproghits;
- uint64_t srvcache_idemdonehits;
- uint64_t srvcache_nonidemdonehits;
- uint64_t srvcache_misses;
- uint64_t forcedsync;
- uint64_t srvnqnfs_leases;
- uint64_t srvnqnfs_maxleases;
- uint64_t srvnqnfs_getleases;
- uint64_t srvvop_writes;
-};
-
#ifdef COMP
/* The set of signals the interrupt an I/O in progress for NFSMNT_INT mounts.
* What should be in this set is open to debate, but I believe that since
diff --git a/nuttx/net/net_monitor.c b/nuttx/net/net_monitor.c
index 40d4196b2..4bdae4ccf 100644
--- a/nuttx/net/net_monitor.c
+++ b/nuttx/net/net_monitor.c
@@ -41,6 +41,7 @@
#if defined(CONFIG_NET) && defined(CONFIG_NET_TCP)
#include <stdint.h>
+#include <assert.h>
#include <debug.h>
#include "net_internal.h"