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