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