aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/nfs_xdr.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/nfs_xdr.h')
-rw-r--r--include/linux/nfs_xdr.h65
1 files changed, 53 insertions, 12 deletions
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 7fafc4c546b..41e5a19199e 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -14,11 +14,19 @@
14#define NFS_DEF_FILE_IO_SIZE (4096U) 14#define NFS_DEF_FILE_IO_SIZE (4096U)
15#define NFS_MIN_FILE_IO_SIZE (1024U) 15#define NFS_MIN_FILE_IO_SIZE (1024U)
16 16
17struct nfs4_fsid { 17struct nfs_fsid {
18 __u64 major; 18 uint64_t major;
19 __u64 minor; 19 uint64_t minor;
20}; 20};
21 21
22/*
23 * Helper for checking equality between 2 fsids.
24 */
25static inline int nfs_fsid_equal(const struct nfs_fsid *a, const struct nfs_fsid *b)
26{
27 return a->major == b->major && a->minor == b->minor;
28}
29
22struct nfs_fattr { 30struct nfs_fattr {
23 unsigned short valid; /* which fields are valid */ 31 unsigned short valid; /* which fields are valid */
24 __u64 pre_size; /* pre_op_attr.size */ 32 __u64 pre_size; /* pre_op_attr.size */
@@ -40,10 +48,7 @@ struct nfs_fattr {
40 } nfs3; 48 } nfs3;
41 } du; 49 } du;
42 dev_t rdev; 50 dev_t rdev;
43 union { 51 struct nfs_fsid fsid;
44 __u64 nfs3; /* also nfs2 */
45 struct nfs4_fsid nfs4;
46 } fsid_u;
47 __u64 fileid; 52 __u64 fileid;
48 struct timespec atime; 53 struct timespec atime;
49 struct timespec mtime; 54 struct timespec mtime;
@@ -57,8 +62,8 @@ struct nfs_fattr {
57#define NFS_ATTR_WCC 0x0001 /* pre-op WCC data */ 62#define NFS_ATTR_WCC 0x0001 /* pre-op WCC data */
58#define NFS_ATTR_FATTR 0x0002 /* post-op attributes */ 63#define NFS_ATTR_FATTR 0x0002 /* post-op attributes */
59#define NFS_ATTR_FATTR_V3 0x0004 /* NFSv3 attributes */ 64#define NFS_ATTR_FATTR_V3 0x0004 /* NFSv3 attributes */
60#define NFS_ATTR_FATTR_V4 0x0008 65#define NFS_ATTR_FATTR_V4 0x0008 /* NFSv4 change attribute */
61#define NFS_ATTR_PRE_CHANGE 0x0010 66#define NFS_ATTR_FATTR_V4_REFERRAL 0x0010 /* NFSv4 referral */
62 67
63/* 68/*
64 * Info on the file system 69 * Info on the file system
@@ -654,7 +659,7 @@ struct nfs4_rename_res {
654struct nfs4_setclientid { 659struct nfs4_setclientid {
655 const nfs4_verifier * sc_verifier; /* request */ 660 const nfs4_verifier * sc_verifier; /* request */
656 unsigned int sc_name_len; 661 unsigned int sc_name_len;
657 char sc_name[32]; /* request */ 662 char sc_name[48]; /* request */
658 u32 sc_prog; /* request */ 663 u32 sc_prog; /* request */
659 unsigned int sc_netid_len; 664 unsigned int sc_netid_len;
660 char sc_netid[4]; /* request */ 665 char sc_netid[4]; /* request */
@@ -675,6 +680,40 @@ struct nfs4_server_caps_res {
675 u32 has_symlinks; 680 u32 has_symlinks;
676}; 681};
677 682
683struct nfs4_string {
684 unsigned int len;
685 char *data;
686};
687
688#define NFS4_PATHNAME_MAXCOMPONENTS 512
689struct nfs4_pathname {
690 unsigned int ncomponents;
691 struct nfs4_string components[NFS4_PATHNAME_MAXCOMPONENTS];
692};
693
694#define NFS4_FS_LOCATION_MAXSERVERS 10
695struct nfs4_fs_location {
696 unsigned int nservers;
697 struct nfs4_string servers[NFS4_FS_LOCATION_MAXSERVERS];
698 struct nfs4_pathname rootpath;
699};
700
701#define NFS4_FS_LOCATIONS_MAXENTRIES 10
702struct nfs4_fs_locations {
703 struct nfs_fattr fattr;
704 const struct nfs_server *server;
705 struct nfs4_pathname fs_path;
706 int nlocations;
707 struct nfs4_fs_location locations[NFS4_FS_LOCATIONS_MAXENTRIES];
708};
709
710struct nfs4_fs_locations_arg {
711 const struct nfs_fh *dir_fh;
712 const struct qstr *name;
713 struct page *page;
714 const u32 *bitmask;
715};
716
678#endif /* CONFIG_NFS_V4 */ 717#endif /* CONFIG_NFS_V4 */
679 718
680struct nfs_page; 719struct nfs_page;
@@ -690,12 +729,13 @@ struct nfs_read_data {
690 struct list_head pages; /* Coalesced read requests */ 729 struct list_head pages; /* Coalesced read requests */
691 struct nfs_page *req; /* multi ops per nfs_page */ 730 struct nfs_page *req; /* multi ops per nfs_page */
692 struct page **pagevec; 731 struct page **pagevec;
732 unsigned int npages; /* Max length of pagevec */
693 struct nfs_readargs args; 733 struct nfs_readargs args;
694 struct nfs_readres res; 734 struct nfs_readres res;
695#ifdef CONFIG_NFS_V4 735#ifdef CONFIG_NFS_V4
696 unsigned long timestamp; /* For lease renewal */ 736 unsigned long timestamp; /* For lease renewal */
697#endif 737#endif
698 struct page *page_array[NFS_PAGEVEC_SIZE + 1]; 738 struct page *page_array[NFS_PAGEVEC_SIZE];
699}; 739};
700 740
701struct nfs_write_data { 741struct nfs_write_data {
@@ -708,12 +748,13 @@ struct nfs_write_data {
708 struct list_head pages; /* Coalesced requests we wish to flush */ 748 struct list_head pages; /* Coalesced requests we wish to flush */
709 struct nfs_page *req; /* multi ops per nfs_page */ 749 struct nfs_page *req; /* multi ops per nfs_page */
710 struct page **pagevec; 750 struct page **pagevec;
751 unsigned int npages; /* Max length of pagevec */
711 struct nfs_writeargs args; /* argument struct */ 752 struct nfs_writeargs args; /* argument struct */
712 struct nfs_writeres res; /* result struct */ 753 struct nfs_writeres res; /* result struct */
713#ifdef CONFIG_NFS_V4 754#ifdef CONFIG_NFS_V4
714 unsigned long timestamp; /* For lease renewal */ 755 unsigned long timestamp; /* For lease renewal */
715#endif 756#endif
716 struct page *page_array[NFS_PAGEVEC_SIZE + 1]; 757 struct page *page_array[NFS_PAGEVEC_SIZE];
717}; 758};
718 759
719struct nfs_access_entry; 760struct nfs_access_entry;