forked from Archive/PX4-Autopilot
NFS updates
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4647 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
parent
31640bb6a6
commit
0073ac83ff
|
@ -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;
|
||||
|
|
|
@ -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 $@
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue