Import 2.3.25pre1
[davej-history.git] / include / linux / nfs.h
blobc188fc8083e972e33c045803817872cf6ef3eb48
1 /*
2 * NFS protocol definitions
3 */
4 #ifndef _LINUX_NFS_H
5 #define _LINUX_NFS_H
7 #include <linux/sunrpc/msg_prot.h>
9 #define NFS_PORT 2049
10 #define NFS_MAXDATA 8192
11 #define NFS_MAXPATHLEN 1024
12 #define NFS_MAXNAMLEN 255
13 #define NFS_MAXGROUPS 16
14 #define NFS_FHSIZE 32
15 #define NFS_COOKIESIZE 4
16 #define NFS_FIFO_DEV (-1)
17 #define NFSMODE_FMT 0170000
18 #define NFSMODE_DIR 0040000
19 #define NFSMODE_CHR 0020000
20 #define NFSMODE_BLK 0060000
21 #define NFSMODE_REG 0100000
22 #define NFSMODE_LNK 0120000
23 #define NFSMODE_SOCK 0140000
24 #define NFSMODE_FIFO 0010000
27 enum nfs_stat {
28 NFS_OK = 0,
29 NFSERR_PERM = 1,
30 NFSERR_NOENT = 2,
31 NFSERR_IO = 5,
32 NFSERR_NXIO = 6,
33 NFSERR_EAGAIN = 11,
34 NFSERR_ACCES = 13,
35 NFSERR_EXIST = 17,
36 NFSERR_XDEV = 18,
37 NFSERR_NODEV = 19,
38 NFSERR_NOTDIR = 20,
39 NFSERR_ISDIR = 21,
40 NFSERR_INVAL = 22, /* that Sun forgot */
41 NFSERR_FBIG = 27,
42 NFSERR_NOSPC = 28,
43 NFSERR_ROFS = 30,
44 NFSERR_OPNOTSUPP = 45,
45 NFSERR_NAMETOOLONG = 63,
46 NFSERR_NOTEMPTY = 66,
47 NFSERR_DQUOT = 69,
48 NFSERR_STALE = 70,
49 NFSERR_WFLUSH = 99
52 enum nfs_ftype {
53 NFNON = 0,
54 NFREG = 1,
55 NFDIR = 2,
56 NFBLK = 3,
57 NFCHR = 4,
58 NFLNK = 5,
59 NFSOCK = 6,
60 NFBAD = 7,
61 NFFIFO = 8
64 struct nfs_fh {
65 char data[NFS_FHSIZE];
68 #define NFS_PROGRAM 100003
69 #define NFS_VERSION 2
70 #define NFSPROC_NULL 0
71 #define NFSPROC_GETATTR 1
72 #define NFSPROC_SETATTR 2
73 #define NFSPROC_ROOT 3
74 #define NFSPROC_LOOKUP 4
75 #define NFSPROC_READLINK 5
76 #define NFSPROC_READ 6
77 #define NFSPROC_WRITECACHE 7
78 #define NFSPROC_WRITE 8
79 #define NFSPROC_CREATE 9
80 #define NFSPROC_REMOVE 10
81 #define NFSPROC_RENAME 11
82 #define NFSPROC_LINK 12
83 #define NFSPROC_SYMLINK 13
84 #define NFSPROC_MKDIR 14
85 #define NFSPROC_RMDIR 15
86 #define NFSPROC_READDIR 16
87 #define NFSPROC_STATFS 17
89 /* Mount support for NFSroot */
90 #ifdef __KERNEL__
91 #define NFS_MNT_PROGRAM 100005
92 #define NFS_MNT_VERSION 1
93 #define NFS_MNT_PORT 627
94 #define NFS_MNTPROC_MNT 1
95 #define NFS_MNTPROC_UMNT 3
96 #endif
98 #if defined(__KERNEL__) || defined(NFS_NEED_KERNEL_TYPES)
100 extern struct rpc_program nfs_program;
101 extern struct rpc_stat nfs_rpcstat;
103 struct nfs_time {
104 __u32 seconds;
105 __u32 useconds;
108 struct nfs_fattr {
109 enum nfs_ftype type;
110 __u32 mode;
111 __u32 nlink;
112 __u32 uid;
113 __u32 gid;
114 __u32 size;
115 __u32 blocksize;
116 __u32 rdev;
117 __u32 blocks;
118 __u32 fsid;
119 __u32 fileid;
120 struct nfs_time atime;
121 struct nfs_time mtime;
122 struct nfs_time ctime;
125 struct nfs_fsinfo {
126 __u32 tsize;
127 __u32 bsize;
128 __u32 blocks;
129 __u32 bfree;
130 __u32 bavail;
133 struct nfs_writeargs {
134 struct nfs_fh * fh;
135 __u32 offset;
136 __u32 count;
137 const void * buffer;
140 #ifdef NFS_NEED_XDR_TYPES
142 struct nfs_sattrargs {
143 struct nfs_fh * fh;
144 struct iattr * sattr;
147 struct nfs_diropargs {
148 struct nfs_fh * fh;
149 const char * name;
152 struct nfs_readlinkargs {
153 struct nfs_fh * fh;
154 const void * buffer;
157 struct nfs_readargs {
158 struct nfs_fh * fh;
159 __u32 offset;
160 __u32 count;
161 void * buffer;
164 struct nfs_createargs {
165 struct nfs_fh * fh;
166 const char * name;
167 struct iattr * sattr;
170 struct nfs_renameargs {
171 struct nfs_fh * fromfh;
172 const char * fromname;
173 struct nfs_fh * tofh;
174 const char * toname;
177 struct nfs_linkargs {
178 struct nfs_fh * fromfh;
179 struct nfs_fh * tofh;
180 const char * toname;
183 struct nfs_symlinkargs {
184 struct nfs_fh * fromfh;
185 const char * fromname;
186 const char * topath;
187 struct iattr * sattr;
190 struct nfs_readdirargs {
191 struct nfs_fh * fh;
192 __u32 cookie;
193 void * buffer;
194 int bufsiz;
197 struct nfs_diropok {
198 struct nfs_fh * fh;
199 struct nfs_fattr * fattr;
202 struct nfs_readres {
203 struct nfs_fattr * fattr;
204 unsigned int count;
207 struct nfs_readdirres {
208 void * buffer;
209 int bufsiz;
210 u32 cookie;
213 #endif /* NFS_NEED_XDR_TYPES */
214 #endif /* __KERNEL__ */
216 #endif