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