1 #ifndef _LINUX_NFS_XDR_H
2 #define _LINUX_NFS_XDR_H
3
4 extern struct rpc_program nfs_program;
5 extern struct rpc_stat nfs_rpcstat;
6
7 struct nfs_fattr {
8 unsigned short valid; /* which fields are valid */
9 __u64 pre_size; /* pre_op_attr.size */
10 __u64 pre_mtime; /* pre_op_attr.mtime */
11 __u64 pre_ctime; /* pre_op_attr.ctime */
12 enum nfs_ftype type; /* always use NFSv2 types */
13 __u32 mode;
14 __u32 nlink;
15 __u32 uid;
16 __u32 gid;
17 __u64 size;
18 union {
19 struct {
20 __u32 blocksize;
21 __u32 blocks;
22 } nfs2;
23 struct {
24 __u64 used;
25 } nfs3;
26 } du;
27 __u32 rdev;
28 __u64 fsid;
29 __u64 fileid;
30 __u64 atime;
31 __u64 mtime;
32 __u64 ctime;
33 };
34
35 #define NFS_ATTR_WCC 0x0001 /* pre-op WCC data */
36 #define NFS_ATTR_FATTR 0x0002 /* post-op attributes */
37 #define NFS_ATTR_FATTR_V3 0x0004 /* NFSv3 attributes */
38
39 /*
40 * Info on the file system
41 */
42 struct nfs_fsinfo {
43 __u32 rtmax; /* max. read transfer size */
44 __u32 rtpref; /* pref. read transfer size */
45 __u32 rtmult; /* reads should be multiple of this */
46 __u32 wtmax; /* max. write transfer size */
47 __u32 wtpref; /* pref. write transfer size */
48 __u32 wtmult; /* writes should be multiple of this */
49 __u32 dtpref; /* pref. readdir transfer size */
50 __u64 maxfilesize;
51 __u64 bsize; /* block size */
52 __u64 tbytes; /* total size in bytes */
53 __u64 fbytes; /* # of free bytes */
54 __u64 abytes; /* # of bytes available to user */
55 __u64 tfiles; /* # of files */
56 __u64 ffiles; /* # of free files */
57 __u64 afiles; /* # of files available to user */
58 __u32 linkmax;/* max # of hard links */
59 __u32 namelen;/* max name length */
60 };
61
62 /* Arguments to the read call.
63 * Note that NFS_READ_MAXIOV must be <= (MAX_IOVEC-2) from sunrpc/xprt.h
64 */
65 #define NFS_READ_MAXIOV 8
66
67 struct nfs_readargs {
68 struct nfs_fh * fh;
69 __u64 offset;
70 __u32 count;
71 unsigned int nriov;
72 struct iovec iov[NFS_READ_MAXIOV];
73 };
74
75 struct nfs_readres {
76 struct nfs_fattr * fattr;
77 unsigned int count;
78 int eof;
79 };
80
81 /* Arguments to the write call.
82 * Note that NFS_WRITE_MAXIOV must be <= (MAX_IOVEC-2) from sunrpc/xprt.h
83 */
84 #define NFS_WRITE_MAXIOV 8
85 struct nfs_writeargs {
86 struct nfs_fh * fh;
87 __u32 offset;
88 __u32 count;
89 enum nfs3_stable_how stable;
90 unsigned int nriov;
91 struct iovec iov[NFS_WRITE_MAXIOV];
92 };
93
94 struct nfs_writeverf {
95 enum nfs3_stable_how committed;
96 __u32 verifier[2];
97 };
98
99 struct nfs_writeres {
100 struct nfs_fattr * fattr;
101 struct nfs_writeverf * verf;
102 __u32 count;
103 };
104
105 /*
106 * Argument struct for decode_entry function
107 */
108 struct nfs_entry {
109 __u64 ino;
110 __u64 cookie,
111 prev_cookie;
112 const char * name;
113 unsigned int len;
114 int eof;
115 struct nfs_fh fh;
116 struct nfs_fattr fattr;
117 };
118
119 /*
120 * The following types are for NFSv2 only.
121 */
122 struct nfs_sattrargs {
123 struct nfs_fh * fh;
124 struct iattr * sattr;
125 };
126
127 struct nfs_diropargs {
128 struct nfs_fh * fh;
129 const char * name;
130 unsigned int len;
131 };
132
133 struct nfs_createargs {
134 struct nfs_fh * fh;
135 const char * name;
136 unsigned int len;
137 struct iattr * sattr;
138 };
139
140 struct nfs_renameargs {
141 struct nfs_fh * fromfh;
142 const char * fromname;
143 unsigned int fromlen;
144 struct nfs_fh * tofh;
145 const char * toname;
146 unsigned int tolen;
147 };
148
149 struct nfs_linkargs {
150 struct nfs_fh * fromfh;
151 struct nfs_fh * tofh;
152 const char * toname;
153 unsigned int tolen;
154 };
155
156 struct nfs_symlinkargs {
157 struct nfs_fh * fromfh;
158 const char * fromname;
159 unsigned int fromlen;
160 const char * topath;
161 unsigned int tolen;
162 struct iattr * sattr;
163 };
164
165 struct nfs_readdirargs {
166 struct nfs_fh * fh;
167 __u32 cookie;
168 void * buffer;
169 unsigned int bufsiz;
170 };
171
172 struct nfs_diropok {
173 struct nfs_fh * fh;
174 struct nfs_fattr * fattr;
175 };
176
177 struct nfs_readlinkargs {
178 struct nfs_fh * fh;
179 void * buffer;
180 unsigned int bufsiz;
181 };
182
183 struct nfs_readlinkres {
184 void * buffer;
185 unsigned int bufsiz;
186 };
187
188 struct nfs_readdirres {
189 void * buffer;
190 unsigned int bufsiz;
191 };
192
193 struct nfs3_sattrargs {
194 struct nfs_fh * fh;
195 struct iattr * sattr;
196 unsigned int guard;
197 __u64 guardtime;
198 };
199
200 struct nfs3_diropargs {
201 struct nfs_fh * fh;
202 const char * name;
203 unsigned int len;
204 };
205
206 struct nfs3_accessargs {
207 struct nfs_fh * fh;
208 __u32 access;
209 };
210
211 struct nfs3_createargs {
212 struct nfs_fh * fh;
213 const char * name;
214 unsigned int len;
215 struct iattr * sattr;
216 enum nfs3_createmode createmode;
217 __u32 verifier[2];
218 };
219
220 struct nfs3_mkdirargs {
221 struct nfs_fh * fh;
222 const char * name;
223 unsigned int len;
224 struct iattr * sattr;
225 };
226
227 struct nfs3_symlinkargs {
228 struct nfs_fh * fromfh;
229 const char * fromname;
230 unsigned int fromlen;
231 const char * topath;
232 unsigned int tolen;
233 struct iattr * sattr;
234 };
235
236 struct nfs3_mknodargs {
237 struct nfs_fh * fh;
238 const char * name;
239 unsigned int len;
240 enum nfs3_ftype type;
241 struct iattr * sattr;
242 dev_t rdev;
243 };
244
245 struct nfs3_renameargs {
246 struct nfs_fh * fromfh;
247 const char * fromname;
248 unsigned int fromlen;
249 struct nfs_fh * tofh;
250 const char * toname;
251 unsigned int tolen;
252 };
253
254 struct nfs3_linkargs {
255 struct nfs_fh * fromfh;
256 struct nfs_fh * tofh;
257 const char * toname;
258 unsigned int tolen;
259 };
260
261 struct nfs3_readdirargs {
262 struct nfs_fh * fh;
263 __u64 cookie;
264 __u32 verf[2];
265 void * buffer;
266 unsigned int bufsiz;
267 int plus;
268 };
269
270 struct nfs3_diropres {
271 struct nfs_fattr * dir_attr;
272 struct nfs_fh * fh;
273 struct nfs_fattr * fattr;
274 };
275
276 struct nfs3_accessres {
277 struct nfs_fattr * fattr;
278 __u32 access;
279 };
280
281 struct nfs3_readlinkargs {
282 struct nfs_fh * fh;
283 void * buffer;
284 unsigned int bufsiz;
285 };
286
287 struct nfs3_readlinkres {
288 struct nfs_fattr * fattr;
289 void * buffer;
290 unsigned int bufsiz;
291 };
292
293 struct nfs3_renameres {
294 struct nfs_fattr * fromattr;
295 struct nfs_fattr * toattr;
296 };
297
298 struct nfs3_linkres {
299 struct nfs_fattr * dir_attr;
300 struct nfs_fattr * fattr;
301 };
302
303 struct nfs3_readdirres {
304 struct nfs_fattr * dir_attr;
305 __u32 * verf;
306 void * buffer;
307 unsigned int bufsiz;
308 int plus;
309 };
310
311 /*
312 * RPC procedure vector for NFSv2/NFSv3 demuxing
313 */
314 struct nfs_rpc_ops {
315 int version; /* Protocol version */
316
317 int (*getroot) (struct nfs_server *, struct nfs_fh *,
318 struct nfs_fattr *);
319 int (*getattr) (struct inode *, struct nfs_fattr *);
320 int (*setattr) (struct inode *, struct nfs_fattr *,
321 struct iattr *);
322 int (*lookup) (struct inode *, struct qstr *,
323 struct nfs_fh *, struct nfs_fattr *);
324 int (*access) (struct inode *, int , int);
325 int (*readlink)(struct inode *, void *, unsigned int);
326 int (*read) (struct inode *, struct rpc_cred *,
327 struct nfs_fattr *,
328 int, loff_t, unsigned int,
329 void *buffer, int *eofp);
330 int (*write) (struct inode *, struct rpc_cred *,
331 struct nfs_fattr *,
332 int, loff_t, unsigned int,
333 void *buffer, struct nfs_writeverf *verfp);
334 int (*commit) (struct inode *, struct nfs_fattr *,
335 unsigned long, unsigned int);
336 int (*create) (struct inode *, struct qstr *, struct iattr *,
337 int, struct nfs_fh *, struct nfs_fattr *);
338 int (*remove) (struct inode *, struct qstr *);
339 int (*unlink_setup) (struct rpc_message *,
340 struct dentry *, struct qstr *);
341 void (*unlink_done) (struct dentry *, struct rpc_message *);
342 int (*rename) (struct inode *, struct qstr *,
343 struct inode *, struct qstr *);
344 int (*link) (struct inode *, struct inode *, struct qstr *);
345 int (*symlink) (struct inode *, struct qstr *, struct qstr *,
346 struct iattr *, struct nfs_fh *,
347 struct nfs_fattr *);
348 int (*mkdir) (struct inode *, struct qstr *, struct iattr *,
349 struct nfs_fh *, struct nfs_fattr *);
350 int (*rmdir) (struct inode *, struct qstr *);
351 int (*readdir) (struct inode *, struct rpc_cred *,
352 u64, void *, unsigned int, int);
353 int (*mknod) (struct inode *, struct qstr *, struct iattr *,
354 dev_t, struct nfs_fh *, struct nfs_fattr *);
355 int (*statfs) (struct nfs_server *, struct nfs_fh *,
356 struct nfs_fsinfo *);
357 u32 * (*decode_dirent)(u32 *, struct nfs_entry *, int plus);
358 };
359
360 /*
361 * NFS_CALL(getattr, inode, (fattr));
362 * into
363 * NFS_PROTO(inode)->getattr(fattr);
364 */
365 #define NFS_CALL(op, inode, args) NFS_PROTO(inode)->op args
366
367 /*
368 * Function vectors etc. for the NFS client
369 */
370 extern struct nfs_rpc_ops nfs_v2_clientops;
371 extern struct nfs_rpc_ops nfs_v3_clientops;
372 extern struct rpc_version nfs_version2;
373 extern struct rpc_version nfs_version3;
374 extern struct rpc_program nfs_program;
375
376 #endif
377
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.