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; |
| 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 { |
| 168 | __u64 clientid; |
| 169 | u32 id; |
| 170 | }; |
| 171 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 172 | struct nfs_lock_opargs { |
Trond Myklebust | 06735b3 | 2005-10-18 14:20:15 -0700 | [diff] [blame] | 173 | struct nfs_seqid * lock_seqid; |
| 174 | nfs4_stateid * lock_stateid; |
| 175 | struct nfs_seqid * open_seqid; |
| 176 | nfs4_stateid * open_stateid; |
| 177 | struct nfs_lowner lock_owner; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 178 | __u32 reclaim; |
| 179 | __u32 new_lock_owner; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 180 | }; |
| 181 | |
| 182 | struct nfs_locku_opargs { |
Trond Myklebust | cee54fc | 2005-10-18 14:20:12 -0700 | [diff] [blame] | 183 | struct nfs_seqid * seqid; |
Trond Myklebust | faf5f49 | 2005-10-18 14:20:15 -0700 | [diff] [blame] | 184 | nfs4_stateid * stateid; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 185 | }; |
| 186 | |
| 187 | struct nfs_lockargs { |
| 188 | struct nfs_fh * fh; |
| 189 | __u32 type; |
| 190 | __u64 offset; |
| 191 | __u64 length; |
| 192 | union { |
| 193 | struct nfs_lock_opargs *lock; /* LOCK */ |
| 194 | struct nfs_lowner *lockt; /* LOCKT */ |
| 195 | struct nfs_locku_opargs *locku; /* LOCKU */ |
| 196 | } u; |
| 197 | }; |
| 198 | |
| 199 | struct nfs_lock_denied { |
| 200 | __u64 offset; |
| 201 | __u64 length; |
| 202 | __u32 type; |
| 203 | struct nfs_lowner owner; |
| 204 | }; |
| 205 | |
| 206 | struct nfs_lockres { |
| 207 | union { |
| 208 | nfs4_stateid stateid;/* LOCK success, LOCKU */ |
| 209 | struct nfs_lock_denied denied; /* LOCK failed, LOCKT success */ |
| 210 | } u; |
| 211 | const struct nfs_server * server; |
| 212 | }; |
| 213 | |
| 214 | struct nfs4_delegreturnargs { |
| 215 | const struct nfs_fh *fhandle; |
| 216 | const nfs4_stateid *stateid; |
| 217 | }; |
| 218 | |
| 219 | /* |
| 220 | * Arguments to the read call. |
| 221 | */ |
| 222 | |
| 223 | #define NFS_READ_MAXIOV (9U) |
| 224 | #if (NFS_READ_MAXIOV > (MAX_IOVEC -2)) |
| 225 | #error "NFS_READ_MAXIOV is too large" |
| 226 | #endif |
| 227 | |
| 228 | struct nfs_readargs { |
| 229 | struct nfs_fh * fh; |
| 230 | struct nfs_open_context *context; |
| 231 | __u64 offset; |
| 232 | __u32 count; |
| 233 | unsigned int pgbase; |
| 234 | struct page ** pages; |
| 235 | }; |
| 236 | |
| 237 | struct nfs_readres { |
| 238 | struct nfs_fattr * fattr; |
| 239 | __u32 count; |
| 240 | int eof; |
| 241 | }; |
| 242 | |
| 243 | /* |
| 244 | * Arguments to the write call. |
| 245 | */ |
| 246 | #define NFS_WRITE_MAXIOV (9U) |
| 247 | #if (NFS_WRITE_MAXIOV > (MAX_IOVEC -2)) |
| 248 | #error "NFS_WRITE_MAXIOV is too large" |
| 249 | #endif |
| 250 | |
| 251 | struct nfs_writeargs { |
| 252 | struct nfs_fh * fh; |
| 253 | struct nfs_open_context *context; |
| 254 | __u64 offset; |
| 255 | __u32 count; |
| 256 | enum nfs3_stable_how stable; |
| 257 | unsigned int pgbase; |
| 258 | struct page ** pages; |
| 259 | }; |
| 260 | |
| 261 | struct nfs_writeverf { |
| 262 | enum nfs3_stable_how committed; |
| 263 | __u32 verifier[2]; |
| 264 | }; |
| 265 | |
| 266 | struct nfs_writeres { |
| 267 | struct nfs_fattr * fattr; |
| 268 | struct nfs_writeverf * verf; |
| 269 | __u32 count; |
| 270 | }; |
| 271 | |
| 272 | /* |
| 273 | * Argument struct for decode_entry function |
| 274 | */ |
| 275 | struct nfs_entry { |
| 276 | __u64 ino; |
| 277 | __u64 cookie, |
| 278 | prev_cookie; |
| 279 | const char * name; |
| 280 | unsigned int len; |
| 281 | int eof; |
| 282 | struct nfs_fh * fh; |
| 283 | struct nfs_fattr * fattr; |
| 284 | }; |
| 285 | |
| 286 | /* |
| 287 | * The following types are for NFSv2 only. |
| 288 | */ |
| 289 | struct nfs_sattrargs { |
| 290 | struct nfs_fh * fh; |
| 291 | struct iattr * sattr; |
| 292 | }; |
| 293 | |
| 294 | struct nfs_diropargs { |
| 295 | struct nfs_fh * fh; |
| 296 | const char * name; |
| 297 | unsigned int len; |
| 298 | }; |
| 299 | |
| 300 | struct nfs_createargs { |
| 301 | struct nfs_fh * fh; |
| 302 | const char * name; |
| 303 | unsigned int len; |
| 304 | struct iattr * sattr; |
| 305 | }; |
| 306 | |
| 307 | struct nfs_renameargs { |
| 308 | struct nfs_fh * fromfh; |
| 309 | const char * fromname; |
| 310 | unsigned int fromlen; |
| 311 | struct nfs_fh * tofh; |
| 312 | const char * toname; |
| 313 | unsigned int tolen; |
| 314 | }; |
| 315 | |
| 316 | struct nfs_setattrargs { |
| 317 | struct nfs_fh * fh; |
| 318 | nfs4_stateid stateid; |
| 319 | struct iattr * iap; |
| 320 | const struct nfs_server * server; /* Needed for name mapping */ |
| 321 | const u32 * bitmask; |
| 322 | }; |
| 323 | |
J. Bruce Fields | 23ec696 | 2005-06-22 17:16:22 +0000 | [diff] [blame] | 324 | struct nfs_setaclargs { |
| 325 | struct nfs_fh * fh; |
| 326 | size_t acl_len; |
| 327 | unsigned int acl_pgbase; |
| 328 | struct page ** acl_pages; |
| 329 | }; |
| 330 | |
J. Bruce Fields | 029d105 | 2005-06-22 17:16:22 +0000 | [diff] [blame] | 331 | struct nfs_getaclargs { |
| 332 | struct nfs_fh * fh; |
| 333 | size_t acl_len; |
| 334 | unsigned int acl_pgbase; |
| 335 | struct page ** acl_pages; |
| 336 | }; |
| 337 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 338 | struct nfs_setattrres { |
| 339 | struct nfs_fattr * fattr; |
| 340 | const struct nfs_server * server; |
| 341 | }; |
| 342 | |
| 343 | struct nfs_linkargs { |
| 344 | struct nfs_fh * fromfh; |
| 345 | struct nfs_fh * tofh; |
| 346 | const char * toname; |
| 347 | unsigned int tolen; |
| 348 | }; |
| 349 | |
| 350 | struct nfs_symlinkargs { |
| 351 | struct nfs_fh * fromfh; |
| 352 | const char * fromname; |
| 353 | unsigned int fromlen; |
| 354 | const char * topath; |
| 355 | unsigned int tolen; |
| 356 | struct iattr * sattr; |
| 357 | }; |
| 358 | |
| 359 | struct nfs_readdirargs { |
| 360 | struct nfs_fh * fh; |
| 361 | __u32 cookie; |
| 362 | unsigned int count; |
| 363 | struct page ** pages; |
| 364 | }; |
| 365 | |
Andreas Gruenbacher | b7fa055 | 2005-06-22 17:16:27 +0000 | [diff] [blame] | 366 | struct nfs3_getaclargs { |
| 367 | struct nfs_fh * fh; |
| 368 | int mask; |
| 369 | struct page ** pages; |
| 370 | }; |
| 371 | |
| 372 | struct nfs3_setaclargs { |
| 373 | struct inode * inode; |
| 374 | int mask; |
| 375 | struct posix_acl * acl_access; |
| 376 | struct posix_acl * acl_default; |
| 377 | struct page ** pages; |
| 378 | }; |
| 379 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 380 | struct nfs_diropok { |
| 381 | struct nfs_fh * fh; |
| 382 | struct nfs_fattr * fattr; |
| 383 | }; |
| 384 | |
| 385 | struct nfs_readlinkargs { |
| 386 | struct nfs_fh * fh; |
| 387 | unsigned int pgbase; |
| 388 | unsigned int pglen; |
| 389 | struct page ** pages; |
| 390 | }; |
| 391 | |
| 392 | struct nfs3_sattrargs { |
| 393 | struct nfs_fh * fh; |
| 394 | struct iattr * sattr; |
| 395 | unsigned int guard; |
| 396 | struct timespec guardtime; |
| 397 | }; |
| 398 | |
| 399 | struct nfs3_diropargs { |
| 400 | struct nfs_fh * fh; |
| 401 | const char * name; |
| 402 | unsigned int len; |
| 403 | }; |
| 404 | |
| 405 | struct nfs3_accessargs { |
| 406 | struct nfs_fh * fh; |
| 407 | __u32 access; |
| 408 | }; |
| 409 | |
| 410 | struct nfs3_createargs { |
| 411 | struct nfs_fh * fh; |
| 412 | const char * name; |
| 413 | unsigned int len; |
| 414 | struct iattr * sattr; |
| 415 | enum nfs3_createmode createmode; |
| 416 | __u32 verifier[2]; |
| 417 | }; |
| 418 | |
| 419 | struct nfs3_mkdirargs { |
| 420 | struct nfs_fh * fh; |
| 421 | const char * name; |
| 422 | unsigned int len; |
| 423 | struct iattr * sattr; |
| 424 | }; |
| 425 | |
| 426 | struct nfs3_symlinkargs { |
| 427 | struct nfs_fh * fromfh; |
| 428 | const char * fromname; |
| 429 | unsigned int fromlen; |
| 430 | const char * topath; |
| 431 | unsigned int tolen; |
| 432 | struct iattr * sattr; |
| 433 | }; |
| 434 | |
| 435 | struct nfs3_mknodargs { |
| 436 | struct nfs_fh * fh; |
| 437 | const char * name; |
| 438 | unsigned int len; |
| 439 | enum nfs3_ftype type; |
| 440 | struct iattr * sattr; |
| 441 | dev_t rdev; |
| 442 | }; |
| 443 | |
| 444 | struct nfs3_renameargs { |
| 445 | struct nfs_fh * fromfh; |
| 446 | const char * fromname; |
| 447 | unsigned int fromlen; |
| 448 | struct nfs_fh * tofh; |
| 449 | const char * toname; |
| 450 | unsigned int tolen; |
| 451 | }; |
| 452 | |
| 453 | struct nfs3_linkargs { |
| 454 | struct nfs_fh * fromfh; |
| 455 | struct nfs_fh * tofh; |
| 456 | const char * toname; |
| 457 | unsigned int tolen; |
| 458 | }; |
| 459 | |
| 460 | struct nfs3_readdirargs { |
| 461 | struct nfs_fh * fh; |
| 462 | __u64 cookie; |
| 463 | __u32 verf[2]; |
| 464 | int plus; |
| 465 | unsigned int count; |
| 466 | struct page ** pages; |
| 467 | }; |
| 468 | |
| 469 | struct nfs3_diropres { |
| 470 | struct nfs_fattr * dir_attr; |
| 471 | struct nfs_fh * fh; |
| 472 | struct nfs_fattr * fattr; |
| 473 | }; |
| 474 | |
| 475 | struct nfs3_accessres { |
| 476 | struct nfs_fattr * fattr; |
| 477 | __u32 access; |
| 478 | }; |
| 479 | |
| 480 | struct nfs3_readlinkargs { |
| 481 | struct nfs_fh * fh; |
| 482 | unsigned int pgbase; |
| 483 | unsigned int pglen; |
| 484 | struct page ** pages; |
| 485 | }; |
| 486 | |
| 487 | struct nfs3_renameres { |
| 488 | struct nfs_fattr * fromattr; |
| 489 | struct nfs_fattr * toattr; |
| 490 | }; |
| 491 | |
| 492 | struct nfs3_linkres { |
| 493 | struct nfs_fattr * dir_attr; |
| 494 | struct nfs_fattr * fattr; |
| 495 | }; |
| 496 | |
| 497 | struct nfs3_readdirres { |
| 498 | struct nfs_fattr * dir_attr; |
| 499 | __u32 * verf; |
| 500 | int plus; |
| 501 | }; |
| 502 | |
Andreas Gruenbacher | b7fa055 | 2005-06-22 17:16:27 +0000 | [diff] [blame] | 503 | struct nfs3_getaclres { |
| 504 | struct nfs_fattr * fattr; |
| 505 | int mask; |
| 506 | unsigned int acl_access_count; |
| 507 | unsigned int acl_default_count; |
| 508 | struct posix_acl * acl_access; |
| 509 | struct posix_acl * acl_default; |
| 510 | }; |
| 511 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 512 | #ifdef CONFIG_NFS_V4 |
| 513 | |
| 514 | typedef u64 clientid4; |
| 515 | |
| 516 | struct nfs4_accessargs { |
| 517 | const struct nfs_fh * fh; |
| 518 | u32 access; |
| 519 | }; |
| 520 | |
| 521 | struct nfs4_accessres { |
| 522 | u32 supported; |
| 523 | u32 access; |
| 524 | }; |
| 525 | |
| 526 | struct nfs4_create_arg { |
| 527 | u32 ftype; |
| 528 | union { |
| 529 | struct qstr * symlink; /* NF4LNK */ |
| 530 | struct { |
| 531 | u32 specdata1; |
| 532 | u32 specdata2; |
| 533 | } device; /* NF4BLK, NF4CHR */ |
| 534 | } u; |
| 535 | const struct qstr * name; |
| 536 | const struct nfs_server * server; |
| 537 | const struct iattr * attrs; |
| 538 | const struct nfs_fh * dir_fh; |
| 539 | const u32 * bitmask; |
| 540 | }; |
| 541 | |
| 542 | struct nfs4_create_res { |
| 543 | const struct nfs_server * server; |
| 544 | struct nfs_fh * fh; |
| 545 | struct nfs_fattr * fattr; |
| 546 | struct nfs4_change_info dir_cinfo; |
Trond Myklebust | 56ae19f | 2005-10-27 22:12:40 -0400 | [diff] [blame] | 547 | struct nfs_fattr * dir_fattr; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 548 | }; |
| 549 | |
| 550 | struct nfs4_fsinfo_arg { |
| 551 | const struct nfs_fh * fh; |
| 552 | const u32 * bitmask; |
| 553 | }; |
| 554 | |
| 555 | struct nfs4_getattr_arg { |
| 556 | const struct nfs_fh * fh; |
| 557 | const u32 * bitmask; |
| 558 | }; |
| 559 | |
| 560 | struct nfs4_getattr_res { |
| 561 | const struct nfs_server * server; |
| 562 | struct nfs_fattr * fattr; |
| 563 | }; |
| 564 | |
| 565 | struct nfs4_link_arg { |
| 566 | const struct nfs_fh * fh; |
| 567 | const struct nfs_fh * dir_fh; |
| 568 | const struct qstr * name; |
Trond Myklebust | 91ba2ee | 2005-10-27 22:12:42 -0400 | [diff] [blame^] | 569 | const u32 * bitmask; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 570 | }; |
| 571 | |
Trond Myklebust | 91ba2ee | 2005-10-27 22:12:42 -0400 | [diff] [blame^] | 572 | struct nfs4_link_res { |
| 573 | const struct nfs_server * server; |
| 574 | struct nfs_fattr * fattr; |
| 575 | struct nfs4_change_info cinfo; |
| 576 | struct nfs_fattr * dir_attr; |
| 577 | }; |
| 578 | |
| 579 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 580 | struct nfs4_lookup_arg { |
| 581 | const struct nfs_fh * dir_fh; |
| 582 | const struct qstr * name; |
| 583 | const u32 * bitmask; |
| 584 | }; |
| 585 | |
| 586 | struct nfs4_lookup_res { |
| 587 | const struct nfs_server * server; |
| 588 | struct nfs_fattr * fattr; |
| 589 | struct nfs_fh * fh; |
| 590 | }; |
| 591 | |
| 592 | struct nfs4_lookup_root_arg { |
| 593 | const u32 * bitmask; |
| 594 | }; |
| 595 | |
| 596 | struct nfs4_pathconf_arg { |
| 597 | const struct nfs_fh * fh; |
| 598 | const u32 * bitmask; |
| 599 | }; |
| 600 | |
| 601 | struct nfs4_readdir_arg { |
| 602 | const struct nfs_fh * fh; |
| 603 | u64 cookie; |
| 604 | nfs4_verifier verifier; |
| 605 | u32 count; |
| 606 | struct page ** pages; /* zero-copy data */ |
| 607 | unsigned int pgbase; /* zero-copy data */ |
| 608 | const u32 * bitmask; |
| 609 | }; |
| 610 | |
| 611 | struct nfs4_readdir_res { |
| 612 | nfs4_verifier verifier; |
| 613 | unsigned int pgbase; |
| 614 | }; |
| 615 | |
| 616 | struct nfs4_readlink { |
| 617 | const struct nfs_fh * fh; |
| 618 | unsigned int pgbase; |
| 619 | unsigned int pglen; /* zero-copy data */ |
| 620 | struct page ** pages; /* zero-copy data */ |
| 621 | }; |
| 622 | |
| 623 | struct nfs4_remove_arg { |
| 624 | const struct nfs_fh * fh; |
| 625 | const struct qstr * name; |
| 626 | }; |
| 627 | |
| 628 | struct nfs4_rename_arg { |
| 629 | const struct nfs_fh * old_dir; |
| 630 | const struct nfs_fh * new_dir; |
| 631 | const struct qstr * old_name; |
| 632 | const struct qstr * new_name; |
| 633 | }; |
| 634 | |
| 635 | struct nfs4_rename_res { |
| 636 | struct nfs4_change_info old_cinfo; |
| 637 | struct nfs4_change_info new_cinfo; |
| 638 | }; |
| 639 | |
| 640 | struct nfs4_setclientid { |
| 641 | const nfs4_verifier * sc_verifier; /* request */ |
| 642 | unsigned int sc_name_len; |
| 643 | char sc_name[32]; /* request */ |
| 644 | u32 sc_prog; /* request */ |
| 645 | unsigned int sc_netid_len; |
| 646 | char sc_netid[4]; /* request */ |
| 647 | unsigned int sc_uaddr_len; |
| 648 | char sc_uaddr[24]; /* request */ |
| 649 | u32 sc_cb_ident; /* request */ |
| 650 | }; |
| 651 | |
| 652 | struct nfs4_statfs_arg { |
| 653 | const struct nfs_fh * fh; |
| 654 | const u32 * bitmask; |
| 655 | }; |
| 656 | |
| 657 | struct nfs4_server_caps_res { |
| 658 | u32 attr_bitmask[2]; |
| 659 | u32 acl_bitmask; |
| 660 | u32 has_links; |
| 661 | u32 has_symlinks; |
| 662 | }; |
| 663 | |
| 664 | #endif /* CONFIG_NFS_V4 */ |
| 665 | |
| 666 | struct nfs_page; |
| 667 | |
| 668 | struct nfs_read_data { |
| 669 | int flags; |
| 670 | struct rpc_task task; |
| 671 | struct inode *inode; |
| 672 | struct rpc_cred *cred; |
| 673 | struct nfs_fattr fattr; /* fattr storage */ |
| 674 | struct list_head pages; /* Coalesced read requests */ |
| 675 | struct nfs_page *req; /* multi ops per nfs_page */ |
| 676 | struct page *pagevec[NFS_READ_MAXIOV]; |
| 677 | struct nfs_readargs args; |
| 678 | struct nfs_readres res; |
| 679 | #ifdef CONFIG_NFS_V4 |
| 680 | unsigned long timestamp; /* For lease renewal */ |
| 681 | #endif |
| 682 | void (*complete) (struct nfs_read_data *, int); |
| 683 | }; |
| 684 | |
| 685 | struct nfs_write_data { |
| 686 | int flags; |
| 687 | struct rpc_task task; |
| 688 | struct inode *inode; |
| 689 | struct rpc_cred *cred; |
| 690 | struct nfs_fattr fattr; |
| 691 | struct nfs_writeverf verf; |
| 692 | struct list_head pages; /* Coalesced requests we wish to flush */ |
| 693 | struct nfs_page *req; /* multi ops per nfs_page */ |
| 694 | struct page *pagevec[NFS_WRITE_MAXIOV]; |
| 695 | struct nfs_writeargs args; /* argument struct */ |
| 696 | struct nfs_writeres res; /* result struct */ |
| 697 | #ifdef CONFIG_NFS_V4 |
| 698 | unsigned long timestamp; /* For lease renewal */ |
| 699 | #endif |
| 700 | void (*complete) (struct nfs_write_data *, int); |
| 701 | }; |
| 702 | |
| 703 | struct nfs_access_entry; |
| 704 | |
| 705 | /* |
| 706 | * RPC procedure vector for NFSv2/NFSv3 demuxing |
| 707 | */ |
| 708 | struct nfs_rpc_ops { |
| 709 | int version; /* Protocol version */ |
| 710 | struct dentry_operations *dentry_ops; |
| 711 | struct inode_operations *dir_inode_ops; |
J. Bruce Fields | 92cfc62 | 2005-06-22 17:16:22 +0000 | [diff] [blame] | 712 | struct inode_operations *file_inode_ops; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 713 | |
| 714 | int (*getroot) (struct nfs_server *, struct nfs_fh *, |
| 715 | struct nfs_fsinfo *); |
| 716 | int (*getattr) (struct nfs_server *, struct nfs_fh *, |
| 717 | struct nfs_fattr *); |
| 718 | int (*setattr) (struct dentry *, struct nfs_fattr *, |
| 719 | struct iattr *); |
| 720 | int (*lookup) (struct inode *, struct qstr *, |
| 721 | struct nfs_fh *, struct nfs_fattr *); |
| 722 | int (*access) (struct inode *, struct nfs_access_entry *); |
| 723 | int (*readlink)(struct inode *, struct page *, unsigned int, |
| 724 | unsigned int); |
| 725 | int (*read) (struct nfs_read_data *); |
| 726 | int (*write) (struct nfs_write_data *); |
| 727 | int (*commit) (struct nfs_write_data *); |
| 728 | int (*create) (struct inode *, struct dentry *, |
Trond Myklebust | 02a913a | 2005-10-18 14:20:17 -0700 | [diff] [blame] | 729 | struct iattr *, int, struct nameidata *); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 730 | int (*remove) (struct inode *, struct qstr *); |
| 731 | int (*unlink_setup) (struct rpc_message *, |
| 732 | struct dentry *, struct qstr *); |
| 733 | int (*unlink_done) (struct dentry *, struct rpc_task *); |
| 734 | int (*rename) (struct inode *, struct qstr *, |
| 735 | struct inode *, struct qstr *); |
| 736 | int (*link) (struct inode *, struct inode *, struct qstr *); |
| 737 | int (*symlink) (struct inode *, struct qstr *, struct qstr *, |
| 738 | struct iattr *, struct nfs_fh *, |
| 739 | struct nfs_fattr *); |
| 740 | int (*mkdir) (struct inode *, struct dentry *, struct iattr *); |
| 741 | int (*rmdir) (struct inode *, struct qstr *); |
| 742 | int (*readdir) (struct dentry *, struct rpc_cred *, |
| 743 | u64, struct page *, unsigned int, int); |
| 744 | int (*mknod) (struct inode *, struct dentry *, struct iattr *, |
| 745 | dev_t); |
| 746 | int (*statfs) (struct nfs_server *, struct nfs_fh *, |
| 747 | struct nfs_fsstat *); |
| 748 | int (*fsinfo) (struct nfs_server *, struct nfs_fh *, |
| 749 | struct nfs_fsinfo *); |
| 750 | int (*pathconf) (struct nfs_server *, struct nfs_fh *, |
| 751 | struct nfs_pathconf *); |
| 752 | u32 * (*decode_dirent)(u32 *, struct nfs_entry *, int plus); |
| 753 | void (*read_setup) (struct nfs_read_data *); |
| 754 | void (*write_setup) (struct nfs_write_data *, int how); |
| 755 | void (*commit_setup) (struct nfs_write_data *, int how); |
| 756 | int (*file_open) (struct inode *, struct file *); |
| 757 | int (*file_release) (struct inode *, struct file *); |
| 758 | int (*lock)(struct file *, int, struct file_lock *); |
Trond Myklebust | ada70d9 | 2005-06-22 17:16:22 +0000 | [diff] [blame] | 759 | void (*clear_acl_cache)(struct inode *); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 760 | }; |
| 761 | |
| 762 | /* |
| 763 | * NFS_CALL(getattr, inode, (fattr)); |
| 764 | * into |
| 765 | * NFS_PROTO(inode)->getattr(fattr); |
| 766 | */ |
| 767 | #define NFS_CALL(op, inode, args) NFS_PROTO(inode)->op args |
| 768 | |
| 769 | /* |
| 770 | * Function vectors etc. for the NFS client |
| 771 | */ |
| 772 | extern struct nfs_rpc_ops nfs_v2_clientops; |
| 773 | extern struct nfs_rpc_ops nfs_v3_clientops; |
| 774 | extern struct nfs_rpc_ops nfs_v4_clientops; |
| 775 | extern struct rpc_version nfs_version2; |
| 776 | extern struct rpc_version nfs_version3; |
| 777 | extern struct rpc_version nfs_version4; |
| 778 | |
Andreas Gruenbacher | b7fa055 | 2005-06-22 17:16:27 +0000 | [diff] [blame] | 779 | extern struct rpc_version nfsacl_version3; |
| 780 | extern struct rpc_program nfsacl_program; |
| 781 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 782 | #endif |