1 /****************************************************************************
2 ****************************************************************************
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
10 ****************************************************************************
11 ****************************************************************************/
12 #ifndef _LINUX_NFS_XDR_H
13 #define _LINUX_NFS_XDR_H
15 #include <linux/sunrpc/xprt.h>
16 #include <linux/nfsacl.h>
18 #define NFS_MAX_FILE_IO_SIZE (1048576U)
19 #define NFS_DEF_FILE_IO_SIZE (4096U)
20 #define NFS_MIN_FILE_IO_SIZE (1024U)
27 #define NFS_ATTR_WCC 0x0001
28 #define NFS_ATTR_FATTR 0x0002
29 #define NFS_ATTR_FATTR_V3 0x0004
30 #define NFS_ATTR_FATTR_V4 0x0008
31 #define NFS_ATTR_FATTR_V4_REFERRAL 0x0010
34 struct nfs_fattr *fattr;
47 struct nfs_fattr *fattr;
65 struct nfs_fattr *fattr;
70 struct nfs4_change_info {
79 const struct nfs_fh * fh;
80 struct nfs_seqid * seqid;
86 nfs4_verifier verifier;
87 nfs4_stateid delegation;
90 const struct qstr * name;
91 const struct nfs_server *server;
99 struct nfs4_change_info cinfo;
101 struct nfs_fattr * f_attr;
102 struct nfs_fattr * dir_attr;
103 const struct nfs_server *server;
105 nfs4_stateid delegation;
110 struct nfs_open_confirmargs {
111 const struct nfs_fh * fh;
112 nfs4_stateid * stateid;
113 struct nfs_seqid * seqid;
116 struct nfs_open_confirmres {
117 nfs4_stateid stateid;
120 struct nfs_closeargs {
122 nfs4_stateid * stateid;
123 struct nfs_seqid * seqid;
128 struct nfs_closeres {
129 nfs4_stateid stateid;
130 struct nfs_fattr * fattr;
131 const struct nfs_server *server;
139 struct nfs_lock_args {
141 struct file_lock * fl;
142 struct nfs_seqid * lock_seqid;
143 nfs4_stateid * lock_stateid;
144 struct nfs_seqid * open_seqid;
145 nfs4_stateid * open_stateid;
146 struct nfs_lowner lock_owner;
147 unsigned char block : 1;
148 unsigned char reclaim : 1;
149 unsigned char new_lock_owner : 1;
152 struct nfs_lock_res {
153 nfs4_stateid stateid;
156 struct nfs_locku_args {
158 struct file_lock * fl;
159 struct nfs_seqid * seqid;
160 nfs4_stateid * stateid;
163 struct nfs_locku_res {
164 nfs4_stateid stateid;
167 struct nfs_lockt_args {
169 struct file_lock * fl;
170 struct nfs_lowner lock_owner;
173 struct nfs_lockt_res {
174 struct file_lock * denied;
177 struct nfs4_delegreturnargs {
178 const struct nfs_fh *fhandle;
179 const nfs4_stateid *stateid;
183 struct nfs4_delegreturnres {
184 struct nfs_fattr * fattr;
185 const struct nfs_server *server;
188 struct nfs_readargs {
190 struct nfs_open_context *context;
194 struct page ** pages;
198 struct nfs_fattr * fattr;
203 struct nfs_writeargs {
205 struct nfs_open_context *context;
208 enum nfs3_stable_how stable;
210 struct page ** pages;
214 struct nfs_writeverf {
215 enum nfs3_stable_how committed;
219 struct nfs_writeres {
220 struct nfs_fattr * fattr;
221 struct nfs_writeverf * verf;
223 const struct nfs_server *server;
234 struct nfs_fattr * fattr;
237 struct nfs_sattrargs {
239 struct iattr * sattr;
242 struct nfs_diropargs {
248 struct nfs_createargs {
252 struct iattr * sattr;
255 struct nfs_renameargs {
256 struct nfs_fh * fromfh;
257 const char * fromname;
258 unsigned int fromlen;
259 struct nfs_fh * tofh;
264 struct nfs_setattrargs {
266 nfs4_stateid stateid;
268 const struct nfs_server * server;
272 struct nfs_setaclargs {
275 unsigned int acl_pgbase;
276 struct page ** acl_pages;
279 struct nfs_getaclargs {
282 unsigned int acl_pgbase;
283 struct page ** acl_pages;
286 struct nfs_setattrres {
287 struct nfs_fattr * fattr;
288 const struct nfs_server * server;
291 struct nfs_linkargs {
292 struct nfs_fh * fromfh;
293 struct nfs_fh * tofh;
298 struct nfs_symlinkargs {
299 struct nfs_fh * fromfh;
300 const char * fromname;
301 unsigned int fromlen;
304 struct iattr * sattr;
307 struct nfs_readdirargs {
311 struct page ** pages;
314 struct nfs3_getaclargs {
317 struct page ** pages;
320 struct nfs3_setaclargs {
321 struct inode * inode;
323 struct posix_acl * acl_access;
324 struct posix_acl * acl_default;
325 struct page ** pages;
330 struct nfs_fattr * fattr;
333 struct nfs_readlinkargs {
337 struct page ** pages;
340 struct nfs3_sattrargs {
342 struct iattr * sattr;
344 struct timespec guardtime;
347 struct nfs3_diropargs {
353 struct nfs3_accessargs {
358 struct nfs3_createargs {
362 struct iattr * sattr;
363 enum nfs3_createmode createmode;
367 struct nfs3_mkdirargs {
371 struct iattr * sattr;
374 struct nfs3_symlinkargs {
375 struct nfs_fh * fromfh;
376 const char * fromname;
377 unsigned int fromlen;
380 struct iattr * sattr;
383 struct nfs3_mknodargs {
387 enum nfs3_ftype type;
388 struct iattr * sattr;
392 struct nfs3_renameargs {
393 struct nfs_fh * fromfh;
394 const char * fromname;
395 unsigned int fromlen;
396 struct nfs_fh * tofh;
401 struct nfs3_linkargs {
402 struct nfs_fh * fromfh;
403 struct nfs_fh * tofh;
408 struct nfs3_readdirargs {
414 struct page ** pages;
417 struct nfs3_diropres {
418 struct nfs_fattr * dir_attr;
420 struct nfs_fattr * fattr;
423 struct nfs3_accessres {
424 struct nfs_fattr * fattr;
428 struct nfs3_readlinkargs {
432 struct page ** pages;
435 struct nfs3_renameres {
436 struct nfs_fattr * fromattr;
437 struct nfs_fattr * toattr;
440 struct nfs3_linkres {
441 struct nfs_fattr * dir_attr;
442 struct nfs_fattr * fattr;
445 struct nfs3_readdirres {
446 struct nfs_fattr * dir_attr;
451 struct nfs3_getaclres {
452 struct nfs_fattr * fattr;
454 unsigned int acl_access_count;
455 unsigned int acl_default_count;
456 struct posix_acl * acl_access;
457 struct posix_acl * acl_default;
462 #define NFS_PAGEVEC_SIZE (8U)
464 struct nfs_read_data {
466 struct rpc_task task;
468 struct rpc_cred *cred;
469 struct nfs_fattr fattr;
470 struct list_head pages;
471 struct nfs_page *req;
472 struct page **pagevec;
474 struct nfs_readargs args;
475 struct nfs_readres res;
476 struct page *page_array[NFS_PAGEVEC_SIZE];
479 struct nfs_write_data {
481 struct rpc_task task;
483 struct rpc_cred *cred;
484 struct nfs_fattr fattr;
485 struct nfs_writeverf verf;
486 struct list_head pages;
487 struct nfs_page *req;
488 struct page **pagevec;
490 struct nfs_writeargs args;
491 struct nfs_writeres res;
492 struct page *page_array[NFS_PAGEVEC_SIZE];
495 struct nfs_access_entry;
499 struct dentry_operations *dentry_ops;
500 struct inode_operations *dir_inode_ops;
501 struct inode_operations *file_inode_ops;
503 int (*getroot) (struct nfs_server *, struct nfs_fh *,
504 struct nfs_fsinfo *);
505 int (*getattr) (struct nfs_server *, struct nfs_fh *,
507 int (*setattr) (struct dentry *, struct nfs_fattr *,
509 int (*lookup) (struct inode *, struct qstr *,
510 struct nfs_fh *, struct nfs_fattr *);
511 int (*access) (struct inode *, struct nfs_access_entry *);
512 int (*readlink)(struct inode *, struct page *, unsigned int,
514 int (*read) (struct nfs_read_data *);
515 int (*write) (struct nfs_write_data *);
516 int (*commit) (struct nfs_write_data *);
517 int (*create) (struct inode *, struct dentry *,
518 struct iattr *, int, struct nameidata *);
519 int (*remove) (struct inode *, struct qstr *);
520 int (*unlink_setup) (struct rpc_message *,
521 struct dentry *, struct qstr *);
522 int (*unlink_done) (struct dentry *, struct rpc_task *);
523 int (*rename) (struct inode *, struct qstr *,
524 struct inode *, struct qstr *);
525 int (*link) (struct inode *, struct inode *, struct qstr *);
526 int (*symlink) (struct inode *, struct qstr *, struct qstr *,
527 struct iattr *, struct nfs_fh *,
529 int (*mkdir) (struct inode *, struct dentry *, struct iattr *);
530 int (*rmdir) (struct inode *, struct qstr *);
531 int (*readdir) (struct dentry *, struct rpc_cred *,
532 u64, struct page *, unsigned int, int);
533 int (*mknod) (struct inode *, struct dentry *, struct iattr *,
535 int (*statfs) (struct nfs_server *, struct nfs_fh *,
536 struct nfs_fsstat *);
537 int (*fsinfo) (struct nfs_server *, struct nfs_fh *,
538 struct nfs_fsinfo *);
539 int (*pathconf) (struct nfs_server *, struct nfs_fh *,
540 struct nfs_pathconf *);
541 u32 * (*decode_dirent)(u32 *, struct nfs_entry *, int plus);
542 void (*read_setup) (struct nfs_read_data *);
543 int (*read_done) (struct rpc_task *, struct nfs_read_data *);
544 void (*write_setup) (struct nfs_write_data *, int how);
545 int (*write_done) (struct rpc_task *, struct nfs_write_data *);
546 void (*commit_setup) (struct nfs_write_data *, int how);
547 int (*commit_done) (struct rpc_task *, struct nfs_write_data *);
548 int (*file_open) (struct inode *, struct file *);
549 int (*file_release) (struct inode *, struct file *);
550 int (*lock)(struct file *, int, struct file_lock *);
551 void (*clear_acl_cache)(struct inode *);
554 #define NFS_CALL(op, inode, args) NFS_PROTO(inode)->op args