mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 09:18:00 +08:00
NFS client FS update
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4622 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
+1
-1
@@ -42,7 +42,7 @@ CSRCS +=
|
||||
# Files required for NFS RPC
|
||||
|
||||
ASRCS +=
|
||||
CSRCS += rpc_clnt.c nfs_socket.c
|
||||
CSRCS += rpc_clnt.c nfs_socket.c nfs_util.c nfs_vfsops.c
|
||||
|
||||
# Argument for dependency checking
|
||||
|
||||
|
||||
-113
@@ -270,11 +270,6 @@ struct nfsstats
|
||||
* by them and break.
|
||||
*/
|
||||
|
||||
struct uio;
|
||||
struct buf;
|
||||
struct vattr;
|
||||
struct nameidata; /* XXX */
|
||||
|
||||
/* Nfs outstanding request list element */
|
||||
|
||||
struct nfsreq
|
||||
@@ -338,114 +333,6 @@ struct nfsrv_descript
|
||||
uint32_t nd_retxid; /* Reply xid */
|
||||
};
|
||||
|
||||
/* NFS procedures args */
|
||||
|
||||
struct wcc_attr
|
||||
{
|
||||
nfsuint64 size;
|
||||
nfstime3 mtime;
|
||||
nfstime3 ctime;
|
||||
}
|
||||
|
||||
struct wcc_data
|
||||
{
|
||||
wcc_attr before;
|
||||
nfs_fattr after;
|
||||
};
|
||||
|
||||
struct diropargs3
|
||||
{
|
||||
nfsfh_t dir;
|
||||
const char name;
|
||||
};
|
||||
|
||||
struct CREATE3args
|
||||
{
|
||||
diropargs3 where;
|
||||
nfsv3_sattr how;
|
||||
};
|
||||
|
||||
struct CREATE3resok
|
||||
{
|
||||
const char handle;
|
||||
nfs_fattr attributes;
|
||||
wcc_data dir_wcc;
|
||||
};
|
||||
|
||||
struct READ3args
|
||||
{
|
||||
nfstype file;
|
||||
uint64_t offset;
|
||||
uint32_t count;
|
||||
};
|
||||
|
||||
struct READ3resok
|
||||
{
|
||||
nfs_fattr file_attributes;
|
||||
uint32_t count;
|
||||
bool eof;
|
||||
const char data;
|
||||
};
|
||||
|
||||
enum stable_how
|
||||
{
|
||||
UNSTABLE = 0,
|
||||
DATA_SYNC = 1,
|
||||
FILE_SYNC = 2
|
||||
};
|
||||
|
||||
struct WRITE3args
|
||||
{
|
||||
nfstype file;
|
||||
uint64_t offset;
|
||||
uint32_t count;
|
||||
stable_how stable;
|
||||
const char data;
|
||||
};
|
||||
|
||||
struct WRITE3resok
|
||||
{
|
||||
wcc_data file_wcc;
|
||||
count3 count;
|
||||
stable_how committed;
|
||||
unsigned char verf;
|
||||
};
|
||||
|
||||
struct REMOVE3args
|
||||
{
|
||||
diropargs3 object;
|
||||
};
|
||||
|
||||
struct REMOVE3resok
|
||||
{
|
||||
wcc_data dir_wcc;
|
||||
};
|
||||
|
||||
struct RENAME3args
|
||||
{
|
||||
diropargs3 from;
|
||||
diropargs3 to;
|
||||
};
|
||||
|
||||
struct RENAME3resok
|
||||
{
|
||||
wcc_data fromdir_wcc;
|
||||
wcc_data todir_wcc;
|
||||
};
|
||||
|
||||
struct MKDIR3args
|
||||
{
|
||||
diropargs3 where;
|
||||
nfsv3_sattr attributes;
|
||||
};
|
||||
|
||||
struct MKDIR3resok
|
||||
{
|
||||
const char handle;
|
||||
nfs_fattr obj_attributes;
|
||||
wcc_data dir_wcc;
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
+2
-19
@@ -75,7 +75,7 @@ struct nfsmount
|
||||
int nm_numgrps; /* Max. size of groupslist */
|
||||
nfsfh_t nm_fh; /* File handle of root dir */
|
||||
int nm_fhsize; /* Size of root file handle */
|
||||
struct rpcclnt nm_rpcclnt; /* rpc state */
|
||||
struct rpcclnt *nm_rpcclnt; /* rpc state */
|
||||
struct socket *nm_so; /* Rpc socket */
|
||||
int nm_sotype; /* Type of socket */
|
||||
int nm_soproto; /* and protocol */
|
||||
@@ -99,24 +99,7 @@ struct nfsmount
|
||||
int nm_acregmax; /* Reg file attr cache max lifetime */
|
||||
unsigned char nm_verf[NFSX_V3WRITEVERF]; /* V3 write verifier */
|
||||
//char nm_mntonname[90]; /* directory on which mounted */
|
||||
uint8_t *nm_buffer; /* This is an allocated buffer to hold one sector*/
|
||||
//uint8_t *nm_buffer; /* This is an allocated buffer to hold one sector*/
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/* Prototypes for NFS mount operations: */
|
||||
|
||||
int nfs_mount(struct inode *, const char *, void *);
|
||||
int mountnfs(struct nfs_args *, struct inode *, char *, char *);
|
||||
void nfs_decode_args(struct nfsmount *, struct nfs_args *, struct nfs_args *);
|
||||
int nfs_unmount(struct inode *, int);
|
||||
int nfs_root(struct inode *, struct file **);
|
||||
int nfs_statfs(struct inode *, struct statfs *);
|
||||
int nfs_sync(struct inode *, int);
|
||||
int nfs_vget(struct inode *, ino_t, struct file **);
|
||||
int nfs_fsinfo(struct nfsmount *, struct file *);
|
||||
void nfs_init(void);
|
||||
|
||||
#endif
|
||||
|
||||
+156
-7
@@ -430,6 +430,7 @@ struct nfsv3_sattr
|
||||
|
||||
struct nfs_statfs
|
||||
{
|
||||
struct nfs_fattr obj_attributes;
|
||||
union
|
||||
{
|
||||
struct
|
||||
@@ -468,6 +469,7 @@ struct nfs_statfs
|
||||
|
||||
struct nfsv3_fsinfo
|
||||
{
|
||||
struct nfs_fattr obj_attributes;
|
||||
uint32_t fs_rtmax;
|
||||
uint32_t fs_rtpref;
|
||||
uint32_t fs_rtmult;
|
||||
@@ -480,14 +482,161 @@ struct nfsv3_fsinfo
|
||||
uint32_t fs_properties;
|
||||
};
|
||||
|
||||
struct nfsv3_pathconf
|
||||
/* NFS procedures args */
|
||||
|
||||
struct wcc_attr
|
||||
{
|
||||
uint32_t pc_linkmax;
|
||||
uint32_t pc_namemax;
|
||||
uint32_t pc_notrunc;
|
||||
uint32_t pc_chownrestricted;
|
||||
uint32_t pc_caseinsensitive;
|
||||
uint32_t pc_casepreserving;
|
||||
nfsuint64 size;
|
||||
nfstime3 mtime;
|
||||
nfstime3 ctime;
|
||||
};
|
||||
|
||||
struct wcc_data
|
||||
{
|
||||
struct wcc_attr before;
|
||||
struct nfs_fattr after;
|
||||
};
|
||||
|
||||
struct diropargs3
|
||||
{
|
||||
nfsfh_t dir;
|
||||
const char name;
|
||||
};
|
||||
|
||||
struct CREATE3args
|
||||
{
|
||||
struct diropargs3 where;
|
||||
struct nfsv3_sattr how;
|
||||
};
|
||||
|
||||
struct CREATE3resok
|
||||
{
|
||||
nfsfh_t handle;
|
||||
struct nfs_fattr attributes;
|
||||
struct wcc_data dir_wcc;
|
||||
};
|
||||
|
||||
struct READ3args
|
||||
{
|
||||
nfstype file;
|
||||
uint64_t offset;
|
||||
uint32_t count;
|
||||
};
|
||||
|
||||
struct READ3resok
|
||||
{
|
||||
struct nfs_fattr file_attributes;
|
||||
uint32_t count;
|
||||
bool eof;
|
||||
const char data;
|
||||
};
|
||||
|
||||
enum stable_how
|
||||
{
|
||||
UNSTABLE = 0,
|
||||
DATA_SYNC = 1,
|
||||
FILE_SYNC = 2
|
||||
};
|
||||
|
||||
struct WRITE3args
|
||||
{
|
||||
nfstype file;
|
||||
uint64_t offset;
|
||||
uint32_t count;
|
||||
enum stable_how stable;
|
||||
const char data;
|
||||
};
|
||||
|
||||
struct WRITE3resok
|
||||
{
|
||||
struct wcc_data file_wcc;
|
||||
uint32_t count;
|
||||
enum stable_how committed;
|
||||
unsigned char verf;
|
||||
};
|
||||
|
||||
struct REMOVE3args
|
||||
{
|
||||
struct diropargs3 object;
|
||||
};
|
||||
|
||||
struct REMOVE3resok
|
||||
{
|
||||
struct wcc_data dir_wcc;
|
||||
};
|
||||
|
||||
struct RENAME3args
|
||||
{
|
||||
struct diropargs3 from;
|
||||
struct diropargs3 to;
|
||||
};
|
||||
|
||||
struct RENAME3resok
|
||||
{
|
||||
struct wcc_data fromdir_wcc;
|
||||
struct wcc_data todir_wcc;
|
||||
};
|
||||
|
||||
struct MKDIR3args
|
||||
{
|
||||
struct diropargs3 where;
|
||||
struct nfsv3_sattr attributes;
|
||||
};
|
||||
|
||||
struct MKDIR3resok
|
||||
{
|
||||
nfsfh_t handle;
|
||||
struct nfs_fattr obj_attributes;
|
||||
struct wcc_data dir_wcc;
|
||||
};
|
||||
|
||||
struct RMDIR3args
|
||||
{
|
||||
struct diropargs3 object;
|
||||
};
|
||||
|
||||
struct RMDIR3resok
|
||||
{
|
||||
struct wcc_data dir_wcc;
|
||||
};
|
||||
|
||||
struct READDIR3args
|
||||
{
|
||||
nfsfh_t dir;
|
||||
nfsuint64 cookie;
|
||||
nfsuint64 cookieverf;
|
||||
uint32_t count;
|
||||
};
|
||||
|
||||
struct entry3
|
||||
{
|
||||
uint64_t fileid;
|
||||
unsigned char name;
|
||||
nfsuint64 cookie;
|
||||
struct entry3 *nextentry;
|
||||
};
|
||||
|
||||
struct dirlist3
|
||||
{
|
||||
struct entry3 *entries;
|
||||
bool eof;
|
||||
};
|
||||
|
||||
struct READDIR3resok
|
||||
{
|
||||
struct nfs_fattr dir_attributes;
|
||||
nfsuint64 cookieverf;
|
||||
struct dirlist3 reply;
|
||||
};
|
||||
|
||||
struct FSINFOargs
|
||||
{
|
||||
nfsfh_t fsroot;
|
||||
};
|
||||
|
||||
struct FSSTAT3args
|
||||
{
|
||||
nfsfh_t fsroot;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -163,7 +163,7 @@ void nfsx_safedisconnect(struct nfsmount *nmp)
|
||||
}
|
||||
#endif
|
||||
|
||||
int nfsx_request_xx(struct nfsmount *nm, int procnum,void *datain, void *dataout)
|
||||
int nfsx_request_xx(struct nfsmount *nm, int procnum, void *datain, void *dataout)
|
||||
{
|
||||
int error;
|
||||
struct nfsmount *nmp;
|
||||
|
||||
+6
-687
File diff suppressed because it is too large
Load Diff
+772
-724
File diff suppressed because it is too large
Load Diff
@@ -118,12 +118,15 @@ struct fs_nxffsdir_s
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NFS
|
||||
/* The NFS client file system */
|
||||
|
||||
struct nfsdir_s
|
||||
{
|
||||
off_t nd_direoffset; /* Directory EOF offset */
|
||||
uint32_t cookie[2];
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif /* CONFIG_DISABLE_MOUNTPOINT */
|
||||
|
||||
struct fs_dirent_s
|
||||
|
||||
Reference in New Issue
Block a user