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