mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-26 14:13:34 +08:00
NFS update + another NX console driver file
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4525 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
+1
-1
@@ -81,7 +81,7 @@
|
||||
|
||||
#define NFS_CMPFH(n, f, s) \
|
||||
((n)->n_fhsize == (s) && !bcmp((void *)(n)->n_fhp, (void *)(f), (s)))
|
||||
#define NFS_ISV3(v) (VFSTONFS((v)->v_mount)->nm_flag & NFSMNT_NFSV3)
|
||||
#define NFS_ISV3(i) (VFSTONFS((i)->f_inode)->nm_flag & NFSMNT_NFSV3)
|
||||
#define NFS_SRVMAXDATA(n) \
|
||||
(((n)->nd_flag & ND_NFSV3) ? (((n)->nd_nam2) ? \
|
||||
NFS_MAXDGRAMDATA : NFS_MAXDATA) : NFS_V2MAXDATA)
|
||||
|
||||
@@ -127,7 +127,7 @@ struct nfs_args
|
||||
int addrlen; /* length of address */
|
||||
int sotype; /* Socket type */
|
||||
int proto; /* and Protocol */
|
||||
unsigned char *fh; /* File handle to be mounted */
|
||||
nfsfh_t *fh; /* File handle to be mounted */
|
||||
int fhsize; /* Size, in bytes, of fh */
|
||||
int flags; /* flags */
|
||||
int wsize; /* write size in bytes */
|
||||
|
||||
@@ -73,6 +73,8 @@ struct nfsmount
|
||||
int nm_flag; /* Flags for soft/hard... */
|
||||
int nm_state; /* Internal state flags */
|
||||
struct inode *nm_mountp; /* Vfs structure for this filesystem */
|
||||
struct nfsnode *nfs_head; /* A list to all files opened on this mountpoint */
|
||||
bool nfs_mounted; /* true: The file system is ready */
|
||||
int nm_numgrps; /* Max. size of groupslist */
|
||||
nfsfh_t nm_fh; /* File handle of root dir */
|
||||
int nm_fhsize; /* Size of root file handle */
|
||||
@@ -114,7 +116,6 @@ void nfs_decode_args(struct nfsmount *, struct nfs_args *, struct nfs_args *);
|
||||
int nfs_start(struct mount *, int, struct proc *);
|
||||
int nfs_unmount(struct mount *, int, struct proc *);
|
||||
int nfs_root(struct mount *, struct vnode **);
|
||||
int nfs_quotactl(struct mount *, int, uid_t, caddr_t, struct proc *);
|
||||
int nfs_statfs(struct mount *, struct statfs *, struct proc *);
|
||||
int nfs_sync(struct mount *, int, struct ucred *, struct proc *);
|
||||
int nfs_vget(struct mount *, ino_t, struct vnode **);
|
||||
|
||||
+29
-35
@@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* fs/nfs/nfs_mount.h
|
||||
* fs/nfs/nfs_node.h
|
||||
*
|
||||
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2012 Jose Pablo Rojas Vargas. All rights reserved.
|
||||
@@ -47,11 +47,7 @@
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef _NFS_NFS_H_
|
||||
# include <nfs/nfs.h>
|
||||
#endif
|
||||
|
||||
#include <sys/rwlock.h>
|
||||
#include "nfs.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
@@ -115,43 +111,41 @@ struct sillyrename
|
||||
|
||||
struct nfsnode
|
||||
{
|
||||
RB_ENTRY(nfsnode) n_entry; /* filehandle/node tree. */
|
||||
uint64_t n_size; /* Current size of file */
|
||||
//struct vattr n_vattr; /* Vnode attribute cache */
|
||||
time_t n_attrstamp; /* Attr. cache timestamp */
|
||||
struct timespec n_mtime; /* Prev modify time. */
|
||||
time_t n_ctime; /* Prev create time. */
|
||||
nfsfh_t *n_fhp; /* NFS File Handle */
|
||||
struct inode *n_inode; /* associated inode */
|
||||
//struct lockf *n_lockf; /* Locking record of file */
|
||||
int n_error; /* Save write error value */
|
||||
struct nfsnode *nfs_next; /* Retained in a singly linked list filehandle/node tree. */
|
||||
bool nfs_open; /* true: The file is (still) open */
|
||||
uint64_t n_size; /* Current size of file */
|
||||
struct nfs_fattr n_fattr; /* nfs file attribute cache */
|
||||
time_t n_attrstamp; /* Attr. cache timestamp */
|
||||
struct timespec n_mtime; /* Prev modify time. */
|
||||
time_t n_ctime; /* Prev create time. */
|
||||
nfsfh_t *n_fhp; /* NFS File Handle */
|
||||
nfstype nfsv3_type; /* File type */
|
||||
struct inode *n_inode; /* associated inode */
|
||||
int n_error; /* Save write error value */
|
||||
union
|
||||
{
|
||||
struct timespec nf_atim; /* Special file times */
|
||||
nfsuint64 nd_cookieverf; /* Cookie verifier (dir only) */
|
||||
struct timespec nf_atim; /* Special file times */
|
||||
nfsuint64 nd_cookieverf; /* Cookie verifier (dir only) */
|
||||
} n_un1;
|
||||
union
|
||||
{
|
||||
struct timespec nf_mtim;
|
||||
off_t nd_direof; /* Dir. EOF offset cache */
|
||||
off_t nd_direof; /* Dir. EOF offset cache */
|
||||
} n_un2;
|
||||
//struct sillyrename *n_sillyrename; /* Ptr to silly rename struct */
|
||||
short n_fhsize; /* size in bytes, of fh */
|
||||
short n_flag; /* Flag for locking.. */
|
||||
nfsfh_t n_fh; /* Small File Handle */
|
||||
time_t n_accstamp; /* Access cache timestamp */
|
||||
uid_t n_accuid; /* Last access requester */
|
||||
int n_accmode; /* Last mode requested */
|
||||
int n_accerror; /* Last returned error */
|
||||
//struct ucred *n_rcred;
|
||||
//struct ucred *n_wcred;
|
||||
short n_fhsize; /* size in bytes, of fh */
|
||||
short n_flag; /* Flag for locking.. */
|
||||
nfsfh_t n_fh; /* Small File Handle */
|
||||
time_t n_accstamp; /* Access cache timestamp */
|
||||
uid_t n_accuid; /* Last access requester */
|
||||
int n_accmode; /* Last mode requested */
|
||||
int n_accerror; /* Last returned error */
|
||||
|
||||
off_t n_pushedlo; /* 1st blk in commited range */
|
||||
off_t n_pushedhi; /* Last block in range */
|
||||
off_t n_pushlo; /* 1st block in commit range */
|
||||
off_t n_pushhi; /* Last block in range */
|
||||
//struct rwlock n_commitlock; /* Serialize commits */
|
||||
int n_commitflags;
|
||||
off_t n_pushedlo; /* 1st blk in commited range */
|
||||
off_t n_pushedhi; /* Last block in range */
|
||||
off_t n_pushlo; /* 1st block in commit range */
|
||||
off_t n_pushhi; /* Last block in range */
|
||||
//struct rwlock n_commitlock; /* Serialize commits */
|
||||
int n_commitflags;
|
||||
};
|
||||
|
||||
#endif /* __FS_NFS_NFS_NODE_H */
|
||||
|
||||
@@ -80,7 +80,7 @@ static struct rpc_program nfs3_program =
|
||||
* Public Variables
|
||||
****************************************************************************/
|
||||
|
||||
int nfs_ticks;
|
||||
int nfs_ticks = rpcclnt_ticks;
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
@@ -158,7 +158,7 @@ void nfsx_safedisconnect(struct nfsmount *nmp)
|
||||
}
|
||||
#endif
|
||||
|
||||
int nfsx_request_xx(struct nfsmount *nm, int procnum)
|
||||
int nfsx_request_xx(struct nfsmount *nm, int procnum, void *data)
|
||||
{
|
||||
int error;
|
||||
struct nfsmount *nmp;
|
||||
@@ -176,6 +176,7 @@ tryagain:
|
||||
if ((error = rpcclnt_request(clnt, procnum, &reply)) != 0)
|
||||
goto out;
|
||||
|
||||
data = reply->where;
|
||||
|
||||
if (reply->rpc_verfi.authtype != 0)
|
||||
{
|
||||
|
||||
+1167
-447
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -158,6 +158,8 @@ struct rpc_reply
|
||||
uint32_t type;
|
||||
uint32_t status;
|
||||
|
||||
void where; /* Data */
|
||||
|
||||
/* used only when reply == RPC_MSGDENIED and status == RPC_AUTHERR */
|
||||
|
||||
uint32_t autherr;
|
||||
|
||||
@@ -1163,6 +1163,7 @@ int rpcclnt_request(struct rpcclnt *rpc, int procnum, struct rpc_reply *reply)
|
||||
if (reply->stat.status == RPC_SUCCESS)
|
||||
{
|
||||
printf("RPC_SUCCESS");
|
||||
reply->where = replysvr->where;
|
||||
}
|
||||
else if (reply->stat.status == RPC_PROGMISMATCH)
|
||||
{
|
||||
|
||||
@@ -1,80 +0,0 @@
|
||||
/****************************************************************************
|
||||
* fs/nfs/rpc_types.h
|
||||
*
|
||||
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2012 Jose Pablo Rojas Vargas. All rights reserved.
|
||||
* Author: Jose Pablo Rojas Vargas <jrojas@nx-engineering.com>
|
||||
*
|
||||
* Leveraged from OpenBSD:
|
||||
*
|
||||
* Copyright (c) 1982, 1986, 1988, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __FS_NFS_RPC_TYPES_H
|
||||
#define __FS_NFS_RPC_TYPES_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <time.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************/
|
||||
|
||||
struct lock
|
||||
{
|
||||
int dummy;
|
||||
};
|
||||
|
||||
struct componentname
|
||||
{
|
||||
/* Arguments to lookup. */
|
||||
|
||||
unsigned long cn_nameiop; /* namei operation */
|
||||
uint64_t cn_flags; /* flags to namei */
|
||||
struct thread *cn_thread; /* thread requesting lookup */
|
||||
struct ucred *cn_cred; /* credentials */
|
||||
int cn_lkflags; /* Lock flags LK_EXCLUSIVE or LK_SHARED */
|
||||
|
||||
/* Shared between lookup and commit routines. */
|
||||
|
||||
char *cn_pnbuf; /* pathname buffer */
|
||||
char *cn_nameptr; /* pointer to looked up name */
|
||||
long cn_namelen; /* length of looked up component */
|
||||
long cn_consume; /* chars to consume in lookup() */
|
||||
};
|
||||
|
||||
#endif /* __FS_NFS_RPC_TYPES_H */
|
||||
Reference in New Issue
Block a user