* better
[mascara-docs.git] / i386 / linux-2.3.21 / include / linux / nfs3.h
blob94ec44b6a059dd68bef88744e91350c4861b718b
1 /*
2 * NFSv3 protocol definitions
3 */
4 #ifndef _LINUX_NFS3_H
5 #define _LINUX_NFS3_H
7 #include <linux/sunrpc/msg_prot.h>
8 #include <linux/nfs.h>
10 #define NFS3_PORT 2049
11 #define NFS3_MAXDATA 8192
12 #define NFS3_MAXPATHLEN PATH_MAX
13 #define NFS3_MAXNAMLEN NAME_MAX
14 #define NFS3_MAXGROUPS 16
15 #define NFS3_FHSIZE NFS_FHSIZE
16 #define NFS3_COOKIESIZE 4
17 #define NFS3_FIFO_DEV (-1)
18 #define NFS3MODE_FMT 0170000
19 #define NFS3MODE_DIR 0040000
20 #define NFS3MODE_CHR 0020000
21 #define NFS3MODE_BLK 0060000
22 #define NFS3MODE_REG 0100000
23 #define NFS3MODE_LNK 0120000
24 #define NFS3MODE_SOCK 0140000
25 #define NFS3MODE_FIFO 0010000
28 enum nfs3_stat {
29 NFS3_OK = 0,
30 NFS3ERR_PERM = 1,
31 NFS3ERR_NOENT = 2,
32 NFS3ERR_IO = 5,
33 NFS3ERR_NXIO = 6,
34 NFS3ERR_EAGAIN = 11,
35 NFS3ERR_ACCES = 13,
36 NFS3ERR_EXIST = 17,
37 NFS3ERR_XDEV = 18, /* new in NFSv3 */
38 NFS3ERR_NODEV = 19,
39 NFS3ERR_NOTDIR = 20,
40 NFS3ERR_ISDIR = 21,
41 NFS3ERR_INVAL = 22, /* new in NFSv3 */
42 NFS3ERR_FBIG = 27,
43 NFS3ERR_NOSPC = 28,
44 NFS3ERR_ROFS = 30,
45 NFS3ERR_MLINK = 31, /* new in NFSv3 */
46 NFS3ERR_NAMETOOLONG = 63,
47 NFS3ERR_NOTEMPTY = 66,
48 NFS3ERR_DQUOT = 69,
49 NFS3ERR_STALE = 70,
50 NFS3ERR_REMOTE = 71, /* new in NFSv3 */
51 NFS3ERR_BADHANDLE = 10001,/* ditto */
52 NFS3ERR_NOT_SYNC = 10002,/* ditto */
53 NFS3ERR_BAD_COOKIE = 10003,/* ditto */
54 NFS3ERR_NOTSUPP = 10004,/* ditto */
55 NFS3ERR_TOOSMALL = 10005,/* ditto */
56 NFS3ERR_SERVERFAULT = 10006,/* ditto */
57 NFS3ERR_BADTYPE = 10007,/* ditto */
58 NFS3ERR_JUKEBOX = 10008,/* ditto */
61 enum nfs3_ftype {
62 NF3NON = 0,
63 NF3REG = 1,
64 NF3DIR = 2,
65 NF3BLK = 3,
66 NF3CHR = 4,
67 NF3LNK = 5,
68 NF3SOCK = 6,
69 NF3FIFO = 7, /* changed from NFSv2 (was 8) */
70 NF3BAD = 8
73 #define NFS3_VERSION 3
74 #define NFSPROC_NULL 0
75 #define NFSPROC_GETATTR 1
76 #define NFSPROC_SETATTR 2
77 #define NFSPROC_ROOT 3
78 #define NFSPROC_LOOKUP 4
79 #define NFSPROC_READLINK 5
80 #define NFSPROC_READ 6
81 #define NFSPROC_WRITECACHE 7
82 #define NFSPROC_WRITE 8
83 #define NFSPROC_CREATE 9
84 #define NFSPROC_REMOVE 10
85 #define NFSPROC_RENAME 11
86 #define NFSPROC_LINK 12
87 #define NFSPROC_SYMLINK 13
88 #define NFSPROC_MKDIR 14
89 #define NFSPROC_RMDIR 15
90 #define NFSPROC_READDIR 16
91 #define NFSPROC_STATFS 17
93 #if defined(__KERNEL__) || defined(NFS_NEED_KERNEL_TYPES)
95 struct nfs3_fh {
96 __u32 size;
97 __u8 data[NFS3_FHSIZE];
100 struct nfs3_fattr {
101 enum nfs3_ftype type;
102 __u32 mode;
103 __u32 nlink;
104 __u32 uid;
105 __u32 gid;
106 __u64 size;
107 __u64 used;
108 __u32 rdev_maj;
109 __u32 rdev_min;
110 __u32 fsid;
111 __u32 fileid;
112 struct nfs_time atime;
113 struct nfs_time mtime;
114 struct nfs_time ctime;
117 struct nfs3_wcc_attr {
118 __u64 size;
119 struct nfs_time mtime;
120 struct nfs_time ctime;
123 struct nfs3_wcc_data {
124 struct nfs3_wcc_attr before;
125 struct nfs3_wcc_attr after;
128 struct nfs3_sattr {
129 __u32 valid;
130 __u32 mode;
131 __u32 uid;
132 __u32 gid;
133 __u64 size;
134 struct nfs_time atime;
135 struct nfs_time mtime;
138 struct nfs3_entry {
139 __u32 fileid;
140 char * name;
141 unsigned int length;
142 __u32 cookie;
143 __u32 eof;
146 struct nfs3_fsinfo {
147 __u32 tsize;
148 __u32 bsize;
149 __u32 blocks;
150 __u32 bfree;
151 __u32 bavail;
154 #ifdef NFS_NEED_XDR_TYPES
156 struct nfs3_sattrargs {
157 struct nfs_fh * fh;
158 struct nfs_sattr * sattr;
161 struct nfs3_diropargs {
162 struct nfs_fh * fh;
163 const char * name;
166 struct nfs3_readargs {
167 struct nfs_fh * fh;
168 __u32 offset;
169 __u32 count;
170 void * buffer;
173 struct nfs3_writeargs {
174 struct nfs_fh * fh;
175 __u32 offset;
176 __u32 count;
177 const void * buffer;
180 struct nfs3_createargs {
181 struct nfs_fh * fh;
182 const char * name;
183 struct nfs_sattr * sattr;
186 struct nfs3_renameargs {
187 struct nfs_fh * fromfh;
188 const char * fromname;
189 struct nfs_fh * tofh;
190 const char * toname;
193 struct nfs3_linkargs {
194 struct nfs_fh * fromfh;
195 struct nfs_fh * tofh;
196 const char * toname;
199 struct nfs3_symlinkargs {
200 struct nfs_fh * fromfh;
201 const char * fromname;
202 const char * topath;
203 struct nfs_sattr * sattr;
206 struct nfs3_readdirargs {
207 struct nfs_fh * fh;
208 __u32 cookie;
209 void * buffer;
210 unsigned int bufsiz;
213 struct nfs3_diropok {
214 struct nfs_fh * fh;
215 struct nfs_fattr * fattr;
218 struct nfs3_readres {
219 struct nfs_fattr * fattr;
220 unsigned int count;
223 struct nfs3_readlinkres {
224 char ** string;
225 unsigned int * lenp;
226 unsigned int maxlen;
227 void * buffer;
230 struct nfs3_readdirres {
231 void * buffer;
232 unsigned int bufsiz;
236 * The following are for NFSv3
238 struct nfs3_fh {
239 __u32 size;
240 __u8 data[NFS3_FHSIZE]
243 struct nfs3_wcc_attr {
244 __u64 size;
245 struct nfs_time mtime;
246 struct nfs_time ctime;
249 #endif /* NFS_NEED_XDR_TYPES */
250 #endif /* __KERNEL__ */
252 #endif