kbuild: add headerdep used to detect inclusion cycles in header files
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / include / linux / nfs_xdr.h
CommitLineData
1da177e4
LT
1#ifndef _LINUX_NFS_XDR_H
2#define _LINUX_NFS_XDR_H
3
b7fa0554 4#include <linux/nfsacl.h>
1da177e4 5
40859d7e
CL
6/*
7 * To change the maximum rsize and wsize supported by the NFS client, adjust
8 * NFS_MAX_FILE_IO_SIZE. 64KB is a typical maximum, but some servers can
9 * support a megabyte or more. The default is left at 4096 bytes, which is
10 * reasonable for NFS over UDP.
11 */
12#define NFS_MAX_FILE_IO_SIZE (1048576U)
13#define NFS_DEF_FILE_IO_SIZE (4096U)
14#define NFS_MIN_FILE_IO_SIZE (1024U)
15
8b4bdcf8
TM
16struct nfs_fsid {
17 uint64_t major;
18 uint64_t minor;
1da177e4
LT
19};
20
8b4bdcf8
TM
21/*
22 * Helper for checking equality between 2 fsids.
23 */
24static inline int nfs_fsid_equal(const struct nfs_fsid *a, const struct nfs_fsid *b)
25{
26 return a->major == b->major && a->minor == b->minor;
27}
28
1da177e4
LT
29struct nfs_fattr {
30 unsigned short valid; /* which fields are valid */
31 __u64 pre_size; /* pre_op_attr.size */
32 struct timespec pre_mtime; /* pre_op_attr.mtime */
33 struct timespec pre_ctime; /* pre_op_attr.ctime */
34 enum nfs_ftype type; /* always use NFSv2 types */
35 __u32 mode;
36 __u32 nlink;
37 __u32 uid;
38 __u32 gid;
9fa8d66f 39 dev_t rdev;
1da177e4
LT
40 __u64 size;
41 union {
42 struct {
43 __u32 blocksize;
44 __u32 blocks;
45 } nfs2;
46 struct {
47 __u64 used;
48 } nfs3;
49 } du;
8b4bdcf8 50 struct nfs_fsid fsid;
1da177e4
LT
51 __u64 fileid;
52 struct timespec atime;
53 struct timespec mtime;
54 struct timespec ctime;
55 __u32 bitmap[2]; /* NFSv4 returned attribute bitmap */
56 __u64 change_attr; /* NFSv4 change attribute */
57 __u64 pre_change_attr;/* pre-op NFSv4 change attribute */
33801147 58 unsigned long time_start;
4704f0e2 59 unsigned long gencount;
1da177e4
LT
60};
61
62#define NFS_ATTR_WCC 0x0001 /* pre-op WCC data */
63#define NFS_ATTR_FATTR 0x0002 /* post-op attributes */
64#define NFS_ATTR_FATTR_V3 0x0004 /* NFSv3 attributes */
73a3d07c 65#define NFS_ATTR_FATTR_V4 0x0008 /* NFSv4 change attribute */
70ca8852
TM
66#define NFS_ATTR_WCC_V4 0x0010 /* pre-op change attribute */
67#define NFS_ATTR_FATTR_V4_REFERRAL 0x0020 /* NFSv4 referral */
1da177e4
LT
68
69/*
70 * Info on the file system
71 */
72struct nfs_fsinfo {
73 struct nfs_fattr *fattr; /* Post-op attributes */
74 __u32 rtmax; /* max. read transfer size */
75 __u32 rtpref; /* pref. read transfer size */
76 __u32 rtmult; /* reads should be multiple of this */
77 __u32 wtmax; /* max. write transfer size */
78 __u32 wtpref; /* pref. write transfer size */
79 __u32 wtmult; /* writes should be multiple of this */
80 __u32 dtpref; /* pref. readdir transfer size */
81 __u64 maxfilesize;
82 __u32 lease_time; /* in seconds */
83};
84
85struct nfs_fsstat {
86 struct nfs_fattr *fattr; /* Post-op attributes */
87 __u64 tbytes; /* total size in bytes */
88 __u64 fbytes; /* # of free bytes */
89 __u64 abytes; /* # of bytes available to user */
90 __u64 tfiles; /* # of files */
91 __u64 ffiles; /* # of free files */
92 __u64 afiles; /* # of files available to user */
93};
94
95struct nfs2_fsstat {
96 __u32 tsize; /* Server transfer size */
97 __u32 bsize; /* Filesystem block size */
98 __u32 blocks; /* No. of "bsize" blocks on filesystem */
99 __u32 bfree; /* No. of free "bsize" blocks */
100 __u32 bavail; /* No. of available "bsize" blocks */
101};
102
103struct nfs_pathconf {
104 struct nfs_fattr *fattr; /* Post-op attributes */
105 __u32 max_link; /* max # of hard links */
106 __u32 max_namelen; /* max name length */
107};
108
109struct nfs4_change_info {
110 u32 atomic;
111 u64 before;
112 u64 after;
113};
114
cee54fc9 115struct nfs_seqid;
1da177e4
LT
116/*
117 * Arguments to the open call.
118 */
119struct nfs_openargs {
120 const struct nfs_fh * fh;
cee54fc9 121 struct nfs_seqid * seqid;
1da177e4
LT
122 int open_flags;
123 __u64 clientid;
9f958ab8 124 __u64 id;
1da177e4
LT
125 union {
126 struct iattr * attrs; /* UNCHECKED, GUARDED */
127 nfs4_verifier verifier; /* EXCLUSIVE */
128 nfs4_stateid delegation; /* CLAIM_DELEGATE_CUR */
129 int delegation_type; /* CLAIM_PREVIOUS */
130 } u;
131 const struct qstr * name;
132 const struct nfs_server *server; /* Needed for ID mapping */
133 const u32 * bitmask;
134 __u32 claim;
135};
136
137struct nfs_openres {
138 nfs4_stateid stateid;
139 struct nfs_fh fh;
140 struct nfs4_change_info cinfo;
141 __u32 rflags;
142 struct nfs_fattr * f_attr;
56ae19f3 143 struct nfs_fattr * dir_attr;
c1d51931 144 struct nfs_seqid * seqid;
1da177e4
LT
145 const struct nfs_server *server;
146 int delegation_type;
147 nfs4_stateid delegation;
148 __u32 do_recall;
149 __u64 maxsize;
aa53ed54 150 __u32 attrset[NFS4_BITMAP_SIZE];
1da177e4
LT
151};
152
153/*
154 * Arguments to the open_confirm call.
155 */
156struct nfs_open_confirmargs {
157 const struct nfs_fh * fh;
cdd4e68b 158 nfs4_stateid * stateid;
cee54fc9 159 struct nfs_seqid * seqid;
1da177e4
LT
160};
161
162struct nfs_open_confirmres {
163 nfs4_stateid stateid;
c1d51931 164 struct nfs_seqid * seqid;
1da177e4
LT
165};
166
167/*
168 * Arguments to the close call.
169 */
170struct nfs_closeargs {
171 struct nfs_fh * fh;
9512135d 172 nfs4_stateid * stateid;
cee54fc9 173 struct nfs_seqid * seqid;
1da177e4 174 int open_flags;
516a6af6 175 const u32 * bitmask;
1da177e4
LT
176};
177
178struct nfs_closeres {
179 nfs4_stateid stateid;
516a6af6 180 struct nfs_fattr * fattr;
c1d51931 181 struct nfs_seqid * seqid;
516a6af6 182 const struct nfs_server *server;
1da177e4
LT
183};
184/*
185 * * Arguments to the lock,lockt, and locku call.
186 * */
187struct nfs_lowner {
911d1aaf 188 __u64 clientid;
9f958ab8 189 __u64 id;
1da177e4
LT
190};
191
911d1aaf
TM
192struct nfs_lock_args {
193 struct nfs_fh * fh;
194 struct file_lock * fl;
cee54fc9 195 struct nfs_seqid * lock_seqid;
06735b34
TM
196 nfs4_stateid * lock_stateid;
197 struct nfs_seqid * open_seqid;
198 nfs4_stateid * open_stateid;
911d1aaf
TM
199 struct nfs_lowner lock_owner;
200 unsigned char block : 1;
201 unsigned char reclaim : 1;
202 unsigned char new_lock_owner : 1;
203};
204
205struct nfs_lock_res {
c1d51931
TM
206 nfs4_stateid stateid;
207 struct nfs_seqid * lock_seqid;
208 struct nfs_seqid * open_seqid;
1da177e4
LT
209};
210
911d1aaf
TM
211struct nfs_locku_args {
212 struct nfs_fh * fh;
213 struct file_lock * fl;
cee54fc9 214 struct nfs_seqid * seqid;
faf5f49c 215 nfs4_stateid * stateid;
1da177e4
LT
216};
217
911d1aaf 218struct nfs_locku_res {
c1d51931
TM
219 nfs4_stateid stateid;
220 struct nfs_seqid * seqid;
1da177e4
LT
221};
222
911d1aaf
TM
223struct nfs_lockt_args {
224 struct nfs_fh * fh;
225 struct file_lock * fl;
226 struct nfs_lowner lock_owner;
1da177e4
LT
227};
228
911d1aaf
TM
229struct nfs_lockt_res {
230 struct file_lock * denied; /* LOCK, LOCKT failed */
1da177e4
LT
231};
232
233struct nfs4_delegreturnargs {
234 const struct nfs_fh *fhandle;
235 const nfs4_stateid *stateid;
fa178f29
TM
236 const u32 * bitmask;
237};
238
239struct nfs4_delegreturnres {
240 struct nfs_fattr * fattr;
241 const struct nfs_server *server;
1da177e4
LT
242};
243
244/*
245 * Arguments to the read call.
246 */
1da177e4
LT
247struct nfs_readargs {
248 struct nfs_fh * fh;
249 struct nfs_open_context *context;
250 __u64 offset;
251 __u32 count;
252 unsigned int pgbase;
253 struct page ** pages;
254};
255
256struct nfs_readres {
257 struct nfs_fattr * fattr;
258 __u32 count;
259 int eof;
260};
261
262/*
263 * Arguments to the write call.
264 */
1da177e4
LT
265struct nfs_writeargs {
266 struct nfs_fh * fh;
267 struct nfs_open_context *context;
268 __u64 offset;
269 __u32 count;
270 enum nfs3_stable_how stable;
271 unsigned int pgbase;
272 struct page ** pages;
4f9838c7 273 const u32 * bitmask;
1da177e4
LT
274};
275
276struct nfs_writeverf {
277 enum nfs3_stable_how committed;
bc4785cd 278 __be32 verifier[2];
1da177e4
LT
279};
280
281struct nfs_writeres {
282 struct nfs_fattr * fattr;
283 struct nfs_writeverf * verf;
284 __u32 count;
4f9838c7 285 const struct nfs_server *server;
1da177e4
LT
286};
287
4fdc17b2
TM
288/*
289 * Common arguments to the unlink call
290 */
291struct nfs_removeargs {
292 const struct nfs_fh *fh;
293 struct qstr name;
294 const u32 * bitmask;
295};
296
297struct nfs_removeres {
298 const struct nfs_server *server;
299 struct nfs4_change_info cinfo;
300 struct nfs_fattr dir_attr;
301};
302
1da177e4
LT
303/*
304 * Argument struct for decode_entry function
305 */
306struct nfs_entry {
307 __u64 ino;
308 __u64 cookie,
309 prev_cookie;
310 const char * name;
311 unsigned int len;
312 int eof;
313 struct nfs_fh * fh;
314 struct nfs_fattr * fattr;
315};
316
317/*
318 * The following types are for NFSv2 only.
319 */
320struct nfs_sattrargs {
321 struct nfs_fh * fh;
322 struct iattr * sattr;
323};
324
325struct nfs_diropargs {
326 struct nfs_fh * fh;
327 const char * name;
328 unsigned int len;
329};
330
331struct nfs_createargs {
332 struct nfs_fh * fh;
333 const char * name;
334 unsigned int len;
335 struct iattr * sattr;
336};
337
338struct nfs_renameargs {
339 struct nfs_fh * fromfh;
340 const char * fromname;
341 unsigned int fromlen;
342 struct nfs_fh * tofh;
343 const char * toname;
344 unsigned int tolen;
345};
346
347struct nfs_setattrargs {
348 struct nfs_fh * fh;
349 nfs4_stateid stateid;
350 struct iattr * iap;
351 const struct nfs_server * server; /* Needed for name mapping */
352 const u32 * bitmask;
353};
354
23ec6965
BF
355struct nfs_setaclargs {
356 struct nfs_fh * fh;
357 size_t acl_len;
358 unsigned int acl_pgbase;
359 struct page ** acl_pages;
360};
361
029d105e
BF
362struct nfs_getaclargs {
363 struct nfs_fh * fh;
364 size_t acl_len;
365 unsigned int acl_pgbase;
366 struct page ** acl_pages;
367};
368
1da177e4
LT
369struct nfs_setattrres {
370 struct nfs_fattr * fattr;
371 const struct nfs_server * server;
372};
373
374struct nfs_linkargs {
375 struct nfs_fh * fromfh;
376 struct nfs_fh * tofh;
377 const char * toname;
378 unsigned int tolen;
379};
380
381struct nfs_symlinkargs {
382 struct nfs_fh * fromfh;
383 const char * fromname;
384 unsigned int fromlen;
94a6d753
CL
385 struct page ** pages;
386 unsigned int pathlen;
1da177e4
LT
387 struct iattr * sattr;
388};
389
390struct nfs_readdirargs {
391 struct nfs_fh * fh;
392 __u32 cookie;
393 unsigned int count;
394 struct page ** pages;
395};
396
b7fa0554
AG
397struct nfs3_getaclargs {
398 struct nfs_fh * fh;
399 int mask;
400 struct page ** pages;
401};
402
403struct nfs3_setaclargs {
404 struct inode * inode;
405 int mask;
406 struct posix_acl * acl_access;
407 struct posix_acl * acl_default;
408 struct page ** pages;
409};
410
1da177e4
LT
411struct nfs_diropok {
412 struct nfs_fh * fh;
413 struct nfs_fattr * fattr;
414};
415
416struct nfs_readlinkargs {
417 struct nfs_fh * fh;
418 unsigned int pgbase;
419 unsigned int pglen;
420 struct page ** pages;
421};
422
423struct nfs3_sattrargs {
424 struct nfs_fh * fh;
425 struct iattr * sattr;
426 unsigned int guard;
427 struct timespec guardtime;
428};
429
430struct nfs3_diropargs {
431 struct nfs_fh * fh;
432 const char * name;
433 unsigned int len;
434};
435
436struct nfs3_accessargs {
437 struct nfs_fh * fh;
438 __u32 access;
439};
440
441struct nfs3_createargs {
442 struct nfs_fh * fh;
443 const char * name;
444 unsigned int len;
445 struct iattr * sattr;
446 enum nfs3_createmode createmode;
bc4785cd 447 __be32 verifier[2];
1da177e4
LT
448};
449
450struct nfs3_mkdirargs {
451 struct nfs_fh * fh;
452 const char * name;
453 unsigned int len;
454 struct iattr * sattr;
455};
456
457struct nfs3_symlinkargs {
458 struct nfs_fh * fromfh;
459 const char * fromname;
460 unsigned int fromlen;
94a6d753
CL
461 struct page ** pages;
462 unsigned int pathlen;
1da177e4
LT
463 struct iattr * sattr;
464};
465
466struct nfs3_mknodargs {
467 struct nfs_fh * fh;
468 const char * name;
469 unsigned int len;
470 enum nfs3_ftype type;
471 struct iattr * sattr;
472 dev_t rdev;
473};
474
475struct nfs3_renameargs {
476 struct nfs_fh * fromfh;
477 const char * fromname;
478 unsigned int fromlen;
479 struct nfs_fh * tofh;
480 const char * toname;
481 unsigned int tolen;
482};
483
484struct nfs3_linkargs {
485 struct nfs_fh * fromfh;
486 struct nfs_fh * tofh;
487 const char * toname;
488 unsigned int tolen;
489};
490
491struct nfs3_readdirargs {
492 struct nfs_fh * fh;
493 __u64 cookie;
bc4785cd 494 __be32 verf[2];
1da177e4
LT
495 int plus;
496 unsigned int count;
497 struct page ** pages;
498};
499
500struct nfs3_diropres {
501 struct nfs_fattr * dir_attr;
502 struct nfs_fh * fh;
503 struct nfs_fattr * fattr;
504};
505
506struct nfs3_accessres {
507 struct nfs_fattr * fattr;
508 __u32 access;
509};
510
511struct nfs3_readlinkargs {
512 struct nfs_fh * fh;
513 unsigned int pgbase;
514 unsigned int pglen;
515 struct page ** pages;
516};
517
518struct nfs3_renameres {
519 struct nfs_fattr * fromattr;
520 struct nfs_fattr * toattr;
521};
522
523struct nfs3_linkres {
524 struct nfs_fattr * dir_attr;
525 struct nfs_fattr * fattr;
526};
527
528struct nfs3_readdirres {
529 struct nfs_fattr * dir_attr;
bc4785cd 530 __be32 * verf;
1da177e4
LT
531 int plus;
532};
533
b7fa0554
AG
534struct nfs3_getaclres {
535 struct nfs_fattr * fattr;
536 int mask;
537 unsigned int acl_access_count;
538 unsigned int acl_default_count;
539 struct posix_acl * acl_access;
540 struct posix_acl * acl_default;
541};
542
1da177e4
LT
543#ifdef CONFIG_NFS_V4
544
545typedef u64 clientid4;
546
547struct nfs4_accessargs {
548 const struct nfs_fh * fh;
76b32999 549 const u32 * bitmask;
1da177e4
LT
550 u32 access;
551};
552
553struct nfs4_accessres {
76b32999
TM
554 const struct nfs_server * server;
555 struct nfs_fattr * fattr;
1da177e4
LT
556 u32 supported;
557 u32 access;
558};
559
560struct nfs4_create_arg {
561 u32 ftype;
562 union {
94a6d753
CL
563 struct {
564 struct page ** pages;
565 unsigned int len;
566 } symlink; /* NF4LNK */
1da177e4
LT
567 struct {
568 u32 specdata1;
569 u32 specdata2;
570 } device; /* NF4BLK, NF4CHR */
571 } u;
572 const struct qstr * name;
573 const struct nfs_server * server;
574 const struct iattr * attrs;
575 const struct nfs_fh * dir_fh;
576 const u32 * bitmask;
577};
578
579struct nfs4_create_res {
580 const struct nfs_server * server;
581 struct nfs_fh * fh;
582 struct nfs_fattr * fattr;
583 struct nfs4_change_info dir_cinfo;
56ae19f3 584 struct nfs_fattr * dir_fattr;
1da177e4
LT
585};
586
587struct nfs4_fsinfo_arg {
588 const struct nfs_fh * fh;
589 const u32 * bitmask;
590};
591
592struct nfs4_getattr_arg {
593 const struct nfs_fh * fh;
594 const u32 * bitmask;
595};
596
597struct nfs4_getattr_res {
598 const struct nfs_server * server;
599 struct nfs_fattr * fattr;
600};
601
602struct nfs4_link_arg {
603 const struct nfs_fh * fh;
604 const struct nfs_fh * dir_fh;
605 const struct qstr * name;
91ba2eee
TM
606 const u32 * bitmask;
607};
608
609struct nfs4_link_res {
610 const struct nfs_server * server;
611 struct nfs_fattr * fattr;
612 struct nfs4_change_info cinfo;
613 struct nfs_fattr * dir_attr;
1da177e4
LT
614};
615
91ba2eee 616
1da177e4
LT
617struct nfs4_lookup_arg {
618 const struct nfs_fh * dir_fh;
619 const struct qstr * name;
620 const u32 * bitmask;
621};
622
623struct nfs4_lookup_res {
624 const struct nfs_server * server;
625 struct nfs_fattr * fattr;
626 struct nfs_fh * fh;
627};
628
629struct nfs4_lookup_root_arg {
630 const u32 * bitmask;
631};
632
633struct nfs4_pathconf_arg {
634 const struct nfs_fh * fh;
635 const u32 * bitmask;
636};
637
638struct nfs4_readdir_arg {
639 const struct nfs_fh * fh;
640 u64 cookie;
641 nfs4_verifier verifier;
642 u32 count;
643 struct page ** pages; /* zero-copy data */
644 unsigned int pgbase; /* zero-copy data */
645 const u32 * bitmask;
646};
647
648struct nfs4_readdir_res {
649 nfs4_verifier verifier;
650 unsigned int pgbase;
651};
652
653struct nfs4_readlink {
654 const struct nfs_fh * fh;
655 unsigned int pgbase;
656 unsigned int pglen; /* zero-copy data */
657 struct page ** pages; /* zero-copy data */
658};
659
1da177e4
LT
660struct nfs4_rename_arg {
661 const struct nfs_fh * old_dir;
662 const struct nfs_fh * new_dir;
663 const struct qstr * old_name;
664 const struct qstr * new_name;
6caf2c82 665 const u32 * bitmask;
1da177e4
LT
666};
667
668struct nfs4_rename_res {
6caf2c82 669 const struct nfs_server * server;
1da177e4 670 struct nfs4_change_info old_cinfo;
6caf2c82 671 struct nfs_fattr * old_fattr;
1da177e4 672 struct nfs4_change_info new_cinfo;
6caf2c82 673 struct nfs_fattr * new_fattr;
1da177e4
LT
674};
675
19d771f3 676#define NFS4_SETCLIENTID_NAMELEN (127)
1da177e4 677struct nfs4_setclientid {
cc38bac3 678 const nfs4_verifier * sc_verifier;
1da177e4 679 unsigned int sc_name_len;
d1ce02e1 680 char sc_name[NFS4_SETCLIENTID_NAMELEN + 1];
cc38bac3 681 u32 sc_prog;
1da177e4 682 unsigned int sc_netid_len;
d1ce02e1 683 char sc_netid[RPCBIND_MAXNETIDLEN + 1];
1da177e4 684 unsigned int sc_uaddr_len;
d1ce02e1 685 char sc_uaddr[RPCBIND_MAXUADDRLEN + 1];
cc38bac3 686 u32 sc_cb_ident;
1da177e4
LT
687};
688
689struct nfs4_statfs_arg {
690 const struct nfs_fh * fh;
691 const u32 * bitmask;
692};
693
694struct nfs4_server_caps_res {
695 u32 attr_bitmask[2];
696 u32 acl_bitmask;
697 u32 has_links;
698 u32 has_symlinks;
699};
700
7aaa0b3b
MN
701struct nfs4_string {
702 unsigned int len;
703 char *data;
683b57b4
TM
704};
705
7aaa0b3b
MN
706#define NFS4_PATHNAME_MAXCOMPONENTS 512
707struct nfs4_pathname {
708 unsigned int ncomponents;
709 struct nfs4_string components[NFS4_PATHNAME_MAXCOMPONENTS];
710};
711
712#define NFS4_FS_LOCATION_MAXSERVERS 10
713struct nfs4_fs_location {
714 unsigned int nservers;
715 struct nfs4_string servers[NFS4_FS_LOCATION_MAXSERVERS];
716 struct nfs4_pathname rootpath;
717};
718
719#define NFS4_FS_LOCATIONS_MAXENTRIES 10
720struct nfs4_fs_locations {
683b57b4
TM
721 struct nfs_fattr fattr;
722 const struct nfs_server *server;
7aaa0b3b 723 struct nfs4_pathname fs_path;
683b57b4 724 int nlocations;
7aaa0b3b 725 struct nfs4_fs_location locations[NFS4_FS_LOCATIONS_MAXENTRIES];
683b57b4
TM
726};
727
728struct nfs4_fs_locations_arg {
729 const struct nfs_fh *dir_fh;
730 const struct qstr *name;
731 struct page *page;
732 const u32 *bitmask;
733};
734
1da177e4
LT
735#endif /* CONFIG_NFS_V4 */
736
737struct nfs_page;
738
40859d7e
CL
739#define NFS_PAGEVEC_SIZE (8U)
740
1da177e4
LT
741struct nfs_read_data {
742 int flags;
743 struct rpc_task task;
744 struct inode *inode;
745 struct rpc_cred *cred;
746 struct nfs_fattr fattr; /* fattr storage */
747 struct list_head pages; /* Coalesced read requests */
748 struct nfs_page *req; /* multi ops per nfs_page */
40859d7e 749 struct page **pagevec;
e9f7bee1 750 unsigned int npages; /* Max length of pagevec */
1da177e4
LT
751 struct nfs_readargs args;
752 struct nfs_readres res;
753#ifdef CONFIG_NFS_V4
754 unsigned long timestamp; /* For lease renewal */
755#endif
0d0b5cb3 756 struct page *page_array[NFS_PAGEVEC_SIZE];
1da177e4
LT
757};
758
759struct nfs_write_data {
760 int flags;
761 struct rpc_task task;
762 struct inode *inode;
763 struct rpc_cred *cred;
764 struct nfs_fattr fattr;
765 struct nfs_writeverf verf;
766 struct list_head pages; /* Coalesced requests we wish to flush */
767 struct nfs_page *req; /* multi ops per nfs_page */
40859d7e 768 struct page **pagevec;
e9f7bee1 769 unsigned int npages; /* Max length of pagevec */
1da177e4
LT
770 struct nfs_writeargs args; /* argument struct */
771 struct nfs_writeres res; /* result struct */
772#ifdef CONFIG_NFS_V4
773 unsigned long timestamp; /* For lease renewal */
774#endif
0d0b5cb3 775 struct page *page_array[NFS_PAGEVEC_SIZE];
1da177e4
LT
776};
777
778struct nfs_access_entry;
779
780/*
781 * RPC procedure vector for NFSv2/NFSv3 demuxing
782 */
783struct nfs_rpc_ops {
c0e07cb6 784 u32 version; /* Protocol version */
1da177e4 785 struct dentry_operations *dentry_ops;
c5ef1c42
AV
786 const struct inode_operations *dir_inode_ops;
787 const struct inode_operations *file_inode_ops;
1da177e4
LT
788
789 int (*getroot) (struct nfs_server *, struct nfs_fh *,
790 struct nfs_fsinfo *);
2b3de441
DH
791 int (*lookupfh)(struct nfs_server *, struct nfs_fh *,
792 struct qstr *, struct nfs_fh *,
793 struct nfs_fattr *);
1da177e4
LT
794 int (*getattr) (struct nfs_server *, struct nfs_fh *,
795 struct nfs_fattr *);
796 int (*setattr) (struct dentry *, struct nfs_fattr *,
797 struct iattr *);
798 int (*lookup) (struct inode *, struct qstr *,
799 struct nfs_fh *, struct nfs_fattr *);
800 int (*access) (struct inode *, struct nfs_access_entry *);
801 int (*readlink)(struct inode *, struct page *, unsigned int,
802 unsigned int);
1da177e4 803 int (*create) (struct inode *, struct dentry *,
02a913a7 804 struct iattr *, int, struct nameidata *);
1da177e4 805 int (*remove) (struct inode *, struct qstr *);
e4eff1a6
TM
806 void (*unlink_setup) (struct rpc_message *, struct inode *dir);
807 int (*unlink_done) (struct rpc_task *, struct inode *);
1da177e4
LT
808 int (*rename) (struct inode *, struct qstr *,
809 struct inode *, struct qstr *);
810 int (*link) (struct inode *, struct inode *, struct qstr *);
94a6d753
CL
811 int (*symlink) (struct inode *, struct dentry *, struct page *,
812 unsigned int, struct iattr *);
1da177e4
LT
813 int (*mkdir) (struct inode *, struct dentry *, struct iattr *);
814 int (*rmdir) (struct inode *, struct qstr *);
815 int (*readdir) (struct dentry *, struct rpc_cred *,
816 u64, struct page *, unsigned int, int);
817 int (*mknod) (struct inode *, struct dentry *, struct iattr *,
818 dev_t);
819 int (*statfs) (struct nfs_server *, struct nfs_fh *,
820 struct nfs_fsstat *);
821 int (*fsinfo) (struct nfs_server *, struct nfs_fh *,
822 struct nfs_fsinfo *);
823 int (*pathconf) (struct nfs_server *, struct nfs_fh *,
824 struct nfs_pathconf *);
e9326dca 825 int (*set_capabilities)(struct nfs_server *, struct nfs_fh *);
0dbb4c67 826 __be32 *(*decode_dirent)(__be32 *, struct nfs_entry *, int plus);
bdc7f021 827 void (*read_setup) (struct nfs_read_data *, struct rpc_message *);
ec06c096 828 int (*read_done) (struct rpc_task *, struct nfs_read_data *);
bdc7f021 829 void (*write_setup) (struct nfs_write_data *, struct rpc_message *);
788e7a89 830 int (*write_done) (struct rpc_task *, struct nfs_write_data *);
bdc7f021 831 void (*commit_setup) (struct nfs_write_data *, struct rpc_message *);
788e7a89 832 int (*commit_done) (struct rpc_task *, struct nfs_write_data *);
1da177e4 833 int (*lock)(struct file *, int, struct file_lock *);
2116271a 834 int (*lock_check_bounds)(const struct file_lock *);
ada70d94 835 void (*clear_acl_cache)(struct inode *);
1da177e4
LT
836};
837
838/*
839 * NFS_CALL(getattr, inode, (fattr));
840 * into
841 * NFS_PROTO(inode)->getattr(fattr);
842 */
843#define NFS_CALL(op, inode, args) NFS_PROTO(inode)->op args
844
845/*
846 * Function vectors etc. for the NFS client
847 */
509de811
DH
848extern const struct nfs_rpc_ops nfs_v2_clientops;
849extern const struct nfs_rpc_ops nfs_v3_clientops;
850extern const struct nfs_rpc_ops nfs_v4_clientops;
1da177e4
LT
851extern struct rpc_version nfs_version2;
852extern struct rpc_version nfs_version3;
853extern struct rpc_version nfs_version4;
854
b7fa0554
AG
855extern struct rpc_version nfsacl_version3;
856extern struct rpc_program nfsacl_program;
857
1da177e4 858#endif