Rev 422 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
422 | giacomo | 1 | #ifndef _LINUX_NFS_XDR_H |
2 | #define _LINUX_NFS_XDR_H |
||
3 | |||
4 | #include <linux/sunrpc/xprt.h> |
||
5 | |||
6 | struct nfs_fattr { |
||
7 | unsigned short valid; /* which fields are valid */ |
||
8 | __u64 pre_size; /* pre_op_attr.size */ |
||
9 | struct timespec pre_mtime; /* pre_op_attr.mtime */ |
||
10 | struct timespec pre_ctime; /* pre_op_attr.ctime */ |
||
11 | enum nfs_ftype type; /* always use NFSv2 types */ |
||
12 | __u32 mode; |
||
13 | __u32 nlink; |
||
14 | __u32 uid; |
||
15 | __u32 gid; |
||
16 | __u64 size; |
||
17 | union { |
||
18 | struct { |
||
19 | __u32 blocksize; |
||
20 | __u32 blocks; |
||
21 | } nfs2; |
||
22 | struct { |
||
23 | __u64 used; |
||
24 | } nfs3; |
||
25 | } du; |
||
26 | dev_t rdev; |
||
27 | union { |
||
28 | __u64 nfs3; /* also nfs2 */ |
||
29 | struct { |
||
30 | __u64 major; |
||
31 | __u64 minor; |
||
32 | } nfs4; |
||
33 | } fsid_u; |
||
34 | __u64 fileid; |
||
35 | struct timespec atime; |
||
36 | struct timespec mtime; |
||
37 | struct timespec ctime; |
||
38 | __u32 bitmap[2]; /* NFSv4 returned attribute bitmap */ |
||
39 | __u64 change_attr; /* NFSv4 change attribute */ |
||
40 | __u64 pre_change_attr;/* pre-op NFSv4 change attribute */ |
||
41 | unsigned long timestamp; |
||
42 | }; |
||
43 | |||
44 | #define NFS_ATTR_WCC 0x0001 /* pre-op WCC data */ |
||
45 | #define NFS_ATTR_FATTR 0x0002 /* post-op attributes */ |
||
46 | #define NFS_ATTR_FATTR_V3 0x0004 /* NFSv3 attributes */ |
||
47 | #define NFS_ATTR_FATTR_V4 0x0008 |
||
48 | #define NFS_ATTR_PRE_CHANGE 0x0010 |
||
49 | |||
50 | /* |
||
51 | * Info on the file system |
||
52 | */ |
||
53 | struct nfs_fsinfo { |
||
54 | struct nfs_fattr *fattr; /* Post-op attributes */ |
||
55 | __u32 rtmax; /* max. read transfer size */ |
||
56 | __u32 rtpref; /* pref. read transfer size */ |
||
57 | __u32 rtmult; /* reads should be multiple of this */ |
||
58 | __u32 wtmax; /* max. write transfer size */ |
||
59 | __u32 wtpref; /* pref. write transfer size */ |
||
60 | __u32 wtmult; /* writes should be multiple of this */ |
||
61 | __u32 dtpref; /* pref. readdir transfer size */ |
||
62 | __u64 maxfilesize; |
||
63 | __u32 lease_time; /* in seconds */ |
||
64 | }; |
||
65 | |||
66 | struct nfs_fsstat { |
||
67 | struct nfs_fattr *fattr; /* Post-op attributes */ |
||
68 | __u64 tbytes; /* total size in bytes */ |
||
69 | __u64 fbytes; /* # of free bytes */ |
||
70 | __u64 abytes; /* # of bytes available to user */ |
||
71 | __u64 tfiles; /* # of files */ |
||
72 | __u64 ffiles; /* # of free files */ |
||
73 | __u64 afiles; /* # of files available to user */ |
||
74 | }; |
||
75 | |||
76 | struct nfs2_fsstat { |
||
77 | __u32 tsize; /* Server transfer size */ |
||
78 | __u32 bsize; /* Filesystem block size */ |
||
79 | __u32 blocks; /* No. of "bsize" blocks on filesystem */ |
||
80 | __u32 bfree; /* No. of free "bsize" blocks */ |
||
81 | __u32 bavail; /* No. of available "bsize" blocks */ |
||
82 | }; |
||
83 | |||
84 | struct nfs_pathconf { |
||
85 | struct nfs_fattr *fattr; /* Post-op attributes */ |
||
86 | __u32 max_link; /* max # of hard links */ |
||
87 | __u32 max_namelen; /* max name length */ |
||
88 | }; |
||
89 | |||
90 | /* |
||
91 | * Arguments to the open call. |
||
92 | */ |
||
93 | struct nfs_openargs { |
||
94 | struct nfs_fh * fh; |
||
95 | __u32 seqid; |
||
96 | __u32 share_access; |
||
97 | __u64 clientid; |
||
98 | __u32 id; |
||
99 | __u32 opentype; |
||
100 | __u32 createmode; |
||
101 | union { |
||
102 | struct iattr * attrs; /* UNCHECKED, GUARDED */ |
||
103 | nfs4_verifier verifier; /* EXCLUSIVE */ |
||
104 | } u; |
||
105 | struct qstr * name; |
||
106 | struct nfs4_getattr * f_getattr; |
||
107 | struct nfs4_getattr * d_getattr; |
||
108 | struct nfs_server * server; /* Needed for ID mapping */ |
||
109 | }; |
||
110 | |||
111 | struct nfs_openres { |
||
112 | __u32 status; |
||
113 | nfs4_stateid stateid; |
||
114 | struct nfs_fh fh; |
||
115 | struct nfs4_change_info * cinfo; |
||
116 | __u32 rflags; |
||
117 | struct nfs4_getattr * f_getattr; |
||
118 | struct nfs4_getattr * d_getattr; |
||
119 | struct nfs_server * server; |
||
120 | }; |
||
121 | |||
122 | /* |
||
123 | * Arguments to the open_confirm call. |
||
124 | */ |
||
125 | struct nfs_open_confirmargs { |
||
126 | struct nfs_fh * fh; |
||
127 | nfs4_stateid stateid; |
||
128 | __u32 seqid; |
||
129 | }; |
||
130 | |||
131 | struct nfs_open_confirmres { |
||
132 | __u32 status; |
||
133 | nfs4_stateid stateid; |
||
134 | }; |
||
135 | |||
136 | /* |
||
137 | * Arguments to the close call. |
||
138 | */ |
||
139 | struct nfs_closeargs { |
||
140 | struct nfs_fh * fh; |
||
141 | nfs4_stateid stateid; |
||
142 | __u32 seqid; |
||
143 | }; |
||
144 | |||
145 | struct nfs_closeres { |
||
146 | __u32 status; |
||
147 | nfs4_stateid stateid; |
||
148 | }; |
||
149 | |||
150 | |||
151 | /* |
||
152 | * Arguments to the read call. |
||
153 | */ |
||
154 | |||
155 | #define NFS_READ_MAXIOV (9U) |
||
156 | #if (NFS_READ_MAXIOV > (MAX_IOVEC -2)) |
||
157 | #error "NFS_READ_MAXIOV is too large" |
||
158 | #endif |
||
159 | |||
160 | struct nfs_readargs { |
||
161 | struct nfs_fh * fh; |
||
162 | nfs4_stateid stateid; |
||
163 | __u64 offset; |
||
164 | __u32 count; |
||
165 | unsigned int pgbase; |
||
166 | struct page ** pages; |
||
167 | }; |
||
168 | |||
169 | struct nfs_readres { |
||
170 | struct nfs_fattr * fattr; |
||
171 | __u32 count; |
||
172 | int eof; |
||
173 | }; |
||
174 | |||
175 | /* |
||
176 | * Arguments to the write call. |
||
177 | */ |
||
178 | #define NFS_WRITE_MAXIOV (9U) |
||
179 | #if (NFS_WRITE_MAXIOV > (MAX_IOVEC -2)) |
||
180 | #error "NFS_WRITE_MAXIOV is too large" |
||
181 | #endif |
||
182 | |||
183 | struct nfs_writeargs { |
||
184 | struct nfs_fh * fh; |
||
185 | nfs4_stateid stateid; |
||
186 | __u64 offset; |
||
187 | __u32 count; |
||
188 | enum nfs3_stable_how stable; |
||
189 | unsigned int pgbase; |
||
190 | struct page ** pages; |
||
191 | }; |
||
192 | |||
193 | struct nfs_writeverf { |
||
194 | enum nfs3_stable_how committed; |
||
195 | __u32 verifier[2]; |
||
196 | }; |
||
197 | |||
198 | struct nfs_writeres { |
||
199 | struct nfs_fattr * fattr; |
||
200 | struct nfs_writeverf * verf; |
||
201 | __u32 count; |
||
202 | }; |
||
203 | |||
204 | /* |
||
205 | * Argument struct for decode_entry function |
||
206 | */ |
||
207 | struct nfs_entry { |
||
208 | __u64 ino; |
||
209 | __u64 cookie, |
||
210 | prev_cookie; |
||
211 | const char * name; |
||
212 | unsigned int len; |
||
213 | int eof; |
||
214 | struct nfs_fh * fh; |
||
215 | struct nfs_fattr * fattr; |
||
216 | }; |
||
217 | |||
218 | /* |
||
219 | * The following types are for NFSv2 only. |
||
220 | */ |
||
221 | struct nfs_sattrargs { |
||
222 | struct nfs_fh * fh; |
||
223 | struct iattr * sattr; |
||
224 | }; |
||
225 | |||
226 | struct nfs_diropargs { |
||
227 | struct nfs_fh * fh; |
||
228 | const char * name; |
||
229 | unsigned int len; |
||
230 | }; |
||
231 | |||
232 | struct nfs_createargs { |
||
233 | struct nfs_fh * fh; |
||
234 | const char * name; |
||
235 | unsigned int len; |
||
236 | struct iattr * sattr; |
||
237 | }; |
||
238 | |||
239 | struct nfs_renameargs { |
||
240 | struct nfs_fh * fromfh; |
||
241 | const char * fromname; |
||
242 | unsigned int fromlen; |
||
243 | struct nfs_fh * tofh; |
||
244 | const char * toname; |
||
245 | unsigned int tolen; |
||
246 | }; |
||
247 | |||
248 | struct nfs_setattrargs { |
||
249 | struct nfs_fh * fh; |
||
250 | nfs4_stateid stateid; |
||
251 | struct iattr * iap; |
||
252 | struct nfs4_getattr * attr; |
||
253 | struct nfs_server * server; /* Needed for name mapping */ |
||
254 | }; |
||
255 | |||
256 | struct nfs_setattrres { |
||
257 | struct nfs4_getattr * attr; |
||
258 | struct nfs_server * server; |
||
259 | }; |
||
260 | |||
261 | struct nfs_linkargs { |
||
262 | struct nfs_fh * fromfh; |
||
263 | struct nfs_fh * tofh; |
||
264 | const char * toname; |
||
265 | unsigned int tolen; |
||
266 | }; |
||
267 | |||
268 | struct nfs_symlinkargs { |
||
269 | struct nfs_fh * fromfh; |
||
270 | const char * fromname; |
||
271 | unsigned int fromlen; |
||
272 | const char * topath; |
||
273 | unsigned int tolen; |
||
274 | struct iattr * sattr; |
||
275 | }; |
||
276 | |||
277 | struct nfs_readdirargs { |
||
278 | struct nfs_fh * fh; |
||
279 | __u32 cookie; |
||
280 | unsigned int count; |
||
281 | struct page ** pages; |
||
282 | }; |
||
283 | |||
284 | struct nfs_diropok { |
||
285 | struct nfs_fh * fh; |
||
286 | struct nfs_fattr * fattr; |
||
287 | }; |
||
288 | |||
289 | struct nfs_readlinkargs { |
||
290 | struct nfs_fh * fh; |
||
291 | unsigned int count; |
||
292 | struct page ** pages; |
||
293 | }; |
||
294 | |||
295 | struct nfs3_sattrargs { |
||
296 | struct nfs_fh * fh; |
||
297 | struct iattr * sattr; |
||
298 | unsigned int guard; |
||
299 | struct timespec guardtime; |
||
300 | }; |
||
301 | |||
302 | struct nfs3_diropargs { |
||
303 | struct nfs_fh * fh; |
||
304 | const char * name; |
||
305 | unsigned int len; |
||
306 | }; |
||
307 | |||
308 | struct nfs3_accessargs { |
||
309 | struct nfs_fh * fh; |
||
310 | __u32 access; |
||
311 | }; |
||
312 | |||
313 | struct nfs3_createargs { |
||
314 | struct nfs_fh * fh; |
||
315 | const char * name; |
||
316 | unsigned int len; |
||
317 | struct iattr * sattr; |
||
318 | enum nfs3_createmode createmode; |
||
319 | __u32 verifier[2]; |
||
320 | }; |
||
321 | |||
322 | struct nfs3_mkdirargs { |
||
323 | struct nfs_fh * fh; |
||
324 | const char * name; |
||
325 | unsigned int len; |
||
326 | struct iattr * sattr; |
||
327 | }; |
||
328 | |||
329 | struct nfs3_symlinkargs { |
||
330 | struct nfs_fh * fromfh; |
||
331 | const char * fromname; |
||
332 | unsigned int fromlen; |
||
333 | const char * topath; |
||
334 | unsigned int tolen; |
||
335 | struct iattr * sattr; |
||
336 | }; |
||
337 | |||
338 | struct nfs3_mknodargs { |
||
339 | struct nfs_fh * fh; |
||
340 | const char * name; |
||
341 | unsigned int len; |
||
342 | enum nfs3_ftype type; |
||
343 | struct iattr * sattr; |
||
344 | dev_t rdev; |
||
345 | }; |
||
346 | |||
347 | struct nfs3_renameargs { |
||
348 | struct nfs_fh * fromfh; |
||
349 | const char * fromname; |
||
350 | unsigned int fromlen; |
||
351 | struct nfs_fh * tofh; |
||
352 | const char * toname; |
||
353 | unsigned int tolen; |
||
354 | }; |
||
355 | |||
356 | struct nfs3_linkargs { |
||
357 | struct nfs_fh * fromfh; |
||
358 | struct nfs_fh * tofh; |
||
359 | const char * toname; |
||
360 | unsigned int tolen; |
||
361 | }; |
||
362 | |||
363 | struct nfs3_readdirargs { |
||
364 | struct nfs_fh * fh; |
||
365 | __u64 cookie; |
||
366 | __u32 verf[2]; |
||
367 | int plus; |
||
368 | unsigned int count; |
||
369 | struct page ** pages; |
||
370 | }; |
||
371 | |||
372 | struct nfs3_diropres { |
||
373 | struct nfs_fattr * dir_attr; |
||
374 | struct nfs_fh * fh; |
||
375 | struct nfs_fattr * fattr; |
||
376 | }; |
||
377 | |||
378 | struct nfs3_accessres { |
||
379 | struct nfs_fattr * fattr; |
||
380 | __u32 access; |
||
381 | }; |
||
382 | |||
383 | struct nfs3_readlinkargs { |
||
384 | struct nfs_fh * fh; |
||
385 | unsigned int count; |
||
386 | struct page ** pages; |
||
387 | }; |
||
388 | |||
389 | struct nfs3_renameres { |
||
390 | struct nfs_fattr * fromattr; |
||
391 | struct nfs_fattr * toattr; |
||
392 | }; |
||
393 | |||
394 | struct nfs3_linkres { |
||
395 | struct nfs_fattr * dir_attr; |
||
396 | struct nfs_fattr * fattr; |
||
397 | }; |
||
398 | |||
399 | struct nfs3_readdirres { |
||
400 | struct nfs_fattr * dir_attr; |
||
401 | __u32 * verf; |
||
402 | int plus; |
||
403 | }; |
||
404 | |||
405 | #ifdef CONFIG_NFS_V4 |
||
406 | |||
407 | typedef u64 clientid4; |
||
408 | |||
409 | struct nfs4_change_info { |
||
410 | u32 atomic; |
||
411 | u64 before; |
||
412 | u64 after; |
||
413 | }; |
||
414 | |||
415 | struct nfs4_access { |
||
416 | u32 ac_req_access; /* request */ |
||
417 | u32 * ac_resp_supported; /* response */ |
||
418 | u32 * ac_resp_access; /* response */ |
||
419 | }; |
||
420 | |||
421 | struct nfs4_close { |
||
422 | char * cl_stateid; /* request */ |
||
423 | u32 cl_seqid; /* request */ |
||
424 | }; |
||
425 | |||
426 | struct nfs4_create { |
||
427 | u32 cr_ftype; /* request */ |
||
428 | union { /* request */ |
||
429 | struct { |
||
430 | u32 textlen; |
||
431 | const char * text; |
||
432 | } symlink; /* NF4LNK */ |
||
433 | struct { |
||
434 | u32 specdata1; |
||
435 | u32 specdata2; |
||
436 | } device; /* NF4BLK, NF4CHR */ |
||
437 | } u; |
||
438 | u32 cr_namelen; /* request */ |
||
439 | const char * cr_name; /* request */ |
||
440 | struct iattr * cr_attrs; /* request */ |
||
441 | struct nfs4_change_info * cr_cinfo; /* response */ |
||
442 | }; |
||
443 | #define cr_textlen u.symlink.textlen |
||
444 | #define cr_text u.symlink.text |
||
445 | #define cr_specdata1 u.device.specdata1 |
||
446 | #define cr_specdata2 u.device.specdata2 |
||
447 | |||
448 | struct nfs4_getattr { |
||
449 | u32 * gt_bmval; /* request */ |
||
450 | struct nfs_fattr * gt_attrs; /* response */ |
||
451 | struct nfs_fsstat * gt_fsstat; /* response */ |
||
452 | struct nfs_fsinfo * gt_fsinfo; /* response */ |
||
453 | struct nfs_pathconf * gt_pathconf; /* response */ |
||
454 | }; |
||
455 | |||
456 | struct nfs4_getfh { |
||
457 | struct nfs_fh * gf_fhandle; /* response */ |
||
458 | }; |
||
459 | |||
460 | struct nfs4_link { |
||
461 | u32 ln_namelen; /* request */ |
||
462 | const char * ln_name; /* request */ |
||
463 | struct nfs4_change_info * ln_cinfo; /* response */ |
||
464 | }; |
||
465 | |||
466 | struct nfs4_lookup { |
||
467 | struct qstr * lo_name; /* request */ |
||
468 | }; |
||
469 | |||
470 | struct nfs4_open { |
||
471 | struct nfs4_client * op_client_state; /* request */ |
||
472 | u32 op_share_access; /* request */ |
||
473 | u32 op_opentype; /* request */ |
||
474 | u32 op_createmode; /* request */ |
||
475 | union { /* request */ |
||
476 | struct iattr * attrs; /* UNCHECKED, GUARDED */ |
||
477 | nfs4_verifier verifier; /* EXCLUSIVE */ |
||
478 | } u; |
||
479 | struct qstr * op_name; /* request */ |
||
480 | char * op_stateid; /* response */ |
||
481 | struct nfs4_change_info * op_cinfo; /* response */ |
||
482 | u32 * op_rflags; /* response */ |
||
483 | }; |
||
484 | #define op_attrs u.attrs |
||
485 | #define op_verifier u.verifier |
||
486 | |||
487 | struct nfs4_open_confirm { |
||
488 | char * oc_stateid; /* request */ |
||
489 | }; |
||
490 | |||
491 | struct nfs4_putfh { |
||
492 | struct nfs_fh * pf_fhandle; /* request */ |
||
493 | }; |
||
494 | |||
495 | struct nfs4_readdir { |
||
496 | u64 rd_cookie; /* request */ |
||
497 | nfs4_verifier rd_req_verifier; /* request */ |
||
498 | u32 rd_count; /* request */ |
||
499 | u32 rd_bmval[2]; /* request */ |
||
500 | nfs4_verifier rd_resp_verifier; /* response */ |
||
501 | struct page ** rd_pages; /* zero-copy data */ |
||
502 | unsigned int rd_pgbase; /* zero-copy data */ |
||
503 | }; |
||
504 | |||
505 | struct nfs4_readlink { |
||
506 | u32 rl_count; /* zero-copy data */ |
||
507 | struct page ** rl_pages; /* zero-copy data */ |
||
508 | }; |
||
509 | |||
510 | struct nfs4_remove { |
||
511 | u32 rm_namelen; /* request */ |
||
512 | const char * rm_name; /* request */ |
||
513 | struct nfs4_change_info * rm_cinfo; /* response */ |
||
514 | }; |
||
515 | |||
516 | struct nfs4_rename { |
||
517 | u32 rn_oldnamelen; /* request */ |
||
518 | const char * rn_oldname; /* request */ |
||
519 | u32 rn_newnamelen; /* request */ |
||
520 | const char * rn_newname; /* request */ |
||
521 | struct nfs4_change_info * rn_src_cinfo; /* response */ |
||
522 | struct nfs4_change_info * rn_dst_cinfo; /* response */ |
||
523 | }; |
||
524 | |||
525 | struct nfs4_setattr { |
||
526 | char * st_stateid; /* request */ |
||
527 | struct iattr * st_iap; /* request */ |
||
528 | }; |
||
529 | |||
530 | struct nfs4_setclientid { |
||
531 | nfs4_verifier sc_verifier; /* request */ |
||
532 | char * sc_name; /* request */ |
||
533 | u32 sc_prog; /* request */ |
||
534 | char sc_netid[4]; /* request */ |
||
535 | char sc_uaddr[24]; /* request */ |
||
536 | u32 sc_cb_ident; /* request */ |
||
537 | struct nfs4_client * sc_state; /* response */ |
||
538 | }; |
||
539 | |||
540 | struct nfs4_op { |
||
541 | u32 opnum; |
||
542 | union { |
||
543 | struct nfs4_access access; |
||
544 | struct nfs4_close close; |
||
545 | struct nfs4_create create; |
||
546 | struct nfs4_getattr getattr; |
||
547 | struct nfs4_getfh getfh; |
||
548 | struct nfs4_link link; |
||
549 | struct nfs4_lookup lookup; |
||
550 | struct nfs4_open open; |
||
551 | struct nfs4_open_confirm open_confirm; |
||
552 | struct nfs4_putfh putfh; |
||
553 | struct nfs4_readdir readdir; |
||
554 | struct nfs4_readlink readlink; |
||
555 | struct nfs4_remove remove; |
||
556 | struct nfs4_rename rename; |
||
557 | struct nfs4_client * renew; |
||
558 | struct nfs4_setattr setattr; |
||
559 | struct nfs4_setclientid setclientid; |
||
560 | struct nfs4_client * setclientid_confirm; |
||
561 | } u; |
||
562 | }; |
||
563 | |||
564 | struct nfs4_compound { |
||
565 | unsigned int flags; /* defined below */ |
||
566 | struct nfs_server * server; |
||
567 | |||
568 | /* RENEW information */ |
||
569 | int renew_index; |
||
570 | unsigned long timestamp; |
||
571 | |||
572 | /* scratch variables for XDR encode/decode */ |
||
573 | int nops; |
||
574 | u32 * p; |
||
575 | u32 * end; |
||
576 | |||
577 | /* the individual COMPOUND operations */ |
||
578 | struct nfs4_op *ops; |
||
579 | |||
580 | /* request */ |
||
581 | int req_nops; |
||
582 | u32 taglen; |
||
583 | char * tag; |
||
584 | |||
585 | /* response */ |
||
586 | int resp_nops; |
||
587 | int toplevel_status; |
||
588 | }; |
||
589 | |||
590 | #endif /* CONFIG_NFS_V4 */ |
||
591 | |||
592 | struct nfs_read_data { |
||
593 | int flags; |
||
594 | struct rpc_task task; |
||
595 | struct inode *inode; |
||
596 | struct rpc_cred *cred; |
||
597 | struct nfs_fattr fattr; /* fattr storage */ |
||
598 | struct list_head pages; /* Coalesced read requests */ |
||
599 | struct page *pagevec[NFS_READ_MAXIOV]; |
||
600 | struct nfs_readargs args; |
||
601 | struct nfs_readres res; |
||
602 | #ifdef CONFIG_NFS_V4 |
||
603 | unsigned long timestamp; /* For lease renewal */ |
||
604 | #endif |
||
605 | }; |
||
606 | |||
607 | struct nfs_write_data { |
||
608 | int flags; |
||
609 | struct rpc_task task; |
||
610 | struct inode *inode; |
||
611 | struct rpc_cred *cred; |
||
612 | struct nfs_fattr fattr; |
||
613 | struct nfs_writeverf verf; |
||
614 | struct list_head pages; /* Coalesced requests we wish to flush */ |
||
615 | struct page *pagevec[NFS_WRITE_MAXIOV]; |
||
616 | struct nfs_writeargs args; /* argument struct */ |
||
617 | struct nfs_writeres res; /* result struct */ |
||
618 | #ifdef CONFIG_NFS_V4 |
||
619 | unsigned long timestamp; /* For lease renewal */ |
||
620 | #endif |
||
621 | }; |
||
622 | |||
623 | struct nfs_page; |
||
624 | |||
625 | /* |
||
626 | * RPC procedure vector for NFSv2/NFSv3 demuxing |
||
627 | */ |
||
628 | struct nfs_rpc_ops { |
||
629 | int version; /* Protocol version */ |
||
630 | |||
631 | int (*getroot) (struct nfs_server *, struct nfs_fh *, |
||
632 | struct nfs_fattr *); |
||
633 | int (*getattr) (struct inode *, struct nfs_fattr *); |
||
634 | int (*setattr) (struct dentry *, struct nfs_fattr *, |
||
635 | struct iattr *); |
||
636 | int (*lookup) (struct inode *, struct qstr *, |
||
637 | struct nfs_fh *, struct nfs_fattr *); |
||
638 | int (*access) (struct inode *, struct rpc_cred *, int); |
||
639 | int (*readlink)(struct inode *, struct page *); |
||
640 | int (*read) (struct nfs_read_data *, struct file *); |
||
641 | int (*write) (struct nfs_write_data *, struct file *); |
||
642 | int (*commit) (struct nfs_write_data *, struct file *); |
||
643 | struct inode * (*create) (struct inode *, struct qstr *, |
||
644 | struct iattr *, int); |
||
645 | int (*remove) (struct inode *, struct qstr *); |
||
646 | int (*unlink_setup) (struct rpc_message *, |
||
647 | struct dentry *, struct qstr *); |
||
648 | int (*unlink_done) (struct dentry *, struct rpc_task *); |
||
649 | int (*rename) (struct inode *, struct qstr *, |
||
650 | struct inode *, struct qstr *); |
||
651 | int (*link) (struct inode *, struct inode *, struct qstr *); |
||
652 | int (*symlink) (struct inode *, struct qstr *, struct qstr *, |
||
653 | struct iattr *, struct nfs_fh *, |
||
654 | struct nfs_fattr *); |
||
655 | int (*mkdir) (struct inode *, struct qstr *, struct iattr *, |
||
656 | struct nfs_fh *, struct nfs_fattr *); |
||
657 | int (*rmdir) (struct inode *, struct qstr *); |
||
658 | int (*readdir) (struct dentry *, struct rpc_cred *, |
||
659 | u64, struct page *, unsigned int, int); |
||
660 | int (*mknod) (struct inode *, struct qstr *, struct iattr *, |
||
661 | dev_t, struct nfs_fh *, struct nfs_fattr *); |
||
662 | int (*statfs) (struct nfs_server *, struct nfs_fh *, |
||
663 | struct nfs_fsstat *); |
||
664 | int (*fsinfo) (struct nfs_server *, struct nfs_fh *, |
||
665 | struct nfs_fsinfo *); |
||
666 | int (*pathconf) (struct nfs_server *, struct nfs_fh *, |
||
667 | struct nfs_pathconf *); |
||
668 | u32 * (*decode_dirent)(u32 *, struct nfs_entry *, int plus); |
||
669 | void (*read_setup) (struct nfs_read_data *, unsigned int count); |
||
670 | void (*write_setup) (struct nfs_write_data *, unsigned int count, int how); |
||
671 | void (*commit_setup) (struct nfs_write_data *, u64 start, u32 len, int how); |
||
672 | int (*file_open) (struct inode *, struct file *); |
||
673 | int (*file_release) (struct inode *, struct file *); |
||
674 | void (*request_init)(struct nfs_page *, struct file *); |
||
675 | int (*request_compatible)(struct nfs_page *, struct file *, struct page *); |
||
676 | }; |
||
677 | |||
678 | /* |
||
679 | * NFS_CALL(getattr, inode, (fattr)); |
||
680 | * into |
||
681 | * NFS_PROTO(inode)->getattr(fattr); |
||
682 | */ |
||
683 | #define NFS_CALL(op, inode, args) NFS_PROTO(inode)->op args |
||
684 | |||
685 | /* |
||
686 | * Function vectors etc. for the NFS client |
||
687 | */ |
||
688 | extern struct nfs_rpc_ops nfs_v2_clientops; |
||
689 | extern struct nfs_rpc_ops nfs_v3_clientops; |
||
690 | extern struct nfs_rpc_ops nfs_v4_clientops; |
||
691 | extern struct rpc_version nfs_version2; |
||
692 | extern struct rpc_version nfs_version3; |
||
693 | extern struct rpc_version nfs_version4; |
||
694 | extern struct rpc_program nfs_program; |
||
695 | extern struct rpc_stat nfs_rpcstat; |
||
696 | |||
697 | #endif |