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> |
Boaz Harrosh | d703158 | 2009-12-03 20:28:47 +0200 | [diff] [blame] | 5 | #include <linux/nfs3.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 6 | |
Chuck Lever | 40859d7 | 2005-11-30 18:09:02 -0500 | [diff] [blame] | 7 | /* |
| 8 | * To change the maximum rsize and wsize supported by the NFS client, adjust |
| 9 | * NFS_MAX_FILE_IO_SIZE. 64KB is a typical maximum, but some servers can |
| 10 | * support a megabyte or more. The default is left at 4096 bytes, which is |
| 11 | * reasonable for NFS over UDP. |
| 12 | */ |
| 13 | #define NFS_MAX_FILE_IO_SIZE (1048576U) |
| 14 | #define NFS_DEF_FILE_IO_SIZE (4096U) |
| 15 | #define NFS_MIN_FILE_IO_SIZE (1024U) |
| 16 | |
Trond Myklebust | 8b4bdcf | 2006-06-09 09:34:19 -0400 | [diff] [blame] | 17 | struct nfs_fsid { |
| 18 | uint64_t major; |
| 19 | uint64_t minor; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 20 | }; |
| 21 | |
Trond Myklebust | 8b4bdcf | 2006-06-09 09:34:19 -0400 | [diff] [blame] | 22 | /* |
| 23 | * Helper for checking equality between 2 fsids. |
| 24 | */ |
| 25 | static inline int nfs_fsid_equal(const struct nfs_fsid *a, const struct nfs_fsid *b) |
| 26 | { |
| 27 | return a->major == b->major && a->minor == b->minor; |
| 28 | } |
| 29 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 30 | struct nfs_fattr { |
Trond Myklebust | 9e6e70f | 2009-03-11 14:10:24 -0400 | [diff] [blame] | 31 | unsigned int valid; /* which fields are valid */ |
Trond Myklebust | bca7947 | 2009-03-11 14:10:26 -0400 | [diff] [blame] | 32 | umode_t mode; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 33 | __u32 nlink; |
| 34 | __u32 uid; |
| 35 | __u32 gid; |
Richard Kennedy | 9fa8d66 | 2008-08-26 16:23:20 +0100 | [diff] [blame] | 36 | dev_t rdev; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 37 | __u64 size; |
| 38 | union { |
| 39 | struct { |
| 40 | __u32 blocksize; |
| 41 | __u32 blocks; |
| 42 | } nfs2; |
| 43 | struct { |
| 44 | __u64 used; |
| 45 | } nfs3; |
| 46 | } du; |
Trond Myklebust | 8b4bdcf | 2006-06-09 09:34:19 -0400 | [diff] [blame] | 47 | struct nfs_fsid fsid; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 48 | __u64 fileid; |
| 49 | struct timespec atime; |
| 50 | struct timespec mtime; |
| 51 | struct timespec ctime; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 52 | __u64 change_attr; /* NFSv4 change attribute */ |
| 53 | __u64 pre_change_attr;/* pre-op NFSv4 change attribute */ |
Trond Myklebust | 1ca277d | 2009-03-11 14:10:25 -0400 | [diff] [blame] | 54 | __u64 pre_size; /* pre_op_attr.size */ |
| 55 | struct timespec pre_mtime; /* pre_op_attr.mtime */ |
| 56 | struct timespec pre_ctime; /* pre_op_attr.ctime */ |
Trond Myklebust | 3380114 | 2005-10-27 22:12:39 -0400 | [diff] [blame] | 57 | unsigned long time_start; |
Trond Myklebust | 4704f0e | 2008-10-14 19:16:07 -0400 | [diff] [blame] | 58 | unsigned long gencount; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 59 | }; |
| 60 | |
Trond Myklebust | 9e6e70f | 2009-03-11 14:10:24 -0400 | [diff] [blame] | 61 | #define NFS_ATTR_FATTR_TYPE (1U << 0) |
| 62 | #define NFS_ATTR_FATTR_MODE (1U << 1) |
| 63 | #define NFS_ATTR_FATTR_NLINK (1U << 2) |
| 64 | #define NFS_ATTR_FATTR_OWNER (1U << 3) |
| 65 | #define NFS_ATTR_FATTR_GROUP (1U << 4) |
| 66 | #define NFS_ATTR_FATTR_RDEV (1U << 5) |
| 67 | #define NFS_ATTR_FATTR_SIZE (1U << 6) |
| 68 | #define NFS_ATTR_FATTR_PRESIZE (1U << 7) |
| 69 | #define NFS_ATTR_FATTR_BLOCKS_USED (1U << 8) |
| 70 | #define NFS_ATTR_FATTR_SPACE_USED (1U << 9) |
| 71 | #define NFS_ATTR_FATTR_FSID (1U << 10) |
| 72 | #define NFS_ATTR_FATTR_FILEID (1U << 11) |
| 73 | #define NFS_ATTR_FATTR_ATIME (1U << 12) |
| 74 | #define NFS_ATTR_FATTR_MTIME (1U << 13) |
| 75 | #define NFS_ATTR_FATTR_CTIME (1U << 14) |
| 76 | #define NFS_ATTR_FATTR_PREMTIME (1U << 15) |
| 77 | #define NFS_ATTR_FATTR_PRECTIME (1U << 16) |
| 78 | #define NFS_ATTR_FATTR_CHANGE (1U << 17) |
| 79 | #define NFS_ATTR_FATTR_PRECHANGE (1U << 18) |
| 80 | #define NFS_ATTR_FATTR_V4_REFERRAL (1U << 19) /* NFSv4 referral */ |
| 81 | |
| 82 | #define NFS_ATTR_FATTR (NFS_ATTR_FATTR_TYPE \ |
| 83 | | NFS_ATTR_FATTR_MODE \ |
| 84 | | NFS_ATTR_FATTR_NLINK \ |
| 85 | | NFS_ATTR_FATTR_OWNER \ |
| 86 | | NFS_ATTR_FATTR_GROUP \ |
| 87 | | NFS_ATTR_FATTR_RDEV \ |
| 88 | | NFS_ATTR_FATTR_SIZE \ |
| 89 | | NFS_ATTR_FATTR_FSID \ |
| 90 | | NFS_ATTR_FATTR_FILEID \ |
| 91 | | NFS_ATTR_FATTR_ATIME \ |
| 92 | | NFS_ATTR_FATTR_MTIME \ |
| 93 | | NFS_ATTR_FATTR_CTIME) |
| 94 | #define NFS_ATTR_FATTR_V2 (NFS_ATTR_FATTR \ |
| 95 | | NFS_ATTR_FATTR_BLOCKS_USED) |
| 96 | #define NFS_ATTR_FATTR_V3 (NFS_ATTR_FATTR \ |
| 97 | | NFS_ATTR_FATTR_SPACE_USED) |
| 98 | #define NFS_ATTR_FATTR_V4 (NFS_ATTR_FATTR \ |
| 99 | | NFS_ATTR_FATTR_SPACE_USED \ |
| 100 | | NFS_ATTR_FATTR_CHANGE) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 101 | |
| 102 | /* |
| 103 | * Info on the file system |
| 104 | */ |
| 105 | struct nfs_fsinfo { |
| 106 | struct nfs_fattr *fattr; /* Post-op attributes */ |
| 107 | __u32 rtmax; /* max. read transfer size */ |
| 108 | __u32 rtpref; /* pref. read transfer size */ |
| 109 | __u32 rtmult; /* reads should be multiple of this */ |
| 110 | __u32 wtmax; /* max. write transfer size */ |
| 111 | __u32 wtpref; /* pref. write transfer size */ |
| 112 | __u32 wtmult; /* writes should be multiple of this */ |
| 113 | __u32 dtpref; /* pref. readdir transfer size */ |
| 114 | __u64 maxfilesize; |
Ricardo Labiaga | 6b96724 | 2010-10-12 16:30:05 -0700 | [diff] [blame] | 115 | struct timespec time_delta; /* server time granularity */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 116 | __u32 lease_time; /* in seconds */ |
Andy Adamson | 504913f | 2010-10-20 00:17:57 -0400 | [diff] [blame] | 117 | __u32 layouttype; /* supported pnfs layout driver */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 118 | }; |
| 119 | |
| 120 | struct nfs_fsstat { |
| 121 | struct nfs_fattr *fattr; /* Post-op attributes */ |
| 122 | __u64 tbytes; /* total size in bytes */ |
| 123 | __u64 fbytes; /* # of free bytes */ |
| 124 | __u64 abytes; /* # of bytes available to user */ |
| 125 | __u64 tfiles; /* # of files */ |
| 126 | __u64 ffiles; /* # of free files */ |
| 127 | __u64 afiles; /* # of files available to user */ |
| 128 | }; |
| 129 | |
| 130 | struct nfs2_fsstat { |
| 131 | __u32 tsize; /* Server transfer size */ |
| 132 | __u32 bsize; /* Filesystem block size */ |
| 133 | __u32 blocks; /* No. of "bsize" blocks on filesystem */ |
| 134 | __u32 bfree; /* No. of free "bsize" blocks */ |
| 135 | __u32 bavail; /* No. of available "bsize" blocks */ |
| 136 | }; |
| 137 | |
| 138 | struct nfs_pathconf { |
| 139 | struct nfs_fattr *fattr; /* Post-op attributes */ |
| 140 | __u32 max_link; /* max # of hard links */ |
| 141 | __u32 max_namelen; /* max name length */ |
| 142 | }; |
| 143 | |
| 144 | struct nfs4_change_info { |
| 145 | u32 atomic; |
| 146 | u64 before; |
| 147 | u64 after; |
| 148 | }; |
| 149 | |
Trond Myklebust | cee54fc | 2005-10-18 14:20:12 -0700 | [diff] [blame] | 150 | struct nfs_seqid; |
Benny Halevy | 9ff71c3 | 2009-04-01 09:21:52 -0400 | [diff] [blame] | 151 | |
Andy Adamson | 557134a | 2009-04-01 09:21:53 -0400 | [diff] [blame] | 152 | /* nfs41 sessions channel attributes */ |
| 153 | struct nfs4_channel_attrs { |
| 154 | u32 headerpadsz; |
| 155 | u32 max_rqst_sz; |
| 156 | u32 max_resp_sz; |
| 157 | u32 max_resp_sz_cached; |
| 158 | u32 max_ops; |
| 159 | u32 max_reqs; |
| 160 | }; |
| 161 | |
| 162 | /* nfs41 sessions slot seqid */ |
| 163 | struct nfs4_slot { |
| 164 | u32 seq_nr; |
| 165 | }; |
| 166 | |
Benny Halevy | 9ff71c3 | 2009-04-01 09:21:52 -0400 | [diff] [blame] | 167 | struct nfs4_sequence_args { |
Benny Halevy | f375297 | 2009-04-01 09:22:04 -0400 | [diff] [blame] | 168 | struct nfs4_session *sa_session; |
Andy Adamson | fbcd4ab | 2009-04-01 09:22:15 -0400 | [diff] [blame] | 169 | u8 sa_slotid; |
| 170 | u8 sa_cache_this; |
Benny Halevy | 9ff71c3 | 2009-04-01 09:21:52 -0400 | [diff] [blame] | 171 | }; |
| 172 | |
| 173 | struct nfs4_sequence_res { |
Benny Halevy | f375297 | 2009-04-01 09:22:04 -0400 | [diff] [blame] | 174 | struct nfs4_session *sr_session; |
Benny Halevy | dfb4f309 | 2010-09-24 09:17:01 -0400 | [diff] [blame] | 175 | struct nfs4_slot *sr_slot; /* slot used to send request */ |
Andy Adamson | fbcd4ab | 2009-04-01 09:22:15 -0400 | [diff] [blame] | 176 | int sr_status; /* sequence operation status */ |
Richard Kennedy | a01878a | 2009-12-03 15:58:56 -0500 | [diff] [blame] | 177 | unsigned long sr_renewal_time; |
Alexandros Batsakis | 0629e37 | 2009-12-05 13:46:14 -0500 | [diff] [blame] | 178 | u32 sr_status_flags; |
Benny Halevy | 9ff71c3 | 2009-04-01 09:21:52 -0400 | [diff] [blame] | 179 | }; |
| 180 | |
Andy Adamson | 2050f0c | 2009-04-01 09:22:30 -0400 | [diff] [blame] | 181 | struct nfs4_get_lease_time_args { |
| 182 | struct nfs4_sequence_args la_seq_args; |
| 183 | }; |
| 184 | |
| 185 | struct nfs4_get_lease_time_res { |
| 186 | struct nfs_fsinfo *lr_fsinfo; |
| 187 | struct nfs4_sequence_res lr_seq_res; |
| 188 | }; |
| 189 | |
Andy Adamson | b1f69b7 | 2010-10-20 00:18:03 -0400 | [diff] [blame] | 190 | #define PNFS_LAYOUT_MAXSIZE 4096 |
| 191 | |
| 192 | struct nfs4_layoutdriver_data { |
| 193 | __u32 len; |
| 194 | void *buf; |
| 195 | }; |
| 196 | |
| 197 | struct pnfs_layout_range { |
| 198 | u32 iomode; |
| 199 | u64 offset; |
| 200 | u64 length; |
| 201 | }; |
| 202 | |
| 203 | struct nfs4_layoutget_args { |
| 204 | __u32 type; |
| 205 | struct pnfs_layout_range range; |
| 206 | __u64 minlength; |
| 207 | __u32 maxcount; |
| 208 | struct inode *inode; |
| 209 | struct nfs_open_context *ctx; |
| 210 | struct nfs4_sequence_args seq_args; |
| 211 | }; |
| 212 | |
| 213 | struct nfs4_layoutget_res { |
| 214 | __u32 return_on_close; |
| 215 | struct pnfs_layout_range range; |
| 216 | __u32 type; |
| 217 | nfs4_stateid stateid; |
| 218 | struct nfs4_layoutdriver_data layout; |
| 219 | struct nfs4_sequence_res seq_res; |
| 220 | }; |
| 221 | |
| 222 | struct nfs4_layoutget { |
| 223 | struct nfs4_layoutget_args args; |
| 224 | struct nfs4_layoutget_res res; |
| 225 | struct pnfs_layout_segment **lsegpp; |
| 226 | int status; |
| 227 | }; |
| 228 | |
| 229 | struct nfs4_getdeviceinfo_args { |
| 230 | struct pnfs_device *pdev; |
| 231 | struct nfs4_sequence_args seq_args; |
| 232 | }; |
| 233 | |
| 234 | struct nfs4_getdeviceinfo_res { |
| 235 | struct pnfs_device *pdev; |
| 236 | struct nfs4_sequence_res seq_res; |
| 237 | }; |
| 238 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 239 | /* |
| 240 | * Arguments to the open call. |
| 241 | */ |
| 242 | struct nfs_openargs { |
| 243 | const struct nfs_fh * fh; |
Trond Myklebust | cee54fc | 2005-10-18 14:20:12 -0700 | [diff] [blame] | 244 | struct nfs_seqid * seqid; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 245 | int open_flags; |
Trond Myklebust | dc0b027 | 2008-12-23 15:21:56 -0500 | [diff] [blame] | 246 | fmode_t fmode; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 247 | __u64 clientid; |
Trond Myklebust | 9f958ab | 2007-07-02 13:58:33 -0400 | [diff] [blame] | 248 | __u64 id; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 249 | union { |
Trond Myklebust | d77d76f | 2010-06-16 09:52:27 -0400 | [diff] [blame] | 250 | struct { |
| 251 | struct iattr * attrs; /* UNCHECKED, GUARDED */ |
| 252 | nfs4_verifier verifier; /* EXCLUSIVE */ |
| 253 | }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 254 | nfs4_stateid delegation; /* CLAIM_DELEGATE_CUR */ |
Trond Myklebust | bd7bf9d | 2008-12-23 15:21:53 -0500 | [diff] [blame] | 255 | fmode_t delegation_type; /* CLAIM_PREVIOUS */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 256 | } u; |
| 257 | const struct qstr * name; |
| 258 | const struct nfs_server *server; /* Needed for ID mapping */ |
| 259 | const u32 * bitmask; |
| 260 | __u32 claim; |
Benny Halevy | 9ff71c3 | 2009-04-01 09:21:52 -0400 | [diff] [blame] | 261 | struct nfs4_sequence_args seq_args; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 262 | }; |
| 263 | |
| 264 | struct nfs_openres { |
| 265 | nfs4_stateid stateid; |
| 266 | struct nfs_fh fh; |
| 267 | struct nfs4_change_info cinfo; |
| 268 | __u32 rflags; |
| 269 | struct nfs_fattr * f_attr; |
Trond Myklebust | 56ae19f | 2005-10-27 22:12:40 -0400 | [diff] [blame] | 270 | struct nfs_fattr * dir_attr; |
Trond Myklebust | c1d5193 | 2008-04-07 13:20:54 -0400 | [diff] [blame] | 271 | struct nfs_seqid * seqid; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 272 | const struct nfs_server *server; |
Trond Myklebust | bd7bf9d | 2008-12-23 15:21:53 -0500 | [diff] [blame] | 273 | fmode_t delegation_type; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 274 | nfs4_stateid delegation; |
| 275 | __u32 do_recall; |
| 276 | __u64 maxsize; |
Jeff Layton | aa53ed5 | 2007-06-05 14:49:03 -0400 | [diff] [blame] | 277 | __u32 attrset[NFS4_BITMAP_SIZE]; |
Benny Halevy | 9ff71c3 | 2009-04-01 09:21:52 -0400 | [diff] [blame] | 278 | struct nfs4_sequence_res seq_res; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 279 | }; |
| 280 | |
| 281 | /* |
| 282 | * Arguments to the open_confirm call. |
| 283 | */ |
| 284 | struct nfs_open_confirmargs { |
| 285 | const struct nfs_fh * fh; |
Trond Myklebust | cdd4e68 | 2006-01-03 09:55:12 +0100 | [diff] [blame] | 286 | nfs4_stateid * stateid; |
Trond Myklebust | cee54fc | 2005-10-18 14:20:12 -0700 | [diff] [blame] | 287 | struct nfs_seqid * seqid; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 288 | }; |
| 289 | |
| 290 | struct nfs_open_confirmres { |
| 291 | nfs4_stateid stateid; |
Trond Myklebust | c1d5193 | 2008-04-07 13:20:54 -0400 | [diff] [blame] | 292 | struct nfs_seqid * seqid; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 293 | }; |
| 294 | |
| 295 | /* |
| 296 | * Arguments to the close call. |
| 297 | */ |
| 298 | struct nfs_closeargs { |
| 299 | struct nfs_fh * fh; |
Trond Myklebust | 9512135 | 2005-10-18 14:20:12 -0700 | [diff] [blame] | 300 | nfs4_stateid * stateid; |
Trond Myklebust | cee54fc | 2005-10-18 14:20:12 -0700 | [diff] [blame] | 301 | struct nfs_seqid * seqid; |
Trond Myklebust | dc0b027 | 2008-12-23 15:21:56 -0500 | [diff] [blame] | 302 | fmode_t fmode; |
Trond Myklebust | 516a6af | 2005-10-27 22:12:41 -0400 | [diff] [blame] | 303 | const u32 * bitmask; |
Benny Halevy | 9ff71c3 | 2009-04-01 09:21:52 -0400 | [diff] [blame] | 304 | struct nfs4_sequence_args seq_args; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 305 | }; |
| 306 | |
| 307 | struct nfs_closeres { |
| 308 | nfs4_stateid stateid; |
Trond Myklebust | 516a6af | 2005-10-27 22:12:41 -0400 | [diff] [blame] | 309 | struct nfs_fattr * fattr; |
Trond Myklebust | c1d5193 | 2008-04-07 13:20:54 -0400 | [diff] [blame] | 310 | struct nfs_seqid * seqid; |
Trond Myklebust | 516a6af | 2005-10-27 22:12:41 -0400 | [diff] [blame] | 311 | const struct nfs_server *server; |
Benny Halevy | 9ff71c3 | 2009-04-01 09:21:52 -0400 | [diff] [blame] | 312 | struct nfs4_sequence_res seq_res; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 313 | }; |
| 314 | /* |
| 315 | * * Arguments to the lock,lockt, and locku call. |
| 316 | * */ |
| 317 | struct nfs_lowner { |
Trond Myklebust | 911d1aa | 2006-01-03 09:55:16 +0100 | [diff] [blame] | 318 | __u64 clientid; |
Trond Myklebust | 9f958ab | 2007-07-02 13:58:33 -0400 | [diff] [blame] | 319 | __u64 id; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 320 | }; |
| 321 | |
Trond Myklebust | 911d1aa | 2006-01-03 09:55:16 +0100 | [diff] [blame] | 322 | struct nfs_lock_args { |
| 323 | struct nfs_fh * fh; |
| 324 | struct file_lock * fl; |
Trond Myklebust | 06735b3 | 2005-10-18 14:20:15 -0700 | [diff] [blame] | 325 | struct nfs_seqid * lock_seqid; |
| 326 | nfs4_stateid * lock_stateid; |
| 327 | struct nfs_seqid * open_seqid; |
| 328 | nfs4_stateid * open_stateid; |
Trond Myklebust | 911d1aa | 2006-01-03 09:55:16 +0100 | [diff] [blame] | 329 | struct nfs_lowner lock_owner; |
| 330 | unsigned char block : 1; |
| 331 | unsigned char reclaim : 1; |
| 332 | unsigned char new_lock_owner : 1; |
Benny Halevy | 9ff71c3 | 2009-04-01 09:21:52 -0400 | [diff] [blame] | 333 | struct nfs4_sequence_args seq_args; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 334 | }; |
| 335 | |
Trond Myklebust | 911d1aa | 2006-01-03 09:55:16 +0100 | [diff] [blame] | 336 | struct nfs_lock_res { |
Trond Myklebust | c1d5193 | 2008-04-07 13:20:54 -0400 | [diff] [blame] | 337 | nfs4_stateid stateid; |
| 338 | struct nfs_seqid * lock_seqid; |
| 339 | struct nfs_seqid * open_seqid; |
Benny Halevy | 9ff71c3 | 2009-04-01 09:21:52 -0400 | [diff] [blame] | 340 | struct nfs4_sequence_res seq_res; |
Trond Myklebust | 911d1aa | 2006-01-03 09:55:16 +0100 | [diff] [blame] | 341 | }; |
| 342 | |
| 343 | struct nfs_locku_args { |
| 344 | struct nfs_fh * fh; |
| 345 | struct file_lock * fl; |
Trond Myklebust | cee54fc | 2005-10-18 14:20:12 -0700 | [diff] [blame] | 346 | struct nfs_seqid * seqid; |
Trond Myklebust | faf5f49 | 2005-10-18 14:20:15 -0700 | [diff] [blame] | 347 | nfs4_stateid * stateid; |
Benny Halevy | 9ff71c3 | 2009-04-01 09:21:52 -0400 | [diff] [blame] | 348 | struct nfs4_sequence_args seq_args; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 349 | }; |
| 350 | |
Trond Myklebust | 911d1aa | 2006-01-03 09:55:16 +0100 | [diff] [blame] | 351 | struct nfs_locku_res { |
Trond Myklebust | c1d5193 | 2008-04-07 13:20:54 -0400 | [diff] [blame] | 352 | nfs4_stateid stateid; |
| 353 | struct nfs_seqid * seqid; |
Benny Halevy | 9ff71c3 | 2009-04-01 09:21:52 -0400 | [diff] [blame] | 354 | struct nfs4_sequence_res seq_res; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 355 | }; |
| 356 | |
Trond Myklebust | 911d1aa | 2006-01-03 09:55:16 +0100 | [diff] [blame] | 357 | struct nfs_lockt_args { |
| 358 | struct nfs_fh * fh; |
| 359 | struct file_lock * fl; |
| 360 | struct nfs_lowner lock_owner; |
Benny Halevy | 9ff71c3 | 2009-04-01 09:21:52 -0400 | [diff] [blame] | 361 | struct nfs4_sequence_args seq_args; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 362 | }; |
| 363 | |
Trond Myklebust | 911d1aa | 2006-01-03 09:55:16 +0100 | [diff] [blame] | 364 | struct nfs_lockt_res { |
| 365 | struct file_lock * denied; /* LOCK, LOCKT failed */ |
Benny Halevy | 9ff71c3 | 2009-04-01 09:21:52 -0400 | [diff] [blame] | 366 | struct nfs4_sequence_res seq_res; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 367 | }; |
| 368 | |
Trond Myklebust | d3c7b7c | 2010-07-01 12:49:01 -0400 | [diff] [blame] | 369 | struct nfs_release_lockowner_args { |
| 370 | struct nfs_lowner lock_owner; |
| 371 | }; |
| 372 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 373 | struct nfs4_delegreturnargs { |
| 374 | const struct nfs_fh *fhandle; |
| 375 | const nfs4_stateid *stateid; |
Trond Myklebust | fa178f2 | 2006-01-03 09:55:38 +0100 | [diff] [blame] | 376 | const u32 * bitmask; |
Benny Halevy | 9ff71c3 | 2009-04-01 09:21:52 -0400 | [diff] [blame] | 377 | struct nfs4_sequence_args seq_args; |
Trond Myklebust | fa178f2 | 2006-01-03 09:55:38 +0100 | [diff] [blame] | 378 | }; |
| 379 | |
| 380 | struct nfs4_delegreturnres { |
| 381 | struct nfs_fattr * fattr; |
| 382 | const struct nfs_server *server; |
Benny Halevy | 9ff71c3 | 2009-04-01 09:21:52 -0400 | [diff] [blame] | 383 | struct nfs4_sequence_res seq_res; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 384 | }; |
| 385 | |
| 386 | /* |
| 387 | * Arguments to the read call. |
| 388 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 389 | struct nfs_readargs { |
| 390 | struct nfs_fh * fh; |
| 391 | struct nfs_open_context *context; |
Trond Myklebust | f11ac8d | 2010-06-25 16:35:53 -0400 | [diff] [blame] | 392 | struct nfs_lock_context *lock_context; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 393 | __u64 offset; |
| 394 | __u32 count; |
| 395 | unsigned int pgbase; |
| 396 | struct page ** pages; |
Benny Halevy | 9ff71c3 | 2009-04-01 09:21:52 -0400 | [diff] [blame] | 397 | struct nfs4_sequence_args seq_args; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 398 | }; |
| 399 | |
| 400 | struct nfs_readres { |
| 401 | struct nfs_fattr * fattr; |
| 402 | __u32 count; |
| 403 | int eof; |
Benny Halevy | 9ff71c3 | 2009-04-01 09:21:52 -0400 | [diff] [blame] | 404 | struct nfs4_sequence_res seq_res; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 405 | }; |
| 406 | |
| 407 | /* |
| 408 | * Arguments to the write call. |
| 409 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 410 | struct nfs_writeargs { |
| 411 | struct nfs_fh * fh; |
| 412 | struct nfs_open_context *context; |
Trond Myklebust | f11ac8d | 2010-06-25 16:35:53 -0400 | [diff] [blame] | 413 | struct nfs_lock_context *lock_context; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 414 | __u64 offset; |
| 415 | __u32 count; |
| 416 | enum nfs3_stable_how stable; |
| 417 | unsigned int pgbase; |
| 418 | struct page ** pages; |
Trond Myklebust | 4f9838c | 2005-10-27 22:12:44 -0400 | [diff] [blame] | 419 | const u32 * bitmask; |
Benny Halevy | 9ff71c3 | 2009-04-01 09:21:52 -0400 | [diff] [blame] | 420 | struct nfs4_sequence_args seq_args; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 421 | }; |
| 422 | |
| 423 | struct nfs_writeverf { |
| 424 | enum nfs3_stable_how committed; |
Al Viro | bc4785c | 2006-10-19 23:28:51 -0700 | [diff] [blame] | 425 | __be32 verifier[2]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 426 | }; |
| 427 | |
| 428 | struct nfs_writeres { |
| 429 | struct nfs_fattr * fattr; |
| 430 | struct nfs_writeverf * verf; |
| 431 | __u32 count; |
Trond Myklebust | 4f9838c | 2005-10-27 22:12:44 -0400 | [diff] [blame] | 432 | const struct nfs_server *server; |
Benny Halevy | 9ff71c3 | 2009-04-01 09:21:52 -0400 | [diff] [blame] | 433 | struct nfs4_sequence_res seq_res; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 434 | }; |
| 435 | |
| 436 | /* |
Trond Myklebust | 4fdc17b | 2007-07-14 15:39:57 -0400 | [diff] [blame] | 437 | * Common arguments to the unlink call |
| 438 | */ |
| 439 | struct nfs_removeargs { |
| 440 | const struct nfs_fh *fh; |
| 441 | struct qstr name; |
| 442 | const u32 * bitmask; |
Benny Halevy | 9ff71c3 | 2009-04-01 09:21:52 -0400 | [diff] [blame] | 443 | struct nfs4_sequence_args seq_args; |
Trond Myklebust | 4fdc17b | 2007-07-14 15:39:57 -0400 | [diff] [blame] | 444 | }; |
| 445 | |
| 446 | struct nfs_removeres { |
| 447 | const struct nfs_server *server; |
Trond Myklebust | d346890 | 2010-04-16 16:22:50 -0400 | [diff] [blame] | 448 | struct nfs_fattr *dir_attr; |
Trond Myklebust | 4fdc17b | 2007-07-14 15:39:57 -0400 | [diff] [blame] | 449 | struct nfs4_change_info cinfo; |
Benny Halevy | 9ff71c3 | 2009-04-01 09:21:52 -0400 | [diff] [blame] | 450 | struct nfs4_sequence_res seq_res; |
Trond Myklebust | 4fdc17b | 2007-07-14 15:39:57 -0400 | [diff] [blame] | 451 | }; |
| 452 | |
| 453 | /* |
Jeff Layton | 920769f | 2010-09-17 17:30:25 -0400 | [diff] [blame] | 454 | * Common arguments to the rename call |
| 455 | */ |
| 456 | struct nfs_renameargs { |
| 457 | const struct nfs_fh *old_dir; |
| 458 | const struct nfs_fh *new_dir; |
| 459 | const struct qstr *old_name; |
| 460 | const struct qstr *new_name; |
| 461 | const u32 *bitmask; |
| 462 | struct nfs4_sequence_args seq_args; |
| 463 | }; |
| 464 | |
Jeff Layton | e8582a8 | 2010-09-17 17:31:06 -0400 | [diff] [blame] | 465 | struct nfs_renameres { |
| 466 | const struct nfs_server *server; |
| 467 | struct nfs4_change_info old_cinfo; |
| 468 | struct nfs_fattr *old_fattr; |
| 469 | struct nfs4_change_info new_cinfo; |
| 470 | struct nfs_fattr *new_fattr; |
| 471 | struct nfs4_sequence_res seq_res; |
| 472 | }; |
| 473 | |
Jeff Layton | 920769f | 2010-09-17 17:30:25 -0400 | [diff] [blame] | 474 | /* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 475 | * Argument struct for decode_entry function |
| 476 | */ |
| 477 | struct nfs_entry { |
| 478 | __u64 ino; |
| 479 | __u64 cookie, |
| 480 | prev_cookie; |
| 481 | const char * name; |
| 482 | unsigned int len; |
| 483 | int eof; |
| 484 | struct nfs_fh * fh; |
| 485 | struct nfs_fattr * fattr; |
| 486 | }; |
| 487 | |
| 488 | /* |
| 489 | * The following types are for NFSv2 only. |
| 490 | */ |
| 491 | struct nfs_sattrargs { |
| 492 | struct nfs_fh * fh; |
| 493 | struct iattr * sattr; |
| 494 | }; |
| 495 | |
| 496 | struct nfs_diropargs { |
| 497 | struct nfs_fh * fh; |
| 498 | const char * name; |
| 499 | unsigned int len; |
| 500 | }; |
| 501 | |
| 502 | struct nfs_createargs { |
| 503 | struct nfs_fh * fh; |
| 504 | const char * name; |
| 505 | unsigned int len; |
| 506 | struct iattr * sattr; |
| 507 | }; |
| 508 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 509 | struct nfs_setattrargs { |
| 510 | struct nfs_fh * fh; |
| 511 | nfs4_stateid stateid; |
| 512 | struct iattr * iap; |
| 513 | const struct nfs_server * server; /* Needed for name mapping */ |
| 514 | const u32 * bitmask; |
Benny Halevy | 9ff71c3 | 2009-04-01 09:21:52 -0400 | [diff] [blame] | 515 | struct nfs4_sequence_args seq_args; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 516 | }; |
| 517 | |
J. Bruce Fields | 23ec696 | 2005-06-22 17:16:22 +0000 | [diff] [blame] | 518 | struct nfs_setaclargs { |
| 519 | struct nfs_fh * fh; |
| 520 | size_t acl_len; |
| 521 | unsigned int acl_pgbase; |
| 522 | struct page ** acl_pages; |
Benny Halevy | 9ff71c3 | 2009-04-01 09:21:52 -0400 | [diff] [blame] | 523 | struct nfs4_sequence_args seq_args; |
J. Bruce Fields | 23ec696 | 2005-06-22 17:16:22 +0000 | [diff] [blame] | 524 | }; |
| 525 | |
Benny Halevy | 73c403a | 2009-04-01 09:22:01 -0400 | [diff] [blame] | 526 | struct nfs_setaclres { |
| 527 | struct nfs4_sequence_res seq_res; |
| 528 | }; |
| 529 | |
J. Bruce Fields | 029d105 | 2005-06-22 17:16:22 +0000 | [diff] [blame] | 530 | struct nfs_getaclargs { |
| 531 | struct nfs_fh * fh; |
| 532 | size_t acl_len; |
| 533 | unsigned int acl_pgbase; |
| 534 | struct page ** acl_pages; |
Benny Halevy | 9ff71c3 | 2009-04-01 09:21:52 -0400 | [diff] [blame] | 535 | struct nfs4_sequence_args seq_args; |
J. Bruce Fields | 029d105 | 2005-06-22 17:16:22 +0000 | [diff] [blame] | 536 | }; |
| 537 | |
Benny Halevy | 663c79b | 2009-04-01 09:21:59 -0400 | [diff] [blame] | 538 | struct nfs_getaclres { |
| 539 | size_t acl_len; |
| 540 | struct nfs4_sequence_res seq_res; |
| 541 | }; |
| 542 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 543 | struct nfs_setattrres { |
| 544 | struct nfs_fattr * fattr; |
| 545 | const struct nfs_server * server; |
Benny Halevy | 9ff71c3 | 2009-04-01 09:21:52 -0400 | [diff] [blame] | 546 | struct nfs4_sequence_res seq_res; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 547 | }; |
| 548 | |
| 549 | struct nfs_linkargs { |
| 550 | struct nfs_fh * fromfh; |
| 551 | struct nfs_fh * tofh; |
| 552 | const char * toname; |
| 553 | unsigned int tolen; |
| 554 | }; |
| 555 | |
| 556 | struct nfs_symlinkargs { |
| 557 | struct nfs_fh * fromfh; |
| 558 | const char * fromname; |
| 559 | unsigned int fromlen; |
Chuck Lever | 94a6d75 | 2006-08-22 20:06:23 -0400 | [diff] [blame] | 560 | struct page ** pages; |
| 561 | unsigned int pathlen; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 562 | struct iattr * sattr; |
| 563 | }; |
| 564 | |
| 565 | struct nfs_readdirargs { |
| 566 | struct nfs_fh * fh; |
| 567 | __u32 cookie; |
| 568 | unsigned int count; |
| 569 | struct page ** pages; |
| 570 | }; |
| 571 | |
Andreas Gruenbacher | b7fa055 | 2005-06-22 17:16:27 +0000 | [diff] [blame] | 572 | struct nfs3_getaclargs { |
| 573 | struct nfs_fh * fh; |
| 574 | int mask; |
| 575 | struct page ** pages; |
| 576 | }; |
| 577 | |
| 578 | struct nfs3_setaclargs { |
| 579 | struct inode * inode; |
| 580 | int mask; |
| 581 | struct posix_acl * acl_access; |
| 582 | struct posix_acl * acl_default; |
Trond Myklebust | ae46141f | 2009-03-10 20:33:18 -0400 | [diff] [blame] | 583 | size_t len; |
| 584 | unsigned int npages; |
Andreas Gruenbacher | b7fa055 | 2005-06-22 17:16:27 +0000 | [diff] [blame] | 585 | struct page ** pages; |
| 586 | }; |
| 587 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 588 | struct nfs_diropok { |
| 589 | struct nfs_fh * fh; |
| 590 | struct nfs_fattr * fattr; |
| 591 | }; |
| 592 | |
| 593 | struct nfs_readlinkargs { |
| 594 | struct nfs_fh * fh; |
| 595 | unsigned int pgbase; |
| 596 | unsigned int pglen; |
| 597 | struct page ** pages; |
| 598 | }; |
| 599 | |
| 600 | struct nfs3_sattrargs { |
| 601 | struct nfs_fh * fh; |
| 602 | struct iattr * sattr; |
| 603 | unsigned int guard; |
| 604 | struct timespec guardtime; |
| 605 | }; |
| 606 | |
| 607 | struct nfs3_diropargs { |
| 608 | struct nfs_fh * fh; |
| 609 | const char * name; |
| 610 | unsigned int len; |
| 611 | }; |
| 612 | |
| 613 | struct nfs3_accessargs { |
| 614 | struct nfs_fh * fh; |
| 615 | __u32 access; |
| 616 | }; |
| 617 | |
| 618 | struct nfs3_createargs { |
| 619 | struct nfs_fh * fh; |
| 620 | const char * name; |
| 621 | unsigned int len; |
| 622 | struct iattr * sattr; |
| 623 | enum nfs3_createmode createmode; |
Al Viro | bc4785c | 2006-10-19 23:28:51 -0700 | [diff] [blame] | 624 | __be32 verifier[2]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 625 | }; |
| 626 | |
| 627 | struct nfs3_mkdirargs { |
| 628 | struct nfs_fh * fh; |
| 629 | const char * name; |
| 630 | unsigned int len; |
| 631 | struct iattr * sattr; |
| 632 | }; |
| 633 | |
| 634 | struct nfs3_symlinkargs { |
| 635 | struct nfs_fh * fromfh; |
| 636 | const char * fromname; |
| 637 | unsigned int fromlen; |
Chuck Lever | 94a6d75 | 2006-08-22 20:06:23 -0400 | [diff] [blame] | 638 | struct page ** pages; |
| 639 | unsigned int pathlen; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 640 | struct iattr * sattr; |
| 641 | }; |
| 642 | |
| 643 | struct nfs3_mknodargs { |
| 644 | struct nfs_fh * fh; |
| 645 | const char * name; |
| 646 | unsigned int len; |
| 647 | enum nfs3_ftype type; |
| 648 | struct iattr * sattr; |
| 649 | dev_t rdev; |
| 650 | }; |
| 651 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 652 | struct nfs3_linkargs { |
| 653 | struct nfs_fh * fromfh; |
| 654 | struct nfs_fh * tofh; |
| 655 | const char * toname; |
| 656 | unsigned int tolen; |
| 657 | }; |
| 658 | |
| 659 | struct nfs3_readdirargs { |
| 660 | struct nfs_fh * fh; |
| 661 | __u64 cookie; |
Al Viro | bc4785c | 2006-10-19 23:28:51 -0700 | [diff] [blame] | 662 | __be32 verf[2]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 663 | int plus; |
| 664 | unsigned int count; |
| 665 | struct page ** pages; |
| 666 | }; |
| 667 | |
| 668 | struct nfs3_diropres { |
| 669 | struct nfs_fattr * dir_attr; |
| 670 | struct nfs_fh * fh; |
| 671 | struct nfs_fattr * fattr; |
| 672 | }; |
| 673 | |
| 674 | struct nfs3_accessres { |
| 675 | struct nfs_fattr * fattr; |
| 676 | __u32 access; |
| 677 | }; |
| 678 | |
| 679 | struct nfs3_readlinkargs { |
| 680 | struct nfs_fh * fh; |
| 681 | unsigned int pgbase; |
| 682 | unsigned int pglen; |
| 683 | struct page ** pages; |
| 684 | }; |
| 685 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 686 | struct nfs3_linkres { |
| 687 | struct nfs_fattr * dir_attr; |
| 688 | struct nfs_fattr * fattr; |
| 689 | }; |
| 690 | |
| 691 | struct nfs3_readdirres { |
| 692 | struct nfs_fattr * dir_attr; |
Al Viro | bc4785c | 2006-10-19 23:28:51 -0700 | [diff] [blame] | 693 | __be32 * verf; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 694 | int plus; |
| 695 | }; |
| 696 | |
Andreas Gruenbacher | b7fa055 | 2005-06-22 17:16:27 +0000 | [diff] [blame] | 697 | struct nfs3_getaclres { |
| 698 | struct nfs_fattr * fattr; |
| 699 | int mask; |
| 700 | unsigned int acl_access_count; |
| 701 | unsigned int acl_default_count; |
| 702 | struct posix_acl * acl_access; |
| 703 | struct posix_acl * acl_default; |
| 704 | }; |
| 705 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 706 | #ifdef CONFIG_NFS_V4 |
| 707 | |
| 708 | typedef u64 clientid4; |
| 709 | |
| 710 | struct nfs4_accessargs { |
| 711 | const struct nfs_fh * fh; |
Trond Myklebust | 76b3299 | 2007-08-10 17:45:11 -0400 | [diff] [blame] | 712 | const u32 * bitmask; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 713 | u32 access; |
Benny Halevy | 9ff71c3 | 2009-04-01 09:21:52 -0400 | [diff] [blame] | 714 | struct nfs4_sequence_args seq_args; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 715 | }; |
| 716 | |
| 717 | struct nfs4_accessres { |
Trond Myklebust | 76b3299 | 2007-08-10 17:45:11 -0400 | [diff] [blame] | 718 | const struct nfs_server * server; |
| 719 | struct nfs_fattr * fattr; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 720 | u32 supported; |
| 721 | u32 access; |
Benny Halevy | 9ff71c3 | 2009-04-01 09:21:52 -0400 | [diff] [blame] | 722 | struct nfs4_sequence_res seq_res; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 723 | }; |
| 724 | |
| 725 | struct nfs4_create_arg { |
| 726 | u32 ftype; |
| 727 | union { |
Chuck Lever | 94a6d75 | 2006-08-22 20:06:23 -0400 | [diff] [blame] | 728 | struct { |
| 729 | struct page ** pages; |
| 730 | unsigned int len; |
| 731 | } symlink; /* NF4LNK */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 732 | struct { |
| 733 | u32 specdata1; |
| 734 | u32 specdata2; |
| 735 | } device; /* NF4BLK, NF4CHR */ |
| 736 | } u; |
| 737 | const struct qstr * name; |
| 738 | const struct nfs_server * server; |
| 739 | const struct iattr * attrs; |
| 740 | const struct nfs_fh * dir_fh; |
| 741 | const u32 * bitmask; |
Benny Halevy | 9ff71c3 | 2009-04-01 09:21:52 -0400 | [diff] [blame] | 742 | struct nfs4_sequence_args seq_args; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 743 | }; |
| 744 | |
| 745 | struct nfs4_create_res { |
| 746 | const struct nfs_server * server; |
| 747 | struct nfs_fh * fh; |
| 748 | struct nfs_fattr * fattr; |
| 749 | struct nfs4_change_info dir_cinfo; |
Trond Myklebust | 56ae19f | 2005-10-27 22:12:40 -0400 | [diff] [blame] | 750 | struct nfs_fattr * dir_fattr; |
Benny Halevy | 9ff71c3 | 2009-04-01 09:21:52 -0400 | [diff] [blame] | 751 | struct nfs4_sequence_res seq_res; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 752 | }; |
| 753 | |
| 754 | struct nfs4_fsinfo_arg { |
| 755 | const struct nfs_fh * fh; |
| 756 | const u32 * bitmask; |
Benny Halevy | 9ff71c3 | 2009-04-01 09:21:52 -0400 | [diff] [blame] | 757 | struct nfs4_sequence_args seq_args; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 758 | }; |
| 759 | |
Benny Halevy | 3dda5e4 | 2009-04-01 09:21:57 -0400 | [diff] [blame] | 760 | struct nfs4_fsinfo_res { |
| 761 | struct nfs_fsinfo *fsinfo; |
| 762 | struct nfs4_sequence_res seq_res; |
| 763 | }; |
| 764 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 765 | struct nfs4_getattr_arg { |
| 766 | const struct nfs_fh * fh; |
| 767 | const u32 * bitmask; |
Benny Halevy | 9ff71c3 | 2009-04-01 09:21:52 -0400 | [diff] [blame] | 768 | struct nfs4_sequence_args seq_args; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 769 | }; |
| 770 | |
| 771 | struct nfs4_getattr_res { |
| 772 | const struct nfs_server * server; |
| 773 | struct nfs_fattr * fattr; |
Benny Halevy | 9ff71c3 | 2009-04-01 09:21:52 -0400 | [diff] [blame] | 774 | struct nfs4_sequence_res seq_res; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 775 | }; |
| 776 | |
| 777 | struct nfs4_link_arg { |
| 778 | const struct nfs_fh * fh; |
| 779 | const struct nfs_fh * dir_fh; |
| 780 | const struct qstr * name; |
Trond Myklebust | 91ba2ee | 2005-10-27 22:12:42 -0400 | [diff] [blame] | 781 | const u32 * bitmask; |
Benny Halevy | 9ff71c3 | 2009-04-01 09:21:52 -0400 | [diff] [blame] | 782 | struct nfs4_sequence_args seq_args; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 783 | }; |
| 784 | |
Trond Myklebust | 91ba2ee | 2005-10-27 22:12:42 -0400 | [diff] [blame] | 785 | struct nfs4_link_res { |
| 786 | const struct nfs_server * server; |
| 787 | struct nfs_fattr * fattr; |
| 788 | struct nfs4_change_info cinfo; |
| 789 | struct nfs_fattr * dir_attr; |
Benny Halevy | 9ff71c3 | 2009-04-01 09:21:52 -0400 | [diff] [blame] | 790 | struct nfs4_sequence_res seq_res; |
Trond Myklebust | 91ba2ee | 2005-10-27 22:12:42 -0400 | [diff] [blame] | 791 | }; |
| 792 | |
| 793 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 794 | struct nfs4_lookup_arg { |
| 795 | const struct nfs_fh * dir_fh; |
| 796 | const struct qstr * name; |
| 797 | const u32 * bitmask; |
Benny Halevy | 9ff71c3 | 2009-04-01 09:21:52 -0400 | [diff] [blame] | 798 | struct nfs4_sequence_args seq_args; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 799 | }; |
| 800 | |
| 801 | struct nfs4_lookup_res { |
| 802 | const struct nfs_server * server; |
| 803 | struct nfs_fattr * fattr; |
| 804 | struct nfs_fh * fh; |
Benny Halevy | 9ff71c3 | 2009-04-01 09:21:52 -0400 | [diff] [blame] | 805 | struct nfs4_sequence_res seq_res; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 806 | }; |
| 807 | |
| 808 | struct nfs4_lookup_root_arg { |
| 809 | const u32 * bitmask; |
Benny Halevy | 9ff71c3 | 2009-04-01 09:21:52 -0400 | [diff] [blame] | 810 | struct nfs4_sequence_args seq_args; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 811 | }; |
| 812 | |
| 813 | struct nfs4_pathconf_arg { |
| 814 | const struct nfs_fh * fh; |
| 815 | const u32 * bitmask; |
Benny Halevy | 9ff71c3 | 2009-04-01 09:21:52 -0400 | [diff] [blame] | 816 | struct nfs4_sequence_args seq_args; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 817 | }; |
| 818 | |
Benny Halevy | d45b298 | 2009-04-01 09:21:58 -0400 | [diff] [blame] | 819 | struct nfs4_pathconf_res { |
| 820 | struct nfs_pathconf *pathconf; |
| 821 | struct nfs4_sequence_res seq_res; |
| 822 | }; |
| 823 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 824 | struct nfs4_readdir_arg { |
| 825 | const struct nfs_fh * fh; |
| 826 | u64 cookie; |
| 827 | nfs4_verifier verifier; |
| 828 | u32 count; |
| 829 | struct page ** pages; /* zero-copy data */ |
| 830 | unsigned int pgbase; /* zero-copy data */ |
| 831 | const u32 * bitmask; |
Bryan Schumaker | 82f2e54 | 2010-10-21 16:33:18 -0400 | [diff] [blame] | 832 | int plus; |
Benny Halevy | 9ff71c3 | 2009-04-01 09:21:52 -0400 | [diff] [blame] | 833 | struct nfs4_sequence_args seq_args; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 834 | }; |
| 835 | |
| 836 | struct nfs4_readdir_res { |
| 837 | nfs4_verifier verifier; |
| 838 | unsigned int pgbase; |
Benny Halevy | 9ff71c3 | 2009-04-01 09:21:52 -0400 | [diff] [blame] | 839 | struct nfs4_sequence_res seq_res; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 840 | }; |
| 841 | |
| 842 | struct nfs4_readlink { |
| 843 | const struct nfs_fh * fh; |
| 844 | unsigned int pgbase; |
| 845 | unsigned int pglen; /* zero-copy data */ |
| 846 | struct page ** pages; /* zero-copy data */ |
Benny Halevy | 9ff71c3 | 2009-04-01 09:21:52 -0400 | [diff] [blame] | 847 | struct nfs4_sequence_args seq_args; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 848 | }; |
| 849 | |
Benny Halevy | f50c700 | 2009-04-01 09:21:55 -0400 | [diff] [blame] | 850 | struct nfs4_readlink_res { |
| 851 | struct nfs4_sequence_res seq_res; |
| 852 | }; |
| 853 | |
Trond Myklebust | 19d771f | 2008-10-08 13:54:52 -0400 | [diff] [blame] | 854 | #define NFS4_SETCLIENTID_NAMELEN (127) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 855 | struct nfs4_setclientid { |
Chuck Lever | cc38bac | 2007-12-10 14:56:54 -0500 | [diff] [blame] | 856 | const nfs4_verifier * sc_verifier; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 857 | unsigned int sc_name_len; |
Chuck Lever | d1ce02e | 2008-09-25 11:57:12 -0400 | [diff] [blame] | 858 | char sc_name[NFS4_SETCLIENTID_NAMELEN + 1]; |
Chuck Lever | cc38bac | 2007-12-10 14:56:54 -0500 | [diff] [blame] | 859 | u32 sc_prog; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 860 | unsigned int sc_netid_len; |
Chuck Lever | d1ce02e | 2008-09-25 11:57:12 -0400 | [diff] [blame] | 861 | char sc_netid[RPCBIND_MAXNETIDLEN + 1]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 862 | unsigned int sc_uaddr_len; |
Chuck Lever | d1ce02e | 2008-09-25 11:57:12 -0400 | [diff] [blame] | 863 | char sc_uaddr[RPCBIND_MAXUADDRLEN + 1]; |
Chuck Lever | cc38bac | 2007-12-10 14:56:54 -0500 | [diff] [blame] | 864 | u32 sc_cb_ident; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 865 | }; |
| 866 | |
Trond Myklebust | bb8b27e | 2010-04-16 16:43:06 -0400 | [diff] [blame] | 867 | struct nfs4_setclientid_res { |
| 868 | u64 clientid; |
| 869 | nfs4_verifier confirm; |
| 870 | }; |
| 871 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 872 | struct nfs4_statfs_arg { |
| 873 | const struct nfs_fh * fh; |
| 874 | const u32 * bitmask; |
Benny Halevy | 9ff71c3 | 2009-04-01 09:21:52 -0400 | [diff] [blame] | 875 | struct nfs4_sequence_args seq_args; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 876 | }; |
| 877 | |
Benny Halevy | 24ad148 | 2009-04-01 09:21:56 -0400 | [diff] [blame] | 878 | struct nfs4_statfs_res { |
| 879 | struct nfs_fsstat *fsstat; |
| 880 | struct nfs4_sequence_res seq_res; |
| 881 | }; |
| 882 | |
Benny Halevy | 43652ad | 2009-04-01 09:21:54 -0400 | [diff] [blame] | 883 | struct nfs4_server_caps_arg { |
| 884 | struct nfs_fh *fhandle; |
| 885 | struct nfs4_sequence_args seq_args; |
| 886 | }; |
| 887 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 888 | struct nfs4_server_caps_res { |
| 889 | u32 attr_bitmask[2]; |
| 890 | u32 acl_bitmask; |
| 891 | u32 has_links; |
| 892 | u32 has_symlinks; |
Benny Halevy | 9ff71c3 | 2009-04-01 09:21:52 -0400 | [diff] [blame] | 893 | struct nfs4_sequence_res seq_res; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 894 | }; |
| 895 | |
Manoj Naik | 7aaa0b3 | 2006-06-09 09:34:23 -0400 | [diff] [blame] | 896 | struct nfs4_string { |
| 897 | unsigned int len; |
| 898 | char *data; |
Trond Myklebust | 683b57b | 2006-06-09 09:34:22 -0400 | [diff] [blame] | 899 | }; |
| 900 | |
Manoj Naik | 7aaa0b3 | 2006-06-09 09:34:23 -0400 | [diff] [blame] | 901 | #define NFS4_PATHNAME_MAXCOMPONENTS 512 |
| 902 | struct nfs4_pathname { |
| 903 | unsigned int ncomponents; |
| 904 | struct nfs4_string components[NFS4_PATHNAME_MAXCOMPONENTS]; |
| 905 | }; |
| 906 | |
| 907 | #define NFS4_FS_LOCATION_MAXSERVERS 10 |
| 908 | struct nfs4_fs_location { |
| 909 | unsigned int nservers; |
| 910 | struct nfs4_string servers[NFS4_FS_LOCATION_MAXSERVERS]; |
| 911 | struct nfs4_pathname rootpath; |
| 912 | }; |
| 913 | |
| 914 | #define NFS4_FS_LOCATIONS_MAXENTRIES 10 |
| 915 | struct nfs4_fs_locations { |
Trond Myklebust | 683b57b | 2006-06-09 09:34:22 -0400 | [diff] [blame] | 916 | struct nfs_fattr fattr; |
| 917 | const struct nfs_server *server; |
Manoj Naik | 7aaa0b3 | 2006-06-09 09:34:23 -0400 | [diff] [blame] | 918 | struct nfs4_pathname fs_path; |
Trond Myklebust | 683b57b | 2006-06-09 09:34:22 -0400 | [diff] [blame] | 919 | int nlocations; |
Manoj Naik | 7aaa0b3 | 2006-06-09 09:34:23 -0400 | [diff] [blame] | 920 | struct nfs4_fs_location locations[NFS4_FS_LOCATIONS_MAXENTRIES]; |
Trond Myklebust | 683b57b | 2006-06-09 09:34:22 -0400 | [diff] [blame] | 921 | }; |
| 922 | |
| 923 | struct nfs4_fs_locations_arg { |
| 924 | const struct nfs_fh *dir_fh; |
| 925 | const struct qstr *name; |
| 926 | struct page *page; |
| 927 | const u32 *bitmask; |
Benny Halevy | 9ff71c3 | 2009-04-01 09:21:52 -0400 | [diff] [blame] | 928 | struct nfs4_sequence_args seq_args; |
Trond Myklebust | 683b57b | 2006-06-09 09:34:22 -0400 | [diff] [blame] | 929 | }; |
| 930 | |
Benny Halevy | 2295846 | 2009-04-01 09:22:02 -0400 | [diff] [blame] | 931 | struct nfs4_fs_locations_res { |
| 932 | struct nfs4_fs_locations *fs_locations; |
| 933 | struct nfs4_sequence_res seq_res; |
| 934 | }; |
| 935 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 936 | #endif /* CONFIG_NFS_V4 */ |
| 937 | |
Benny Halevy | 99fe60d | 2009-04-01 09:22:29 -0400 | [diff] [blame] | 938 | struct nfstime4 { |
| 939 | u64 seconds; |
| 940 | u32 nseconds; |
| 941 | }; |
| 942 | |
| 943 | #ifdef CONFIG_NFS_V4_1 |
| 944 | struct nfs_impl_id4 { |
| 945 | u32 domain_len; |
| 946 | char *domain; |
| 947 | u32 name_len; |
| 948 | char *name; |
| 949 | struct nfstime4 date; |
| 950 | }; |
| 951 | |
| 952 | #define NFS4_EXCHANGE_ID_LEN (48) |
| 953 | struct nfs41_exchange_id_args { |
| 954 | struct nfs_client *client; |
| 955 | nfs4_verifier *verifier; |
| 956 | unsigned int id_len; |
| 957 | char id[NFS4_EXCHANGE_ID_LEN]; |
| 958 | u32 flags; |
| 959 | }; |
| 960 | |
| 961 | struct server_owner { |
| 962 | uint64_t minor_id; |
| 963 | uint32_t major_id_sz; |
| 964 | char major_id[NFS4_OPAQUE_LIMIT]; |
| 965 | }; |
| 966 | |
| 967 | struct server_scope { |
| 968 | uint32_t server_scope_sz; |
| 969 | char server_scope[NFS4_OPAQUE_LIMIT]; |
| 970 | }; |
| 971 | |
| 972 | struct nfs41_exchange_id_res { |
| 973 | struct nfs_client *client; |
| 974 | u32 flags; |
| 975 | }; |
Andy Adamson | fc93158 | 2009-04-01 09:22:31 -0400 | [diff] [blame] | 976 | |
| 977 | struct nfs41_create_session_args { |
| 978 | struct nfs_client *client; |
| 979 | uint32_t flags; |
| 980 | uint32_t cb_program; |
| 981 | struct nfs4_channel_attrs fc_attrs; /* Fore Channel */ |
| 982 | struct nfs4_channel_attrs bc_attrs; /* Back Channel */ |
| 983 | }; |
| 984 | |
| 985 | struct nfs41_create_session_res { |
| 986 | struct nfs_client *client; |
| 987 | }; |
Ricardo Labiaga | 18019753 | 2009-12-05 16:08:40 -0500 | [diff] [blame] | 988 | |
| 989 | struct nfs41_reclaim_complete_args { |
| 990 | /* In the future extend to include curr_fh for use with migration */ |
| 991 | unsigned char one_fs:1; |
| 992 | struct nfs4_sequence_args seq_args; |
| 993 | }; |
| 994 | |
| 995 | struct nfs41_reclaim_complete_res { |
| 996 | struct nfs4_sequence_res seq_res; |
| 997 | }; |
Benny Halevy | 99fe60d | 2009-04-01 09:22:29 -0400 | [diff] [blame] | 998 | #endif /* CONFIG_NFS_V4_1 */ |
| 999 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1000 | struct nfs_page; |
| 1001 | |
Chuck Lever | 40859d7 | 2005-11-30 18:09:02 -0500 | [diff] [blame] | 1002 | #define NFS_PAGEVEC_SIZE (8U) |
| 1003 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1004 | struct nfs_read_data { |
| 1005 | int flags; |
| 1006 | struct rpc_task task; |
| 1007 | struct inode *inode; |
| 1008 | struct rpc_cred *cred; |
| 1009 | struct nfs_fattr fattr; /* fattr storage */ |
| 1010 | struct list_head pages; /* Coalesced read requests */ |
| 1011 | struct nfs_page *req; /* multi ops per nfs_page */ |
Chuck Lever | 40859d7 | 2005-11-30 18:09:02 -0500 | [diff] [blame] | 1012 | struct page **pagevec; |
Trond Myklebust | e9f7bee | 2006-09-08 09:48:54 -0700 | [diff] [blame] | 1013 | unsigned int npages; /* Max length of pagevec */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1014 | struct nfs_readargs args; |
| 1015 | struct nfs_readres res; |
| 1016 | #ifdef CONFIG_NFS_V4 |
| 1017 | unsigned long timestamp; /* For lease renewal */ |
| 1018 | #endif |
Chuck Lever | 0d0b5cb | 2006-05-25 01:40:53 -0400 | [diff] [blame] | 1019 | struct page *page_array[NFS_PAGEVEC_SIZE]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1020 | }; |
| 1021 | |
| 1022 | struct nfs_write_data { |
| 1023 | int flags; |
| 1024 | struct rpc_task task; |
| 1025 | struct inode *inode; |
| 1026 | struct rpc_cred *cred; |
| 1027 | struct nfs_fattr fattr; |
| 1028 | struct nfs_writeverf verf; |
| 1029 | struct list_head pages; /* Coalesced requests we wish to flush */ |
| 1030 | struct nfs_page *req; /* multi ops per nfs_page */ |
Chuck Lever | 40859d7 | 2005-11-30 18:09:02 -0500 | [diff] [blame] | 1031 | struct page **pagevec; |
Trond Myklebust | e9f7bee | 2006-09-08 09:48:54 -0700 | [diff] [blame] | 1032 | unsigned int npages; /* Max length of pagevec */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1033 | struct nfs_writeargs args; /* argument struct */ |
| 1034 | struct nfs_writeres res; /* result struct */ |
| 1035 | #ifdef CONFIG_NFS_V4 |
| 1036 | unsigned long timestamp; /* For lease renewal */ |
| 1037 | #endif |
Chuck Lever | 0d0b5cb | 2006-05-25 01:40:53 -0400 | [diff] [blame] | 1038 | struct page *page_array[NFS_PAGEVEC_SIZE]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1039 | }; |
| 1040 | |
| 1041 | struct nfs_access_entry; |
| 1042 | |
| 1043 | /* |
| 1044 | * RPC procedure vector for NFSv2/NFSv3 demuxing |
| 1045 | */ |
| 1046 | struct nfs_rpc_ops { |
Chuck Lever | c0e07cb | 2008-01-14 12:32:05 -0500 | [diff] [blame] | 1047 | u32 version; /* Protocol version */ |
Al Viro | f786aa9 | 2009-02-20 05:51:22 +0000 | [diff] [blame] | 1048 | const struct dentry_operations *dentry_ops; |
Arjan van de Ven | c5ef1c4 | 2007-02-12 00:55:40 -0800 | [diff] [blame] | 1049 | const struct inode_operations *dir_inode_ops; |
| 1050 | const struct inode_operations *file_inode_ops; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1051 | |
| 1052 | int (*getroot) (struct nfs_server *, struct nfs_fh *, |
| 1053 | struct nfs_fsinfo *); |
David Howells | 2b3de44 | 2006-08-22 20:06:09 -0400 | [diff] [blame] | 1054 | int (*lookupfh)(struct nfs_server *, struct nfs_fh *, |
| 1055 | struct qstr *, struct nfs_fh *, |
| 1056 | struct nfs_fattr *); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1057 | int (*getattr) (struct nfs_server *, struct nfs_fh *, |
| 1058 | struct nfs_fattr *); |
| 1059 | int (*setattr) (struct dentry *, struct nfs_fattr *, |
| 1060 | struct iattr *); |
| 1061 | int (*lookup) (struct inode *, struct qstr *, |
| 1062 | struct nfs_fh *, struct nfs_fattr *); |
| 1063 | int (*access) (struct inode *, struct nfs_access_entry *); |
| 1064 | int (*readlink)(struct inode *, struct page *, unsigned int, |
| 1065 | unsigned int); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1066 | int (*create) (struct inode *, struct dentry *, |
Trond Myklebust | c0204fd | 2010-09-17 10:56:51 -0400 | [diff] [blame] | 1067 | struct iattr *, int, struct nfs_open_context *); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1068 | int (*remove) (struct inode *, struct qstr *); |
Trond Myklebust | e4eff1a | 2007-07-14 15:39:58 -0400 | [diff] [blame] | 1069 | void (*unlink_setup) (struct rpc_message *, struct inode *dir); |
| 1070 | int (*unlink_done) (struct rpc_task *, struct inode *); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1071 | int (*rename) (struct inode *, struct qstr *, |
| 1072 | struct inode *, struct qstr *); |
Jeff Layton | d3d4152 | 2010-09-17 17:31:57 -0400 | [diff] [blame] | 1073 | void (*rename_setup) (struct rpc_message *msg, struct inode *dir); |
| 1074 | int (*rename_done) (struct rpc_task *task, struct inode *old_dir, struct inode *new_dir); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1075 | int (*link) (struct inode *, struct inode *, struct qstr *); |
Chuck Lever | 94a6d75 | 2006-08-22 20:06:23 -0400 | [diff] [blame] | 1076 | int (*symlink) (struct inode *, struct dentry *, struct page *, |
| 1077 | unsigned int, struct iattr *); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1078 | int (*mkdir) (struct inode *, struct dentry *, struct iattr *); |
| 1079 | int (*rmdir) (struct inode *, struct qstr *); |
| 1080 | int (*readdir) (struct dentry *, struct rpc_cred *, |
Bryan Schumaker | 56e4ebf | 2010-10-20 15:44:37 -0400 | [diff] [blame] | 1081 | u64, struct page **, unsigned int, int); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1082 | int (*mknod) (struct inode *, struct dentry *, struct iattr *, |
| 1083 | dev_t); |
| 1084 | int (*statfs) (struct nfs_server *, struct nfs_fh *, |
| 1085 | struct nfs_fsstat *); |
| 1086 | int (*fsinfo) (struct nfs_server *, struct nfs_fh *, |
| 1087 | struct nfs_fsinfo *); |
| 1088 | int (*pathconf) (struct nfs_server *, struct nfs_fh *, |
| 1089 | struct nfs_pathconf *); |
David Howells | e9326dc | 2006-08-22 20:06:10 -0400 | [diff] [blame] | 1090 | int (*set_capabilities)(struct nfs_server *, struct nfs_fh *); |
Bryan Schumaker | 82f2e54 | 2010-10-21 16:33:18 -0400 | [diff] [blame] | 1091 | __be32 *(*decode_dirent)(struct xdr_stream *, struct nfs_entry *, struct nfs_server *, int plus); |
Trond Myklebust | bdc7f02 | 2007-07-14 15:40:00 -0400 | [diff] [blame] | 1092 | void (*read_setup) (struct nfs_read_data *, struct rpc_message *); |
Trond Myklebust | ec06c09 | 2006-03-20 13:44:27 -0500 | [diff] [blame] | 1093 | int (*read_done) (struct rpc_task *, struct nfs_read_data *); |
Trond Myklebust | bdc7f02 | 2007-07-14 15:40:00 -0400 | [diff] [blame] | 1094 | void (*write_setup) (struct nfs_write_data *, struct rpc_message *); |
Trond Myklebust | 788e7a8 | 2006-03-20 13:44:27 -0500 | [diff] [blame] | 1095 | int (*write_done) (struct rpc_task *, struct nfs_write_data *); |
Trond Myklebust | bdc7f02 | 2007-07-14 15:40:00 -0400 | [diff] [blame] | 1096 | void (*commit_setup) (struct nfs_write_data *, struct rpc_message *); |
Trond Myklebust | 788e7a8 | 2006-03-20 13:44:27 -0500 | [diff] [blame] | 1097 | int (*commit_done) (struct rpc_task *, struct nfs_write_data *); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1098 | int (*lock)(struct file *, int, struct file_lock *); |
Trond Myklebust | 2116271 | 2008-05-20 19:34:39 -0400 | [diff] [blame] | 1099 | int (*lock_check_bounds)(const struct file_lock *); |
Trond Myklebust | ada70d9 | 2005-06-22 17:16:22 +0000 | [diff] [blame] | 1100 | void (*clear_acl_cache)(struct inode *); |
Trond Myklebust | 7fe5c39 | 2009-03-19 15:35:50 -0400 | [diff] [blame] | 1101 | void (*close_context)(struct nfs_open_context *ctx, int); |
Trond Myklebust | 2b48429 | 2010-09-17 10:56:51 -0400 | [diff] [blame] | 1102 | struct inode * (*open_context) (struct inode *dir, |
| 1103 | struct nfs_open_context *ctx, |
| 1104 | int open_flags, |
| 1105 | struct iattr *iattr); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1106 | }; |
| 1107 | |
| 1108 | /* |
| 1109 | * NFS_CALL(getattr, inode, (fattr)); |
| 1110 | * into |
| 1111 | * NFS_PROTO(inode)->getattr(fattr); |
| 1112 | */ |
| 1113 | #define NFS_CALL(op, inode, args) NFS_PROTO(inode)->op args |
| 1114 | |
| 1115 | /* |
| 1116 | * Function vectors etc. for the NFS client |
| 1117 | */ |
David Howells | 509de81 | 2006-08-22 20:06:11 -0400 | [diff] [blame] | 1118 | extern const struct nfs_rpc_ops nfs_v2_clientops; |
| 1119 | extern const struct nfs_rpc_ops nfs_v3_clientops; |
| 1120 | extern const struct nfs_rpc_ops nfs_v4_clientops; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1121 | extern struct rpc_version nfs_version2; |
| 1122 | extern struct rpc_version nfs_version3; |
| 1123 | extern struct rpc_version nfs_version4; |
| 1124 | |
Andreas Gruenbacher | b7fa055 | 2005-06-22 17:16:27 +0000 | [diff] [blame] | 1125 | extern struct rpc_version nfsacl_version3; |
| 1126 | extern struct rpc_program nfsacl_program; |
| 1127 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1128 | #endif |