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