diff options
Diffstat (limited to 'include/linux/nfs_xdr.h')
-rw-r--r-- | include/linux/nfs_xdr.h | 94 |
1 files changed, 70 insertions, 24 deletions
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index 7fafc4c546b..dc5397d9d23 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef _LINUX_NFS_XDR_H | 1 | #ifndef _LINUX_NFS_XDR_H |
2 | #define _LINUX_NFS_XDR_H | 2 | #define _LINUX_NFS_XDR_H |
3 | 3 | ||
4 | #include <linux/sunrpc/xprt.h> | ||
5 | #include <linux/nfsacl.h> | 4 | #include <linux/nfsacl.h> |
6 | 5 | ||
7 | /* | 6 | /* |
@@ -14,11 +13,19 @@ | |||
14 | #define NFS_DEF_FILE_IO_SIZE (4096U) | 13 | #define NFS_DEF_FILE_IO_SIZE (4096U) |
15 | #define NFS_MIN_FILE_IO_SIZE (1024U) | 14 | #define NFS_MIN_FILE_IO_SIZE (1024U) |
16 | 15 | ||
17 | struct nfs4_fsid { | 16 | struct nfs_fsid { |
18 | __u64 major; | 17 | uint64_t major; |
19 | __u64 minor; | 18 | uint64_t minor; |
20 | }; | 19 | }; |
21 | 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 | |||
22 | struct nfs_fattr { | 29 | struct nfs_fattr { |
23 | unsigned short valid; /* which fields are valid */ | 30 | unsigned short valid; /* which fields are valid */ |
24 | __u64 pre_size; /* pre_op_attr.size */ | 31 | __u64 pre_size; /* pre_op_attr.size */ |
@@ -40,10 +47,7 @@ struct nfs_fattr { | |||
40 | } nfs3; | 47 | } nfs3; |
41 | } du; | 48 | } du; |
42 | dev_t rdev; | 49 | dev_t rdev; |
43 | union { | 50 | struct nfs_fsid fsid; |
44 | __u64 nfs3; /* also nfs2 */ | ||
45 | struct nfs4_fsid nfs4; | ||
46 | } fsid_u; | ||
47 | __u64 fileid; | 51 | __u64 fileid; |
48 | struct timespec atime; | 52 | struct timespec atime; |
49 | struct timespec mtime; | 53 | struct timespec mtime; |
@@ -57,8 +61,8 @@ struct nfs_fattr { | |||
57 | #define NFS_ATTR_WCC 0x0001 /* pre-op WCC data */ | 61 | #define NFS_ATTR_WCC 0x0001 /* pre-op WCC data */ |
58 | #define NFS_ATTR_FATTR 0x0002 /* post-op attributes */ | 62 | #define NFS_ATTR_FATTR 0x0002 /* post-op attributes */ |
59 | #define NFS_ATTR_FATTR_V3 0x0004 /* NFSv3 attributes */ | 63 | #define NFS_ATTR_FATTR_V3 0x0004 /* NFSv3 attributes */ |
60 | #define NFS_ATTR_FATTR_V4 0x0008 | 64 | #define NFS_ATTR_FATTR_V4 0x0008 /* NFSv4 change attribute */ |
61 | #define NFS_ATTR_PRE_CHANGE 0x0010 | 65 | #define NFS_ATTR_FATTR_V4_REFERRAL 0x0010 /* NFSv4 referral */ |
62 | 66 | ||
63 | /* | 67 | /* |
64 | * Info on the file system | 68 | * Info on the file system |
@@ -354,8 +358,8 @@ struct nfs_symlinkargs { | |||
354 | struct nfs_fh * fromfh; | 358 | struct nfs_fh * fromfh; |
355 | const char * fromname; | 359 | const char * fromname; |
356 | unsigned int fromlen; | 360 | unsigned int fromlen; |
357 | const char * topath; | 361 | struct page ** pages; |
358 | unsigned int tolen; | 362 | unsigned int pathlen; |
359 | struct iattr * sattr; | 363 | struct iattr * sattr; |
360 | }; | 364 | }; |
361 | 365 | ||
@@ -430,8 +434,8 @@ struct nfs3_symlinkargs { | |||
430 | struct nfs_fh * fromfh; | 434 | struct nfs_fh * fromfh; |
431 | const char * fromname; | 435 | const char * fromname; |
432 | unsigned int fromlen; | 436 | unsigned int fromlen; |
433 | const char * topath; | 437 | struct page ** pages; |
434 | unsigned int tolen; | 438 | unsigned int pathlen; |
435 | struct iattr * sattr; | 439 | struct iattr * sattr; |
436 | }; | 440 | }; |
437 | 441 | ||
@@ -529,7 +533,10 @@ struct nfs4_accessres { | |||
529 | struct nfs4_create_arg { | 533 | struct nfs4_create_arg { |
530 | u32 ftype; | 534 | u32 ftype; |
531 | union { | 535 | union { |
532 | struct qstr * symlink; /* NF4LNK */ | 536 | struct { |
537 | struct page ** pages; | ||
538 | unsigned int len; | ||
539 | } symlink; /* NF4LNK */ | ||
533 | struct { | 540 | struct { |
534 | u32 specdata1; | 541 | u32 specdata1; |
535 | u32 specdata2; | 542 | u32 specdata2; |
@@ -654,7 +661,7 @@ struct nfs4_rename_res { | |||
654 | struct nfs4_setclientid { | 661 | struct nfs4_setclientid { |
655 | const nfs4_verifier * sc_verifier; /* request */ | 662 | const nfs4_verifier * sc_verifier; /* request */ |
656 | unsigned int sc_name_len; | 663 | unsigned int sc_name_len; |
657 | char sc_name[32]; /* request */ | 664 | char sc_name[48]; /* request */ |
658 | u32 sc_prog; /* request */ | 665 | u32 sc_prog; /* request */ |
659 | unsigned int sc_netid_len; | 666 | unsigned int sc_netid_len; |
660 | char sc_netid[4]; /* request */ | 667 | char sc_netid[4]; /* request */ |
@@ -675,6 +682,40 @@ struct nfs4_server_caps_res { | |||
675 | u32 has_symlinks; | 682 | u32 has_symlinks; |
676 | }; | 683 | }; |
677 | 684 | ||
685 | struct nfs4_string { | ||
686 | unsigned int len; | ||
687 | char *data; | ||
688 | }; | ||
689 | |||
690 | #define NFS4_PATHNAME_MAXCOMPONENTS 512 | ||
691 | struct nfs4_pathname { | ||
692 | unsigned int ncomponents; | ||
693 | struct nfs4_string components[NFS4_PATHNAME_MAXCOMPONENTS]; | ||
694 | }; | ||
695 | |||
696 | #define NFS4_FS_LOCATION_MAXSERVERS 10 | ||
697 | struct nfs4_fs_location { | ||
698 | unsigned int nservers; | ||
699 | struct nfs4_string servers[NFS4_FS_LOCATION_MAXSERVERS]; | ||
700 | struct nfs4_pathname rootpath; | ||
701 | }; | ||
702 | |||
703 | #define NFS4_FS_LOCATIONS_MAXENTRIES 10 | ||
704 | struct nfs4_fs_locations { | ||
705 | struct nfs_fattr fattr; | ||
706 | const struct nfs_server *server; | ||
707 | struct nfs4_pathname fs_path; | ||
708 | int nlocations; | ||
709 | struct nfs4_fs_location locations[NFS4_FS_LOCATIONS_MAXENTRIES]; | ||
710 | }; | ||
711 | |||
712 | struct nfs4_fs_locations_arg { | ||
713 | const struct nfs_fh *dir_fh; | ||
714 | const struct qstr *name; | ||
715 | struct page *page; | ||
716 | const u32 *bitmask; | ||
717 | }; | ||
718 | |||
678 | #endif /* CONFIG_NFS_V4 */ | 719 | #endif /* CONFIG_NFS_V4 */ |
679 | 720 | ||
680 | struct nfs_page; | 721 | struct nfs_page; |
@@ -690,12 +731,13 @@ struct nfs_read_data { | |||
690 | struct list_head pages; /* Coalesced read requests */ | 731 | struct list_head pages; /* Coalesced read requests */ |
691 | struct nfs_page *req; /* multi ops per nfs_page */ | 732 | struct nfs_page *req; /* multi ops per nfs_page */ |
692 | struct page **pagevec; | 733 | struct page **pagevec; |
734 | unsigned int npages; /* Max length of pagevec */ | ||
693 | struct nfs_readargs args; | 735 | struct nfs_readargs args; |
694 | struct nfs_readres res; | 736 | struct nfs_readres res; |
695 | #ifdef CONFIG_NFS_V4 | 737 | #ifdef CONFIG_NFS_V4 |
696 | unsigned long timestamp; /* For lease renewal */ | 738 | unsigned long timestamp; /* For lease renewal */ |
697 | #endif | 739 | #endif |
698 | struct page *page_array[NFS_PAGEVEC_SIZE + 1]; | 740 | struct page *page_array[NFS_PAGEVEC_SIZE]; |
699 | }; | 741 | }; |
700 | 742 | ||
701 | struct nfs_write_data { | 743 | struct nfs_write_data { |
@@ -708,12 +750,13 @@ struct nfs_write_data { | |||
708 | struct list_head pages; /* Coalesced requests we wish to flush */ | 750 | struct list_head pages; /* Coalesced requests we wish to flush */ |
709 | struct nfs_page *req; /* multi ops per nfs_page */ | 751 | struct nfs_page *req; /* multi ops per nfs_page */ |
710 | struct page **pagevec; | 752 | struct page **pagevec; |
753 | unsigned int npages; /* Max length of pagevec */ | ||
711 | struct nfs_writeargs args; /* argument struct */ | 754 | struct nfs_writeargs args; /* argument struct */ |
712 | struct nfs_writeres res; /* result struct */ | 755 | struct nfs_writeres res; /* result struct */ |
713 | #ifdef CONFIG_NFS_V4 | 756 | #ifdef CONFIG_NFS_V4 |
714 | unsigned long timestamp; /* For lease renewal */ | 757 | unsigned long timestamp; /* For lease renewal */ |
715 | #endif | 758 | #endif |
716 | struct page *page_array[NFS_PAGEVEC_SIZE + 1]; | 759 | struct page *page_array[NFS_PAGEVEC_SIZE]; |
717 | }; | 760 | }; |
718 | 761 | ||
719 | struct nfs_access_entry; | 762 | struct nfs_access_entry; |
@@ -729,6 +772,9 @@ struct nfs_rpc_ops { | |||
729 | 772 | ||
730 | int (*getroot) (struct nfs_server *, struct nfs_fh *, | 773 | int (*getroot) (struct nfs_server *, struct nfs_fh *, |
731 | struct nfs_fsinfo *); | 774 | struct nfs_fsinfo *); |
775 | int (*lookupfh)(struct nfs_server *, struct nfs_fh *, | ||
776 | struct qstr *, struct nfs_fh *, | ||
777 | struct nfs_fattr *); | ||
732 | int (*getattr) (struct nfs_server *, struct nfs_fh *, | 778 | int (*getattr) (struct nfs_server *, struct nfs_fh *, |
733 | struct nfs_fattr *); | 779 | struct nfs_fattr *); |
734 | int (*setattr) (struct dentry *, struct nfs_fattr *, | 780 | int (*setattr) (struct dentry *, struct nfs_fattr *, |
@@ -750,9 +796,8 @@ struct nfs_rpc_ops { | |||
750 | int (*rename) (struct inode *, struct qstr *, | 796 | int (*rename) (struct inode *, struct qstr *, |
751 | struct inode *, struct qstr *); | 797 | struct inode *, struct qstr *); |
752 | int (*link) (struct inode *, struct inode *, struct qstr *); | 798 | int (*link) (struct inode *, struct inode *, struct qstr *); |
753 | int (*symlink) (struct inode *, struct qstr *, struct qstr *, | 799 | int (*symlink) (struct inode *, struct dentry *, struct page *, |
754 | struct iattr *, struct nfs_fh *, | 800 | unsigned int, struct iattr *); |
755 | struct nfs_fattr *); | ||
756 | int (*mkdir) (struct inode *, struct dentry *, struct iattr *); | 801 | int (*mkdir) (struct inode *, struct dentry *, struct iattr *); |
757 | int (*rmdir) (struct inode *, struct qstr *); | 802 | int (*rmdir) (struct inode *, struct qstr *); |
758 | int (*readdir) (struct dentry *, struct rpc_cred *, | 803 | int (*readdir) (struct dentry *, struct rpc_cred *, |
@@ -765,6 +810,7 @@ struct nfs_rpc_ops { | |||
765 | struct nfs_fsinfo *); | 810 | struct nfs_fsinfo *); |
766 | int (*pathconf) (struct nfs_server *, struct nfs_fh *, | 811 | int (*pathconf) (struct nfs_server *, struct nfs_fh *, |
767 | struct nfs_pathconf *); | 812 | struct nfs_pathconf *); |
813 | int (*set_capabilities)(struct nfs_server *, struct nfs_fh *); | ||
768 | u32 * (*decode_dirent)(u32 *, struct nfs_entry *, int plus); | 814 | u32 * (*decode_dirent)(u32 *, struct nfs_entry *, int plus); |
769 | void (*read_setup) (struct nfs_read_data *); | 815 | void (*read_setup) (struct nfs_read_data *); |
770 | int (*read_done) (struct rpc_task *, struct nfs_read_data *); | 816 | int (*read_done) (struct rpc_task *, struct nfs_read_data *); |
@@ -788,9 +834,9 @@ struct nfs_rpc_ops { | |||
788 | /* | 834 | /* |
789 | * Function vectors etc. for the NFS client | 835 | * Function vectors etc. for the NFS client |
790 | */ | 836 | */ |
791 | extern struct nfs_rpc_ops nfs_v2_clientops; | 837 | extern const struct nfs_rpc_ops nfs_v2_clientops; |
792 | extern struct nfs_rpc_ops nfs_v3_clientops; | 838 | extern const struct nfs_rpc_ops nfs_v3_clientops; |
793 | extern struct nfs_rpc_ops nfs_v4_clientops; | 839 | extern const struct nfs_rpc_ops nfs_v4_clientops; |
794 | extern struct rpc_version nfs_version2; | 840 | extern struct rpc_version nfs_version2; |
795 | extern struct rpc_version nfs_version3; | 841 | extern struct rpc_version nfs_version3; |
796 | extern struct rpc_version nfs_version4; | 842 | extern struct rpc_version nfs_version4; |