NFSv4.1: Allow SEQUENCE to resize the slot table on the fly
[firefly-linux-kernel-4.4.55.git] / include / linux / nfs_xdr.h
1 #ifndef _LINUX_NFS_XDR_H
2 #define _LINUX_NFS_XDR_H
3
4 #include <linux/nfsacl.h>
5 #include <linux/sunrpc/gss_api.h>
6
7 /*
8  * To change the maximum rsize and wsize supported by the NFS client, adjust
9  * NFS_MAX_FILE_IO_SIZE.  64KB is a typical maximum, but some servers can
10  * support a megabyte or more.  The default is left at 4096 bytes, which is
11  * reasonable for NFS over UDP.
12  */
13 #define NFS_MAX_FILE_IO_SIZE    (1048576U)
14 #define NFS_DEF_FILE_IO_SIZE    (4096U)
15 #define NFS_MIN_FILE_IO_SIZE    (1024U)
16
17 /* Forward declaration for NFS v3 */
18 struct nfs4_secinfo_flavors;
19
20 struct nfs4_string {
21         unsigned int len;
22         char *data;
23 };
24
25 struct nfs_fsid {
26         uint64_t                major;
27         uint64_t                minor;
28 };
29
30 /*
31  * Helper for checking equality between 2 fsids.
32  */
33 static inline int nfs_fsid_equal(const struct nfs_fsid *a, const struct nfs_fsid *b)
34 {
35         return a->major == b->major && a->minor == b->minor;
36 }
37
38 struct nfs4_threshold {
39         __u32   bm;
40         __u32   l_type;
41         __u64   rd_sz;
42         __u64   wr_sz;
43         __u64   rd_io_sz;
44         __u64   wr_io_sz;
45 };
46
47 struct nfs_fattr {
48         unsigned int            valid;          /* which fields are valid */
49         umode_t                 mode;
50         __u32                   nlink;
51         __u32                   uid;
52         __u32                   gid;
53         dev_t                   rdev;
54         __u64                   size;
55         union {
56                 struct {
57                         __u32   blocksize;
58                         __u32   blocks;
59                 } nfs2;
60                 struct {
61                         __u64   used;
62                 } nfs3;
63         } du;
64         struct nfs_fsid         fsid;
65         __u64                   fileid;
66         __u64                   mounted_on_fileid;
67         struct timespec         atime;
68         struct timespec         mtime;
69         struct timespec         ctime;
70         __u64                   change_attr;    /* NFSv4 change attribute */
71         __u64                   pre_change_attr;/* pre-op NFSv4 change attribute */
72         __u64                   pre_size;       /* pre_op_attr.size       */
73         struct timespec         pre_mtime;      /* pre_op_attr.mtime      */
74         struct timespec         pre_ctime;      /* pre_op_attr.ctime      */
75         unsigned long           time_start;
76         unsigned long           gencount;
77         struct nfs4_string      *owner_name;
78         struct nfs4_string      *group_name;
79         struct nfs4_threshold   *mdsthreshold;  /* pNFS threshold hints */
80 };
81
82 #define NFS_ATTR_FATTR_TYPE             (1U << 0)
83 #define NFS_ATTR_FATTR_MODE             (1U << 1)
84 #define NFS_ATTR_FATTR_NLINK            (1U << 2)
85 #define NFS_ATTR_FATTR_OWNER            (1U << 3)
86 #define NFS_ATTR_FATTR_GROUP            (1U << 4)
87 #define NFS_ATTR_FATTR_RDEV             (1U << 5)
88 #define NFS_ATTR_FATTR_SIZE             (1U << 6)
89 #define NFS_ATTR_FATTR_PRESIZE          (1U << 7)
90 #define NFS_ATTR_FATTR_BLOCKS_USED      (1U << 8)
91 #define NFS_ATTR_FATTR_SPACE_USED       (1U << 9)
92 #define NFS_ATTR_FATTR_FSID             (1U << 10)
93 #define NFS_ATTR_FATTR_FILEID           (1U << 11)
94 #define NFS_ATTR_FATTR_ATIME            (1U << 12)
95 #define NFS_ATTR_FATTR_MTIME            (1U << 13)
96 #define NFS_ATTR_FATTR_CTIME            (1U << 14)
97 #define NFS_ATTR_FATTR_PREMTIME         (1U << 15)
98 #define NFS_ATTR_FATTR_PRECTIME         (1U << 16)
99 #define NFS_ATTR_FATTR_CHANGE           (1U << 17)
100 #define NFS_ATTR_FATTR_PRECHANGE        (1U << 18)
101 #define NFS_ATTR_FATTR_V4_LOCATIONS     (1U << 19)
102 #define NFS_ATTR_FATTR_V4_REFERRAL      (1U << 20)
103 #define NFS_ATTR_FATTR_MOUNTPOINT       (1U << 21)
104 #define NFS_ATTR_FATTR_MOUNTED_ON_FILEID (1U << 22)
105 #define NFS_ATTR_FATTR_OWNER_NAME       (1U << 23)
106 #define NFS_ATTR_FATTR_GROUP_NAME       (1U << 24)
107
108 #define NFS_ATTR_FATTR (NFS_ATTR_FATTR_TYPE \
109                 | NFS_ATTR_FATTR_MODE \
110                 | NFS_ATTR_FATTR_NLINK \
111                 | NFS_ATTR_FATTR_OWNER \
112                 | NFS_ATTR_FATTR_GROUP \
113                 | NFS_ATTR_FATTR_RDEV \
114                 | NFS_ATTR_FATTR_SIZE \
115                 | NFS_ATTR_FATTR_FSID \
116                 | NFS_ATTR_FATTR_FILEID \
117                 | NFS_ATTR_FATTR_ATIME \
118                 | NFS_ATTR_FATTR_MTIME \
119                 | NFS_ATTR_FATTR_CTIME \
120                 | NFS_ATTR_FATTR_CHANGE)
121 #define NFS_ATTR_FATTR_V2 (NFS_ATTR_FATTR \
122                 | NFS_ATTR_FATTR_BLOCKS_USED)
123 #define NFS_ATTR_FATTR_V3 (NFS_ATTR_FATTR \
124                 | NFS_ATTR_FATTR_SPACE_USED)
125 #define NFS_ATTR_FATTR_V4 (NFS_ATTR_FATTR \
126                 | NFS_ATTR_FATTR_SPACE_USED)
127
128 /*
129  * Info on the file system
130  */
131 struct nfs_fsinfo {
132         struct nfs_fattr        *fattr; /* Post-op attributes */
133         __u32                   rtmax;  /* max.  read transfer size */
134         __u32                   rtpref; /* pref. read transfer size */
135         __u32                   rtmult; /* reads should be multiple of this */
136         __u32                   wtmax;  /* max.  write transfer size */
137         __u32                   wtpref; /* pref. write transfer size */
138         __u32                   wtmult; /* writes should be multiple of this */
139         __u32                   dtpref; /* pref. readdir transfer size */
140         __u64                   maxfilesize;
141         struct timespec         time_delta; /* server time granularity */
142         __u32                   lease_time; /* in seconds */
143         __u32                   layouttype; /* supported pnfs layout driver */
144         __u32                   blksize; /* preferred pnfs io block size */
145 };
146
147 struct nfs_fsstat {
148         struct nfs_fattr        *fattr; /* Post-op attributes */
149         __u64                   tbytes; /* total size in bytes */
150         __u64                   fbytes; /* # of free bytes */
151         __u64                   abytes; /* # of bytes available to user */
152         __u64                   tfiles; /* # of files */
153         __u64                   ffiles; /* # of free files */
154         __u64                   afiles; /* # of files available to user */
155 };
156
157 struct nfs2_fsstat {
158         __u32                   tsize;  /* Server transfer size */
159         __u32                   bsize;  /* Filesystem block size */
160         __u32                   blocks; /* No. of "bsize" blocks on filesystem */
161         __u32                   bfree;  /* No. of free "bsize" blocks */
162         __u32                   bavail; /* No. of available "bsize" blocks */
163 };
164
165 struct nfs_pathconf {
166         struct nfs_fattr        *fattr; /* Post-op attributes */
167         __u32                   max_link; /* max # of hard links */
168         __u32                   max_namelen; /* max name length */
169 };
170
171 struct nfs4_change_info {
172         u32                     atomic;
173         u64                     before;
174         u64                     after;
175 };
176
177 struct nfs_seqid;
178
179 /* nfs41 sessions channel attributes */
180 struct nfs4_channel_attrs {
181         u32                     max_rqst_sz;
182         u32                     max_resp_sz;
183         u32                     max_resp_sz_cached;
184         u32                     max_ops;
185         u32                     max_reqs;
186 };
187
188 /* nfs41 sessions slot seqid */
189 struct nfs4_slot {
190         struct nfs4_slot_table  *table;
191         struct nfs4_slot        *next;
192         unsigned long           generation;
193         unsigned long           renewal_time;
194         u32                     slot_nr;
195         u32                     seq_nr;
196 };
197
198 struct nfs4_sequence_args {
199         struct nfs4_slot        *sa_slot;
200         u8                      sa_cache_this;
201 };
202
203 struct nfs4_sequence_res {
204         struct nfs4_slot        *sr_slot;       /* slot used to send request */
205         int                     sr_status;      /* sequence operation status */
206         u32                     sr_status_flags;
207         u32                     sr_highest_slotid;
208         u32                     sr_target_highest_slotid;
209 };
210
211 struct nfs4_get_lease_time_args {
212         struct nfs4_sequence_args       la_seq_args;
213 };
214
215 struct nfs4_get_lease_time_res {
216         struct nfs_fsinfo              *lr_fsinfo;
217         struct nfs4_sequence_res        lr_seq_res;
218 };
219
220 #define PNFS_LAYOUT_MAXSIZE 4096
221
222 struct nfs4_layoutdriver_data {
223         struct page **pages;
224         __u32 pglen;
225         __u32 len;
226 };
227
228 struct pnfs_layout_range {
229         u32 iomode;
230         u64 offset;
231         u64 length;
232 };
233
234 struct nfs4_layoutget_args {
235         __u32 type;
236         struct pnfs_layout_range range;
237         __u64 minlength;
238         __u32 maxcount;
239         struct inode *inode;
240         struct nfs_open_context *ctx;
241         struct nfs4_sequence_args seq_args;
242         nfs4_stateid stateid;
243         struct nfs4_layoutdriver_data layout;
244 };
245
246 struct nfs4_layoutget_res {
247         __u32 return_on_close;
248         struct pnfs_layout_range range;
249         __u32 type;
250         nfs4_stateid stateid;
251         struct nfs4_sequence_res seq_res;
252         struct nfs4_layoutdriver_data *layoutp;
253 };
254
255 struct nfs4_layoutget {
256         struct nfs4_layoutget_args args;
257         struct nfs4_layoutget_res res;
258         gfp_t gfp_flags;
259 };
260
261 struct nfs4_getdevicelist_args {
262         const struct nfs_fh *fh;
263         u32 layoutclass;
264         struct nfs4_sequence_args seq_args;
265 };
266
267 struct nfs4_getdevicelist_res {
268         struct pnfs_devicelist *devlist;
269         struct nfs4_sequence_res seq_res;
270 };
271
272 struct nfs4_getdeviceinfo_args {
273         struct pnfs_device *pdev;
274         struct nfs4_sequence_args seq_args;
275 };
276
277 struct nfs4_getdeviceinfo_res {
278         struct pnfs_device *pdev;
279         struct nfs4_sequence_res seq_res;
280 };
281
282 struct nfs4_layoutcommit_args {
283         nfs4_stateid stateid;
284         __u64 lastbytewritten;
285         struct inode *inode;
286         const u32 *bitmask;
287         struct nfs4_sequence_args seq_args;
288 };
289
290 struct nfs4_layoutcommit_res {
291         struct nfs_fattr *fattr;
292         const struct nfs_server *server;
293         struct nfs4_sequence_res seq_res;
294         int status;
295 };
296
297 struct nfs4_layoutcommit_data {
298         struct rpc_task task;
299         struct nfs_fattr fattr;
300         struct list_head lseg_list;
301         struct rpc_cred *cred;
302         struct nfs4_layoutcommit_args args;
303         struct nfs4_layoutcommit_res res;
304 };
305
306 struct nfs4_layoutreturn_args {
307         struct pnfs_layout_hdr *layout;
308         struct inode *inode;
309         nfs4_stateid stateid;
310         __u32   layout_type;
311         struct nfs4_sequence_args seq_args;
312 };
313
314 struct nfs4_layoutreturn_res {
315         struct nfs4_sequence_res seq_res;
316         u32 lrs_present;
317         nfs4_stateid stateid;
318 };
319
320 struct nfs4_layoutreturn {
321         struct nfs4_layoutreturn_args args;
322         struct nfs4_layoutreturn_res res;
323         struct rpc_cred *cred;
324         struct nfs_client *clp;
325         int rpc_status;
326 };
327
328 struct stateowner_id {
329         __u64   create_time;
330         __u32   uniquifier;
331 };
332
333 /*
334  * Arguments to the open call.
335  */
336 struct nfs_openargs {
337         const struct nfs_fh *   fh;
338         struct nfs_seqid *      seqid;
339         int                     open_flags;
340         fmode_t                 fmode;
341         u32                     access;
342         __u64                   clientid;
343         struct stateowner_id    id;
344         union {
345                 struct {
346                         struct iattr *  attrs;    /* UNCHECKED, GUARDED */
347                         nfs4_verifier   verifier; /* EXCLUSIVE */
348                 };
349                 nfs4_stateid    delegation;             /* CLAIM_DELEGATE_CUR */
350                 fmode_t         delegation_type;        /* CLAIM_PREVIOUS */
351         } u;
352         const struct qstr *     name;
353         const struct nfs_server *server;         /* Needed for ID mapping */
354         const u32 *             bitmask;
355         const u32 *             open_bitmap;
356         __u32                   claim;
357         struct nfs4_sequence_args       seq_args;
358 };
359
360 struct nfs_openres {
361         nfs4_stateid            stateid;
362         struct nfs_fh           fh;
363         struct nfs4_change_info cinfo;
364         __u32                   rflags;
365         struct nfs_fattr *      f_attr;
366         struct nfs_seqid *      seqid;
367         const struct nfs_server *server;
368         fmode_t                 delegation_type;
369         nfs4_stateid            delegation;
370         __u32                   do_recall;
371         __u64                   maxsize;
372         __u32                   attrset[NFS4_BITMAP_SIZE];
373         struct nfs4_string      *owner;
374         struct nfs4_string      *group_owner;
375         struct nfs4_sequence_res        seq_res;
376         __u32                   access_request;
377         __u32                   access_supported;
378         __u32                   access_result;
379 };
380
381 /*
382  * Arguments to the open_confirm call.
383  */
384 struct nfs_open_confirmargs {
385         const struct nfs_fh *   fh;
386         nfs4_stateid *          stateid;
387         struct nfs_seqid *      seqid;
388 };
389
390 struct nfs_open_confirmres {
391         nfs4_stateid            stateid;
392         struct nfs_seqid *      seqid;
393 };
394
395 /*
396  * Arguments to the close call.
397  */
398 struct nfs_closeargs {
399         struct nfs_fh *         fh;
400         nfs4_stateid *          stateid;
401         struct nfs_seqid *      seqid;
402         fmode_t                 fmode;
403         const u32 *             bitmask;
404         struct nfs4_sequence_args       seq_args;
405 };
406
407 struct nfs_closeres {
408         nfs4_stateid            stateid;
409         struct nfs_fattr *      fattr;
410         struct nfs_seqid *      seqid;
411         const struct nfs_server *server;
412         struct nfs4_sequence_res        seq_res;
413 };
414 /*
415  *  * Arguments to the lock,lockt, and locku call.
416  *   */
417 struct nfs_lowner {
418         __u64                   clientid;
419         __u64                   id;
420         dev_t                   s_dev;
421 };
422
423 struct nfs_lock_args {
424         struct nfs_fh *         fh;
425         struct file_lock *      fl;
426         struct nfs_seqid *      lock_seqid;
427         nfs4_stateid *          lock_stateid;
428         struct nfs_seqid *      open_seqid;
429         nfs4_stateid *          open_stateid;
430         struct nfs_lowner       lock_owner;
431         unsigned char           block : 1;
432         unsigned char           reclaim : 1;
433         unsigned char           new_lock_owner : 1;
434         struct nfs4_sequence_args       seq_args;
435 };
436
437 struct nfs_lock_res {
438         nfs4_stateid            stateid;
439         struct nfs_seqid *      lock_seqid;
440         struct nfs_seqid *      open_seqid;
441         struct nfs4_sequence_res        seq_res;
442 };
443
444 struct nfs_locku_args {
445         struct nfs_fh *         fh;
446         struct file_lock *      fl;
447         struct nfs_seqid *      seqid;
448         nfs4_stateid *          stateid;
449         struct nfs4_sequence_args       seq_args;
450 };
451
452 struct nfs_locku_res {
453         nfs4_stateid            stateid;
454         struct nfs_seqid *      seqid;
455         struct nfs4_sequence_res        seq_res;
456 };
457
458 struct nfs_lockt_args {
459         struct nfs_fh *         fh;
460         struct file_lock *      fl;
461         struct nfs_lowner       lock_owner;
462         struct nfs4_sequence_args       seq_args;
463 };
464
465 struct nfs_lockt_res {
466         struct file_lock *      denied; /* LOCK, LOCKT failed */
467         struct nfs4_sequence_res        seq_res;
468 };
469
470 struct nfs_release_lockowner_args {
471         struct nfs_lowner       lock_owner;
472 };
473
474 struct nfs4_delegreturnargs {
475         const struct nfs_fh *fhandle;
476         const nfs4_stateid *stateid;
477         const u32 * bitmask;
478         struct nfs4_sequence_args       seq_args;
479 };
480
481 struct nfs4_delegreturnres {
482         struct nfs_fattr * fattr;
483         const struct nfs_server *server;
484         struct nfs4_sequence_res        seq_res;
485 };
486
487 /*
488  * Arguments to the read call.
489  */
490 struct nfs_readargs {
491         struct nfs_fh *         fh;
492         struct nfs_open_context *context;
493         struct nfs_lock_context *lock_context;
494         __u64                   offset;
495         __u32                   count;
496         unsigned int            pgbase;
497         struct page **          pages;
498         struct nfs4_sequence_args       seq_args;
499 };
500
501 struct nfs_readres {
502         struct nfs_fattr *      fattr;
503         __u32                   count;
504         int                     eof;
505         struct nfs4_sequence_res        seq_res;
506 };
507
508 /*
509  * Arguments to the write call.
510  */
511 struct nfs_writeargs {
512         struct nfs_fh *         fh;
513         struct nfs_open_context *context;
514         struct nfs_lock_context *lock_context;
515         __u64                   offset;
516         __u32                   count;
517         enum nfs3_stable_how    stable;
518         unsigned int            pgbase;
519         struct page **          pages;
520         const u32 *             bitmask;
521         struct nfs4_sequence_args       seq_args;
522 };
523
524 struct nfs_write_verifier {
525         char                    data[8];
526 };
527
528 struct nfs_writeverf {
529         struct nfs_write_verifier verifier;
530         enum nfs3_stable_how    committed;
531 };
532
533 struct nfs_writeres {
534         struct nfs_fattr *      fattr;
535         struct nfs_writeverf *  verf;
536         __u32                   count;
537         const struct nfs_server *server;
538         struct nfs4_sequence_res        seq_res;
539 };
540
541 /*
542  * Arguments to the commit call.
543  */
544 struct nfs_commitargs {
545         struct nfs_fh           *fh;
546         __u64                   offset;
547         __u32                   count;
548         const u32               *bitmask;
549         struct nfs4_sequence_args       seq_args;
550 };
551
552 struct nfs_commitres {
553         struct nfs_fattr        *fattr;
554         struct nfs_writeverf    *verf;
555         const struct nfs_server *server;
556         struct nfs4_sequence_res        seq_res;
557 };
558
559 /*
560  * Common arguments to the unlink call
561  */
562 struct nfs_removeargs {
563         const struct nfs_fh     *fh;
564         struct qstr             name;
565         struct nfs4_sequence_args       seq_args;
566 };
567
568 struct nfs_removeres {
569         const struct nfs_server *server;
570         struct nfs_fattr        *dir_attr;
571         struct nfs4_change_info cinfo;
572         struct nfs4_sequence_res        seq_res;
573 };
574
575 /*
576  * Common arguments to the rename call
577  */
578 struct nfs_renameargs {
579         const struct nfs_fh             *old_dir;
580         const struct nfs_fh             *new_dir;
581         const struct qstr               *old_name;
582         const struct qstr               *new_name;
583         struct nfs4_sequence_args       seq_args;
584 };
585
586 struct nfs_renameres {
587         const struct nfs_server         *server;
588         struct nfs4_change_info         old_cinfo;
589         struct nfs_fattr                *old_fattr;
590         struct nfs4_change_info         new_cinfo;
591         struct nfs_fattr                *new_fattr;
592         struct nfs4_sequence_res        seq_res;
593 };
594
595 /*
596  * Argument struct for decode_entry function
597  */
598 struct nfs_entry {
599         __u64                   ino;
600         __u64                   cookie,
601                                 prev_cookie;
602         const char *            name;
603         unsigned int            len;
604         int                     eof;
605         struct nfs_fh *         fh;
606         struct nfs_fattr *      fattr;
607         unsigned char           d_type;
608         struct nfs_server *     server;
609 };
610
611 /*
612  * The following types are for NFSv2 only.
613  */
614 struct nfs_sattrargs {
615         struct nfs_fh *         fh;
616         struct iattr *          sattr;
617 };
618
619 struct nfs_diropargs {
620         struct nfs_fh *         fh;
621         const char *            name;
622         unsigned int            len;
623 };
624
625 struct nfs_createargs {
626         struct nfs_fh *         fh;
627         const char *            name;
628         unsigned int            len;
629         struct iattr *          sattr;
630 };
631
632 struct nfs_setattrargs {
633         struct nfs_fh *                 fh;
634         nfs4_stateid                    stateid;
635         struct iattr *                  iap;
636         const struct nfs_server *       server; /* Needed for name mapping */
637         const u32 *                     bitmask;
638         struct nfs4_sequence_args       seq_args;
639 };
640
641 struct nfs_setaclargs {
642         struct nfs_fh *                 fh;
643         size_t                          acl_len;
644         unsigned int                    acl_pgbase;
645         struct page **                  acl_pages;
646         struct nfs4_sequence_args       seq_args;
647 };
648
649 struct nfs_setaclres {
650         struct nfs4_sequence_res        seq_res;
651 };
652
653 struct nfs_getaclargs {
654         struct nfs_fh *                 fh;
655         size_t                          acl_len;
656         unsigned int                    acl_pgbase;
657         struct page **                  acl_pages;
658         struct nfs4_sequence_args       seq_args;
659 };
660
661 /* getxattr ACL interface flags */
662 #define NFS4_ACL_TRUNC          0x0001  /* ACL was truncated */
663 struct nfs_getaclres {
664         size_t                          acl_len;
665         size_t                          acl_data_offset;
666         int                             acl_flags;
667         struct page *                   acl_scratch;
668         struct nfs4_sequence_res        seq_res;
669 };
670
671 struct nfs_setattrres {
672         struct nfs_fattr *              fattr;
673         const struct nfs_server *       server;
674         struct nfs4_sequence_res        seq_res;
675 };
676
677 struct nfs_linkargs {
678         struct nfs_fh *         fromfh;
679         struct nfs_fh *         tofh;
680         const char *            toname;
681         unsigned int            tolen;
682 };
683
684 struct nfs_symlinkargs {
685         struct nfs_fh *         fromfh;
686         const char *            fromname;
687         unsigned int            fromlen;
688         struct page **          pages;
689         unsigned int            pathlen;
690         struct iattr *          sattr;
691 };
692
693 struct nfs_readdirargs {
694         struct nfs_fh *         fh;
695         __u32                   cookie;
696         unsigned int            count;
697         struct page **          pages;
698 };
699
700 struct nfs3_getaclargs {
701         struct nfs_fh *         fh;
702         int                     mask;
703         struct page **          pages;
704 };
705
706 struct nfs3_setaclargs {
707         struct inode *          inode;
708         int                     mask;
709         struct posix_acl *      acl_access;
710         struct posix_acl *      acl_default;
711         size_t                  len;
712         unsigned int            npages;
713         struct page **          pages;
714 };
715
716 struct nfs_diropok {
717         struct nfs_fh *         fh;
718         struct nfs_fattr *      fattr;
719 };
720
721 struct nfs_readlinkargs {
722         struct nfs_fh *         fh;
723         unsigned int            pgbase;
724         unsigned int            pglen;
725         struct page **          pages;
726 };
727
728 struct nfs3_sattrargs {
729         struct nfs_fh *         fh;
730         struct iattr *          sattr;
731         unsigned int            guard;
732         struct timespec         guardtime;
733 };
734
735 struct nfs3_diropargs {
736         struct nfs_fh *         fh;
737         const char *            name;
738         unsigned int            len;
739 };
740
741 struct nfs3_accessargs {
742         struct nfs_fh *         fh;
743         __u32                   access;
744 };
745
746 struct nfs3_createargs {
747         struct nfs_fh *         fh;
748         const char *            name;
749         unsigned int            len;
750         struct iattr *          sattr;
751         enum nfs3_createmode    createmode;
752         __be32                  verifier[2];
753 };
754
755 struct nfs3_mkdirargs {
756         struct nfs_fh *         fh;
757         const char *            name;
758         unsigned int            len;
759         struct iattr *          sattr;
760 };
761
762 struct nfs3_symlinkargs {
763         struct nfs_fh *         fromfh;
764         const char *            fromname;
765         unsigned int            fromlen;
766         struct page **          pages;
767         unsigned int            pathlen;
768         struct iattr *          sattr;
769 };
770
771 struct nfs3_mknodargs {
772         struct nfs_fh *         fh;
773         const char *            name;
774         unsigned int            len;
775         enum nfs3_ftype         type;
776         struct iattr *          sattr;
777         dev_t                   rdev;
778 };
779
780 struct nfs3_linkargs {
781         struct nfs_fh *         fromfh;
782         struct nfs_fh *         tofh;
783         const char *            toname;
784         unsigned int            tolen;
785 };
786
787 struct nfs3_readdirargs {
788         struct nfs_fh *         fh;
789         __u64                   cookie;
790         __be32                  verf[2];
791         int                     plus;
792         unsigned int            count;
793         struct page **          pages;
794 };
795
796 struct nfs3_diropres {
797         struct nfs_fattr *      dir_attr;
798         struct nfs_fh *         fh;
799         struct nfs_fattr *      fattr;
800 };
801
802 struct nfs3_accessres {
803         struct nfs_fattr *      fattr;
804         __u32                   access;
805 };
806
807 struct nfs3_readlinkargs {
808         struct nfs_fh *         fh;
809         unsigned int            pgbase;
810         unsigned int            pglen;
811         struct page **          pages;
812 };
813
814 struct nfs3_linkres {
815         struct nfs_fattr *      dir_attr;
816         struct nfs_fattr *      fattr;
817 };
818
819 struct nfs3_readdirres {
820         struct nfs_fattr *      dir_attr;
821         __be32 *                verf;
822         int                     plus;
823 };
824
825 struct nfs3_getaclres {
826         struct nfs_fattr *      fattr;
827         int                     mask;
828         unsigned int            acl_access_count;
829         unsigned int            acl_default_count;
830         struct posix_acl *      acl_access;
831         struct posix_acl *      acl_default;
832 };
833
834 #if IS_ENABLED(CONFIG_NFS_V4)
835
836 typedef u64 clientid4;
837
838 struct nfs4_accessargs {
839         const struct nfs_fh *           fh;
840         const u32 *                     bitmask;
841         u32                             access;
842         struct nfs4_sequence_args       seq_args;
843 };
844
845 struct nfs4_accessres {
846         const struct nfs_server *       server;
847         struct nfs_fattr *              fattr;
848         u32                             supported;
849         u32                             access;
850         struct nfs4_sequence_res        seq_res;
851 };
852
853 struct nfs4_create_arg {
854         u32                             ftype;
855         union {
856                 struct {
857                         struct page **  pages;
858                         unsigned int    len;
859                 } symlink;   /* NF4LNK */
860                 struct {
861                         u32             specdata1;
862                         u32             specdata2;
863                 } device;    /* NF4BLK, NF4CHR */
864         } u;
865         const struct qstr *             name;
866         const struct nfs_server *       server;
867         const struct iattr *            attrs;
868         const struct nfs_fh *           dir_fh;
869         const u32 *                     bitmask;
870         struct nfs4_sequence_args       seq_args;
871 };
872
873 struct nfs4_create_res {
874         const struct nfs_server *       server;
875         struct nfs_fh *                 fh;
876         struct nfs_fattr *              fattr;
877         struct nfs4_change_info         dir_cinfo;
878         struct nfs4_sequence_res        seq_res;
879 };
880
881 struct nfs4_fsinfo_arg {
882         const struct nfs_fh *           fh;
883         const u32 *                     bitmask;
884         struct nfs4_sequence_args       seq_args;
885 };
886
887 struct nfs4_fsinfo_res {
888         struct nfs_fsinfo              *fsinfo;
889         struct nfs4_sequence_res        seq_res;
890 };
891
892 struct nfs4_getattr_arg {
893         const struct nfs_fh *           fh;
894         const u32 *                     bitmask;
895         struct nfs4_sequence_args       seq_args;
896 };
897
898 struct nfs4_getattr_res {
899         const struct nfs_server *       server;
900         struct nfs_fattr *              fattr;
901         struct nfs4_sequence_res        seq_res;
902 };
903
904 struct nfs4_link_arg {
905         const struct nfs_fh *           fh;
906         const struct nfs_fh *           dir_fh;
907         const struct qstr *             name;
908         const u32 *                     bitmask;
909         struct nfs4_sequence_args       seq_args;
910 };
911
912 struct nfs4_link_res {
913         const struct nfs_server *       server;
914         struct nfs_fattr *              fattr;
915         struct nfs4_change_info         cinfo;
916         struct nfs_fattr *              dir_attr;
917         struct nfs4_sequence_res        seq_res;
918 };
919
920
921 struct nfs4_lookup_arg {
922         const struct nfs_fh *           dir_fh;
923         const struct qstr *             name;
924         const u32 *                     bitmask;
925         struct nfs4_sequence_args       seq_args;
926 };
927
928 struct nfs4_lookup_res {
929         const struct nfs_server *       server;
930         struct nfs_fattr *              fattr;
931         struct nfs_fh *                 fh;
932         struct nfs4_sequence_res        seq_res;
933 };
934
935 struct nfs4_lookup_root_arg {
936         const u32 *                     bitmask;
937         struct nfs4_sequence_args       seq_args;
938 };
939
940 struct nfs4_pathconf_arg {
941         const struct nfs_fh *           fh;
942         const u32 *                     bitmask;
943         struct nfs4_sequence_args       seq_args;
944 };
945
946 struct nfs4_pathconf_res {
947         struct nfs_pathconf            *pathconf;
948         struct nfs4_sequence_res        seq_res;
949 };
950
951 struct nfs4_readdir_arg {
952         const struct nfs_fh *           fh;
953         u64                             cookie;
954         nfs4_verifier                   verifier;
955         u32                             count;
956         struct page **                  pages;  /* zero-copy data */
957         unsigned int                    pgbase; /* zero-copy data */
958         const u32 *                     bitmask;
959         int                             plus;
960         struct nfs4_sequence_args       seq_args;
961 };
962
963 struct nfs4_readdir_res {
964         nfs4_verifier                   verifier;
965         unsigned int                    pgbase;
966         struct nfs4_sequence_res        seq_res;
967 };
968
969 struct nfs4_readlink {
970         const struct nfs_fh *           fh;
971         unsigned int                    pgbase;
972         unsigned int                    pglen;   /* zero-copy data */
973         struct page **                  pages;   /* zero-copy data */
974         struct nfs4_sequence_args       seq_args;
975 };
976
977 struct nfs4_readlink_res {
978         struct nfs4_sequence_res        seq_res;
979 };
980
981 #define NFS4_SETCLIENTID_NAMELEN        (127)
982 struct nfs4_setclientid {
983         const nfs4_verifier *           sc_verifier;
984         unsigned int                    sc_name_len;
985         char                            sc_name[NFS4_SETCLIENTID_NAMELEN + 1];
986         u32                             sc_prog;
987         unsigned int                    sc_netid_len;
988         char                            sc_netid[RPCBIND_MAXNETIDLEN + 1];
989         unsigned int                    sc_uaddr_len;
990         char                            sc_uaddr[RPCBIND_MAXUADDRLEN + 1];
991         u32                             sc_cb_ident;
992 };
993
994 struct nfs4_setclientid_res {
995         u64                             clientid;
996         nfs4_verifier                   confirm;
997 };
998
999 struct nfs4_statfs_arg {
1000         const struct nfs_fh *           fh;
1001         const u32 *                     bitmask;
1002         struct nfs4_sequence_args       seq_args;
1003 };
1004
1005 struct nfs4_statfs_res {
1006         struct nfs_fsstat              *fsstat;
1007         struct nfs4_sequence_res        seq_res;
1008 };
1009
1010 struct nfs4_server_caps_arg {
1011         struct nfs_fh                  *fhandle;
1012         struct nfs4_sequence_args       seq_args;
1013 };
1014
1015 struct nfs4_server_caps_res {
1016         u32                             attr_bitmask[3];
1017         u32                             acl_bitmask;
1018         u32                             has_links;
1019         u32                             has_symlinks;
1020         u32                             fh_expire_type;
1021         struct nfs4_sequence_res        seq_res;
1022 };
1023
1024 #define NFS4_PATHNAME_MAXCOMPONENTS 512
1025 struct nfs4_pathname {
1026         unsigned int ncomponents;
1027         struct nfs4_string components[NFS4_PATHNAME_MAXCOMPONENTS];
1028 };
1029
1030 #define NFS4_FS_LOCATION_MAXSERVERS 10
1031 struct nfs4_fs_location {
1032         unsigned int nservers;
1033         struct nfs4_string servers[NFS4_FS_LOCATION_MAXSERVERS];
1034         struct nfs4_pathname rootpath;
1035 };
1036
1037 #define NFS4_FS_LOCATIONS_MAXENTRIES 10
1038 struct nfs4_fs_locations {
1039         struct nfs_fattr fattr;
1040         const struct nfs_server *server;
1041         struct nfs4_pathname fs_path;
1042         int nlocations;
1043         struct nfs4_fs_location locations[NFS4_FS_LOCATIONS_MAXENTRIES];
1044 };
1045
1046 struct nfs4_fs_locations_arg {
1047         const struct nfs_fh *dir_fh;
1048         const struct qstr *name;
1049         struct page *page;
1050         const u32 *bitmask;
1051         struct nfs4_sequence_args       seq_args;
1052 };
1053
1054 struct nfs4_fs_locations_res {
1055         struct nfs4_fs_locations       *fs_locations;
1056         struct nfs4_sequence_res        seq_res;
1057 };
1058
1059 struct nfs4_secinfo_oid {
1060         unsigned int len;
1061         char data[GSS_OID_MAX_LEN];
1062 };
1063
1064 struct nfs4_secinfo_gss {
1065         struct nfs4_secinfo_oid sec_oid4;
1066         unsigned int qop4;
1067         unsigned int service;
1068 };
1069
1070 struct nfs4_secinfo_flavor {
1071         unsigned int            flavor;
1072         struct nfs4_secinfo_gss gss;
1073 };
1074
1075 struct nfs4_secinfo_flavors {
1076         unsigned int num_flavors;
1077         struct nfs4_secinfo_flavor flavors[0];
1078 };
1079
1080 struct nfs4_secinfo_arg {
1081         const struct nfs_fh             *dir_fh;
1082         const struct qstr               *name;
1083         struct nfs4_sequence_args       seq_args;
1084 };
1085
1086 struct nfs4_secinfo_res {
1087         struct nfs4_secinfo_flavors     *flavors;
1088         struct nfs4_sequence_res        seq_res;
1089 };
1090
1091 #endif /* CONFIG_NFS_V4 */
1092
1093 struct nfstime4 {
1094         u64     seconds;
1095         u32     nseconds;
1096 };
1097
1098 #ifdef CONFIG_NFS_V4_1
1099
1100 struct pnfs_commit_bucket {
1101         struct list_head written;
1102         struct list_head committing;
1103         struct pnfs_layout_segment *wlseg;
1104         struct pnfs_layout_segment *clseg;
1105 };
1106
1107 struct pnfs_ds_commit_info {
1108         int nwritten;
1109         int ncommitting;
1110         int nbuckets;
1111         struct pnfs_commit_bucket *buckets;
1112 };
1113
1114 #define NFS4_EXCHANGE_ID_LEN    (48)
1115 struct nfs41_exchange_id_args {
1116         struct nfs_client               *client;
1117         nfs4_verifier                   *verifier;
1118         unsigned int                    id_len;
1119         char                            id[NFS4_EXCHANGE_ID_LEN];
1120         u32                             flags;
1121 };
1122
1123 struct nfs41_server_owner {
1124         uint64_t                        minor_id;
1125         uint32_t                        major_id_sz;
1126         char                            major_id[NFS4_OPAQUE_LIMIT];
1127 };
1128
1129 struct nfs41_server_scope {
1130         uint32_t                        server_scope_sz;
1131         char                            server_scope[NFS4_OPAQUE_LIMIT];
1132 };
1133
1134 struct nfs41_impl_id {
1135         char                            domain[NFS4_OPAQUE_LIMIT + 1];
1136         char                            name[NFS4_OPAQUE_LIMIT + 1];
1137         struct nfstime4                 date;
1138 };
1139
1140 struct nfs41_bind_conn_to_session_res {
1141         struct nfs4_session             *session;
1142         u32                             dir;
1143         bool                            use_conn_in_rdma_mode;
1144 };
1145
1146 struct nfs41_exchange_id_res {
1147         u64                             clientid;
1148         u32                             seqid;
1149         u32                             flags;
1150         struct nfs41_server_owner       *server_owner;
1151         struct nfs41_server_scope       *server_scope;
1152         struct nfs41_impl_id            *impl_id;
1153 };
1154
1155 struct nfs41_create_session_args {
1156         struct nfs_client              *client;
1157         uint32_t                        flags;
1158         uint32_t                        cb_program;
1159         struct nfs4_channel_attrs       fc_attrs;       /* Fore Channel */
1160         struct nfs4_channel_attrs       bc_attrs;       /* Back Channel */
1161 };
1162
1163 struct nfs41_create_session_res {
1164         struct nfs_client              *client;
1165 };
1166
1167 struct nfs41_reclaim_complete_args {
1168         /* In the future extend to include curr_fh for use with migration */
1169         unsigned char                   one_fs:1;
1170         struct nfs4_sequence_args       seq_args;
1171 };
1172
1173 struct nfs41_reclaim_complete_res {
1174         struct nfs4_sequence_res        seq_res;
1175 };
1176
1177 #define SECINFO_STYLE_CURRENT_FH 0
1178 #define SECINFO_STYLE_PARENT 1
1179 struct nfs41_secinfo_no_name_args {
1180         int                             style;
1181         struct nfs4_sequence_args       seq_args;
1182 };
1183
1184 struct nfs41_test_stateid_args {
1185         nfs4_stateid                    *stateid;
1186         struct nfs4_sequence_args       seq_args;
1187 };
1188
1189 struct nfs41_test_stateid_res {
1190         unsigned int                    status;
1191         struct nfs4_sequence_res        seq_res;
1192 };
1193
1194 struct nfs41_free_stateid_args {
1195         nfs4_stateid                    *stateid;
1196         struct nfs4_sequence_args       seq_args;
1197 };
1198
1199 struct nfs41_free_stateid_res {
1200         unsigned int                    status;
1201         struct nfs4_sequence_res        seq_res;
1202 };
1203
1204 #else
1205
1206 struct pnfs_ds_commit_info {
1207 };
1208
1209 #endif /* CONFIG_NFS_V4_1 */
1210
1211 struct nfs_page;
1212
1213 #define NFS_PAGEVEC_SIZE        (8U)
1214
1215 struct nfs_page_array {
1216         struct page             **pagevec;
1217         unsigned int            npages;         /* Max length of pagevec */
1218         struct page             *page_array[NFS_PAGEVEC_SIZE];
1219 };
1220
1221 struct nfs_read_data {
1222         struct nfs_pgio_header  *header;
1223         struct list_head        list;
1224         struct rpc_task         task;
1225         struct nfs_fattr        fattr;  /* fattr storage */
1226         struct nfs_readargs args;
1227         struct nfs_readres  res;
1228         unsigned long           timestamp;      /* For lease renewal */
1229         int (*read_done_cb) (struct rpc_task *task, struct nfs_read_data *data);
1230         __u64                   mds_offset;
1231         struct nfs_page_array   pages;
1232         struct nfs_client       *ds_clp;        /* pNFS data server */
1233 };
1234
1235 /* used as flag bits in nfs_pgio_header */
1236 enum {
1237         NFS_IOHDR_ERROR = 0,
1238         NFS_IOHDR_EOF,
1239         NFS_IOHDR_REDO,
1240         NFS_IOHDR_NEED_COMMIT,
1241         NFS_IOHDR_NEED_RESCHED,
1242 };
1243
1244 struct nfs_pgio_header {
1245         struct inode            *inode;
1246         struct rpc_cred         *cred;
1247         struct list_head        pages;
1248         struct list_head        rpc_list;
1249         atomic_t                refcnt;
1250         struct nfs_page         *req;
1251         struct nfs_writeverf    *verf;
1252         struct pnfs_layout_segment *lseg;
1253         loff_t                  io_start;
1254         const struct rpc_call_ops *mds_ops;
1255         void (*release) (struct nfs_pgio_header *hdr);
1256         const struct nfs_pgio_completion_ops *completion_ops;
1257         struct nfs_direct_req   *dreq;
1258         void                    *layout_private;
1259         spinlock_t              lock;
1260         /* fields protected by lock */
1261         int                     pnfs_error;
1262         int                     error;          /* merge with pnfs_error */
1263         unsigned long           good_bytes;     /* boundary of good data */
1264         unsigned long           flags;
1265 };
1266
1267 struct nfs_read_header {
1268         struct nfs_pgio_header  header;
1269         struct nfs_read_data    rpc_data;
1270 };
1271
1272 struct nfs_write_data {
1273         struct nfs_pgio_header  *header;
1274         struct list_head        list;
1275         struct rpc_task         task;
1276         struct nfs_fattr        fattr;
1277         struct nfs_writeverf    verf;
1278         struct nfs_writeargs    args;           /* argument struct */
1279         struct nfs_writeres     res;            /* result struct */
1280         unsigned long           timestamp;      /* For lease renewal */
1281         int (*write_done_cb) (struct rpc_task *task, struct nfs_write_data *data);
1282         __u64                   mds_offset;     /* Filelayout dense stripe */
1283         struct nfs_page_array   pages;
1284         struct nfs_client       *ds_clp;        /* pNFS data server */
1285 };
1286
1287 struct nfs_write_header {
1288         struct nfs_pgio_header  header;
1289         struct nfs_write_data   rpc_data;
1290         struct nfs_writeverf    verf;
1291 };
1292
1293 struct nfs_mds_commit_info {
1294         atomic_t rpcs_out;
1295         unsigned long           ncommit;
1296         struct list_head        list;
1297 };
1298
1299 struct nfs_commit_data;
1300 struct nfs_inode;
1301 struct nfs_commit_completion_ops {
1302         void (*error_cleanup) (struct nfs_inode *nfsi);
1303         void (*completion) (struct nfs_commit_data *data);
1304 };
1305
1306 struct nfs_commit_info {
1307         spinlock_t                      *lock;
1308         struct nfs_mds_commit_info      *mds;
1309         struct pnfs_ds_commit_info      *ds;
1310         struct nfs_direct_req           *dreq;  /* O_DIRECT request */
1311         const struct nfs_commit_completion_ops *completion_ops;
1312 };
1313
1314 struct nfs_commit_data {
1315         struct rpc_task         task;
1316         struct inode            *inode;
1317         struct rpc_cred         *cred;
1318         struct nfs_fattr        fattr;
1319         struct nfs_writeverf    verf;
1320         struct list_head        pages;          /* Coalesced requests we wish to flush */
1321         struct list_head        list;           /* lists of struct nfs_write_data */
1322         struct nfs_direct_req   *dreq;          /* O_DIRECT request */
1323         struct nfs_commitargs   args;           /* argument struct */
1324         struct nfs_commitres    res;            /* result struct */
1325         struct nfs_open_context *context;
1326         struct pnfs_layout_segment *lseg;
1327         struct nfs_client       *ds_clp;        /* pNFS data server */
1328         int                     ds_commit_index;
1329         const struct rpc_call_ops *mds_ops;
1330         const struct nfs_commit_completion_ops *completion_ops;
1331         int (*commit_done_cb) (struct rpc_task *task, struct nfs_commit_data *data);
1332 };
1333
1334 struct nfs_pgio_completion_ops {
1335         void    (*error_cleanup)(struct list_head *head);
1336         void    (*init_hdr)(struct nfs_pgio_header *hdr);
1337         void    (*completion)(struct nfs_pgio_header *hdr);
1338 };
1339
1340 struct nfs_unlinkdata {
1341         struct hlist_node list;
1342         struct nfs_removeargs args;
1343         struct nfs_removeres res;
1344         struct inode *dir;
1345         struct rpc_cred *cred;
1346         struct nfs_fattr dir_attr;
1347 };
1348
1349 struct nfs_renamedata {
1350         struct nfs_renameargs   args;
1351         struct nfs_renameres    res;
1352         struct rpc_cred         *cred;
1353         struct inode            *old_dir;
1354         struct dentry           *old_dentry;
1355         struct nfs_fattr        old_fattr;
1356         struct inode            *new_dir;
1357         struct dentry           *new_dentry;
1358         struct nfs_fattr        new_fattr;
1359 };
1360
1361 struct nfs_access_entry;
1362 struct nfs_client;
1363 struct rpc_timeout;
1364 struct nfs_subversion;
1365 struct nfs_mount_info;
1366 struct nfs_client_initdata;
1367 struct nfs_pageio_descriptor;
1368
1369 /*
1370  * RPC procedure vector for NFSv2/NFSv3 demuxing
1371  */
1372 struct nfs_rpc_ops {
1373         u32     version;                /* Protocol version */
1374         const struct dentry_operations *dentry_ops;
1375         const struct inode_operations *dir_inode_ops;
1376         const struct inode_operations *file_inode_ops;
1377         const struct file_operations *file_ops;
1378
1379         int     (*getroot) (struct nfs_server *, struct nfs_fh *,
1380                             struct nfs_fsinfo *);
1381         struct vfsmount *(*submount) (struct nfs_server *, struct dentry *,
1382                                       struct nfs_fh *, struct nfs_fattr *);
1383         struct dentry *(*try_mount) (int, const char *, struct nfs_mount_info *,
1384                                      struct nfs_subversion *);
1385         int     (*getattr) (struct nfs_server *, struct nfs_fh *,
1386                             struct nfs_fattr *);
1387         int     (*setattr) (struct dentry *, struct nfs_fattr *,
1388                             struct iattr *);
1389         int     (*lookup)  (struct inode *, struct qstr *,
1390                             struct nfs_fh *, struct nfs_fattr *);
1391         int     (*access)  (struct inode *, struct nfs_access_entry *);
1392         int     (*readlink)(struct inode *, struct page *, unsigned int,
1393                             unsigned int);
1394         int     (*create)  (struct inode *, struct dentry *,
1395                             struct iattr *, int);
1396         int     (*remove)  (struct inode *, struct qstr *);
1397         void    (*unlink_setup)  (struct rpc_message *, struct inode *dir);
1398         void    (*unlink_rpc_prepare) (struct rpc_task *, struct nfs_unlinkdata *);
1399         int     (*unlink_done) (struct rpc_task *, struct inode *);
1400         int     (*rename)  (struct inode *, struct qstr *,
1401                             struct inode *, struct qstr *);
1402         void    (*rename_setup)  (struct rpc_message *msg, struct inode *dir);
1403         void    (*rename_rpc_prepare)(struct rpc_task *task, struct nfs_renamedata *);
1404         int     (*rename_done) (struct rpc_task *task, struct inode *old_dir, struct inode *new_dir);
1405         int     (*link)    (struct inode *, struct inode *, struct qstr *);
1406         int     (*symlink) (struct inode *, struct dentry *, struct page *,
1407                             unsigned int, struct iattr *);
1408         int     (*mkdir)   (struct inode *, struct dentry *, struct iattr *);
1409         int     (*rmdir)   (struct inode *, struct qstr *);
1410         int     (*readdir) (struct dentry *, struct rpc_cred *,
1411                             u64, struct page **, unsigned int, int);
1412         int     (*mknod)   (struct inode *, struct dentry *, struct iattr *,
1413                             dev_t);
1414         int     (*statfs)  (struct nfs_server *, struct nfs_fh *,
1415                             struct nfs_fsstat *);
1416         int     (*fsinfo)  (struct nfs_server *, struct nfs_fh *,
1417                             struct nfs_fsinfo *);
1418         int     (*pathconf) (struct nfs_server *, struct nfs_fh *,
1419                              struct nfs_pathconf *);
1420         int     (*set_capabilities)(struct nfs_server *, struct nfs_fh *);
1421         int     (*decode_dirent)(struct xdr_stream *, struct nfs_entry *, int);
1422         void    (*read_setup)   (struct nfs_read_data *, struct rpc_message *);
1423         void    (*read_pageio_init)(struct nfs_pageio_descriptor *, struct inode *,
1424                                     const struct nfs_pgio_completion_ops *);
1425         void    (*read_rpc_prepare)(struct rpc_task *, struct nfs_read_data *);
1426         int     (*read_done)  (struct rpc_task *, struct nfs_read_data *);
1427         void    (*write_setup)  (struct nfs_write_data *, struct rpc_message *);
1428         void    (*write_pageio_init)(struct nfs_pageio_descriptor *, struct inode *, int,
1429                                      const struct nfs_pgio_completion_ops *);
1430         void    (*write_rpc_prepare)(struct rpc_task *, struct nfs_write_data *);
1431         int     (*write_done)  (struct rpc_task *, struct nfs_write_data *);
1432         void    (*commit_setup) (struct nfs_commit_data *, struct rpc_message *);
1433         void    (*commit_rpc_prepare)(struct rpc_task *, struct nfs_commit_data *);
1434         int     (*commit_done) (struct rpc_task *, struct nfs_commit_data *);
1435         int     (*lock)(struct file *, int, struct file_lock *);
1436         int     (*lock_check_bounds)(const struct file_lock *);
1437         void    (*clear_acl_cache)(struct inode *);
1438         void    (*close_context)(struct nfs_open_context *ctx, int);
1439         struct inode * (*open_context) (struct inode *dir,
1440                                 struct nfs_open_context *ctx,
1441                                 int open_flags,
1442                                 struct iattr *iattr);
1443         int (*have_delegation)(struct inode *, fmode_t);
1444         int (*return_delegation)(struct inode *);
1445         struct nfs_client *(*alloc_client) (const struct nfs_client_initdata *);
1446         struct nfs_client *
1447                 (*init_client) (struct nfs_client *, const struct rpc_timeout *,
1448                                 const char *, rpc_authflavor_t);
1449         void    (*free_client) (struct nfs_client *);
1450         struct nfs_server *(*create_server)(struct nfs_mount_info *, struct nfs_subversion *);
1451         struct nfs_server *(*clone_server)(struct nfs_server *, struct nfs_fh *,
1452                                            struct nfs_fattr *, rpc_authflavor_t);
1453 };
1454
1455 /*
1456  *      NFS_CALL(getattr, inode, (fattr));
1457  * into
1458  *      NFS_PROTO(inode)->getattr(fattr);
1459  */
1460 #define NFS_CALL(op, inode, args)       NFS_PROTO(inode)->op args
1461
1462 /*
1463  * Function vectors etc. for the NFS client
1464  */
1465 extern const struct nfs_rpc_ops nfs_v2_clientops;
1466 extern const struct nfs_rpc_ops nfs_v3_clientops;
1467 extern const struct nfs_rpc_ops nfs_v4_clientops;
1468 extern const struct rpc_version nfs_version2;
1469 extern const struct rpc_version nfs_version3;
1470 extern const struct rpc_version nfs_version4;
1471
1472 extern const struct rpc_version nfsacl_version3;
1473 extern const struct rpc_program nfsacl_program;
1474
1475 #endif