Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame^] | 1 | /* |
| 2 | * linux/include/linux/nfsd/xdr3.h |
| 3 | * |
| 4 | * XDR types for NFSv3 in nfsd. |
| 5 | * |
| 6 | * Copyright (C) 1996-1998, Olaf Kirch <okir@monad.swb.de> |
| 7 | */ |
| 8 | |
| 9 | #ifndef _LINUX_NFSD_XDR3_H |
| 10 | #define _LINUX_NFSD_XDR3_H |
| 11 | |
| 12 | #include <linux/nfsd/xdr.h> |
| 13 | |
| 14 | struct nfsd3_sattrargs { |
| 15 | struct svc_fh fh; |
| 16 | struct iattr attrs; |
| 17 | int check_guard; |
| 18 | time_t guardtime; |
| 19 | }; |
| 20 | |
| 21 | struct nfsd3_diropargs { |
| 22 | struct svc_fh fh; |
| 23 | char * name; |
| 24 | int len; |
| 25 | }; |
| 26 | |
| 27 | struct nfsd3_accessargs { |
| 28 | struct svc_fh fh; |
| 29 | unsigned int access; |
| 30 | }; |
| 31 | |
| 32 | struct nfsd3_readargs { |
| 33 | struct svc_fh fh; |
| 34 | __u64 offset; |
| 35 | __u32 count; |
| 36 | struct kvec vec[RPCSVC_MAXPAGES]; |
| 37 | int vlen; |
| 38 | }; |
| 39 | |
| 40 | struct nfsd3_writeargs { |
| 41 | svc_fh fh; |
| 42 | __u64 offset; |
| 43 | __u32 count; |
| 44 | int stable; |
| 45 | int len; |
| 46 | struct kvec vec[RPCSVC_MAXPAGES]; |
| 47 | int vlen; |
| 48 | }; |
| 49 | |
| 50 | struct nfsd3_createargs { |
| 51 | struct svc_fh fh; |
| 52 | char * name; |
| 53 | int len; |
| 54 | int createmode; |
| 55 | struct iattr attrs; |
| 56 | __u32 * verf; |
| 57 | }; |
| 58 | |
| 59 | struct nfsd3_mknodargs { |
| 60 | struct svc_fh fh; |
| 61 | char * name; |
| 62 | int len; |
| 63 | __u32 ftype; |
| 64 | __u32 major, minor; |
| 65 | struct iattr attrs; |
| 66 | }; |
| 67 | |
| 68 | struct nfsd3_renameargs { |
| 69 | struct svc_fh ffh; |
| 70 | char * fname; |
| 71 | int flen; |
| 72 | struct svc_fh tfh; |
| 73 | char * tname; |
| 74 | int tlen; |
| 75 | }; |
| 76 | |
| 77 | struct nfsd3_readlinkargs { |
| 78 | struct svc_fh fh; |
| 79 | char * buffer; |
| 80 | }; |
| 81 | |
| 82 | struct nfsd3_linkargs { |
| 83 | struct svc_fh ffh; |
| 84 | struct svc_fh tfh; |
| 85 | char * tname; |
| 86 | int tlen; |
| 87 | }; |
| 88 | |
| 89 | struct nfsd3_symlinkargs { |
| 90 | struct svc_fh ffh; |
| 91 | char * fname; |
| 92 | int flen; |
| 93 | char * tname; |
| 94 | int tlen; |
| 95 | struct iattr attrs; |
| 96 | }; |
| 97 | |
| 98 | struct nfsd3_readdirargs { |
| 99 | struct svc_fh fh; |
| 100 | __u64 cookie; |
| 101 | __u32 dircount; |
| 102 | __u32 count; |
| 103 | __u32 * verf; |
| 104 | u32 * buffer; |
| 105 | }; |
| 106 | |
| 107 | struct nfsd3_commitargs { |
| 108 | struct svc_fh fh; |
| 109 | __u64 offset; |
| 110 | __u32 count; |
| 111 | }; |
| 112 | |
| 113 | struct nfsd3_attrstat { |
| 114 | __u32 status; |
| 115 | struct svc_fh fh; |
| 116 | }; |
| 117 | |
| 118 | /* LOOKUP, CREATE, MKDIR, SYMLINK, MKNOD */ |
| 119 | struct nfsd3_diropres { |
| 120 | __u32 status; |
| 121 | struct svc_fh dirfh; |
| 122 | struct svc_fh fh; |
| 123 | }; |
| 124 | |
| 125 | struct nfsd3_accessres { |
| 126 | __u32 status; |
| 127 | struct svc_fh fh; |
| 128 | __u32 access; |
| 129 | }; |
| 130 | |
| 131 | struct nfsd3_readlinkres { |
| 132 | __u32 status; |
| 133 | struct svc_fh fh; |
| 134 | __u32 len; |
| 135 | }; |
| 136 | |
| 137 | struct nfsd3_readres { |
| 138 | __u32 status; |
| 139 | struct svc_fh fh; |
| 140 | unsigned long count; |
| 141 | int eof; |
| 142 | }; |
| 143 | |
| 144 | struct nfsd3_writeres { |
| 145 | __u32 status; |
| 146 | struct svc_fh fh; |
| 147 | unsigned long count; |
| 148 | int committed; |
| 149 | }; |
| 150 | |
| 151 | struct nfsd3_renameres { |
| 152 | __u32 status; |
| 153 | struct svc_fh ffh; |
| 154 | struct svc_fh tfh; |
| 155 | }; |
| 156 | |
| 157 | struct nfsd3_linkres { |
| 158 | __u32 status; |
| 159 | struct svc_fh tfh; |
| 160 | struct svc_fh fh; |
| 161 | }; |
| 162 | |
| 163 | struct nfsd3_readdirres { |
| 164 | __u32 status; |
| 165 | struct svc_fh fh; |
| 166 | int count; |
| 167 | __u32 verf[2]; |
| 168 | |
| 169 | struct readdir_cd common; |
| 170 | u32 * buffer; |
| 171 | int buflen; |
| 172 | u32 * offset; |
| 173 | u32 * offset1; |
| 174 | struct svc_rqst * rqstp; |
| 175 | |
| 176 | }; |
| 177 | |
| 178 | struct nfsd3_fsstatres { |
| 179 | __u32 status; |
| 180 | struct kstatfs stats; |
| 181 | __u32 invarsec; |
| 182 | }; |
| 183 | |
| 184 | struct nfsd3_fsinfores { |
| 185 | __u32 status; |
| 186 | __u32 f_rtmax; |
| 187 | __u32 f_rtpref; |
| 188 | __u32 f_rtmult; |
| 189 | __u32 f_wtmax; |
| 190 | __u32 f_wtpref; |
| 191 | __u32 f_wtmult; |
| 192 | __u32 f_dtpref; |
| 193 | __u64 f_maxfilesize; |
| 194 | __u32 f_properties; |
| 195 | }; |
| 196 | |
| 197 | struct nfsd3_pathconfres { |
| 198 | __u32 status; |
| 199 | __u32 p_link_max; |
| 200 | __u32 p_name_max; |
| 201 | __u32 p_no_trunc; |
| 202 | __u32 p_chown_restricted; |
| 203 | __u32 p_case_insensitive; |
| 204 | __u32 p_case_preserving; |
| 205 | }; |
| 206 | |
| 207 | struct nfsd3_commitres { |
| 208 | __u32 status; |
| 209 | struct svc_fh fh; |
| 210 | }; |
| 211 | |
| 212 | /* dummy type for release */ |
| 213 | struct nfsd3_fhandle_pair { |
| 214 | __u32 dummy; |
| 215 | struct svc_fh fh1; |
| 216 | struct svc_fh fh2; |
| 217 | }; |
| 218 | |
| 219 | /* |
| 220 | * Storage requirements for XDR arguments and results. |
| 221 | */ |
| 222 | union nfsd3_xdrstore { |
| 223 | struct nfsd3_sattrargs sattrargs; |
| 224 | struct nfsd3_diropargs diropargs; |
| 225 | struct nfsd3_readargs readargs; |
| 226 | struct nfsd3_writeargs writeargs; |
| 227 | struct nfsd3_createargs createargs; |
| 228 | struct nfsd3_renameargs renameargs; |
| 229 | struct nfsd3_linkargs linkargs; |
| 230 | struct nfsd3_symlinkargs symlinkargs; |
| 231 | struct nfsd3_readdirargs readdirargs; |
| 232 | struct nfsd3_diropres diropres; |
| 233 | struct nfsd3_accessres accessres; |
| 234 | struct nfsd3_readlinkres readlinkres; |
| 235 | struct nfsd3_readres readres; |
| 236 | struct nfsd3_writeres writeres; |
| 237 | struct nfsd3_renameres renameres; |
| 238 | struct nfsd3_linkres linkres; |
| 239 | struct nfsd3_readdirres readdirres; |
| 240 | struct nfsd3_fsstatres fsstatres; |
| 241 | struct nfsd3_fsinfores fsinfores; |
| 242 | struct nfsd3_pathconfres pathconfres; |
| 243 | struct nfsd3_commitres commitres; |
| 244 | }; |
| 245 | |
| 246 | #define NFS3_SVC_XDRSIZE sizeof(union nfsd3_xdrstore) |
| 247 | |
| 248 | int nfs3svc_decode_fhandle(struct svc_rqst *, u32 *, struct nfsd_fhandle *); |
| 249 | int nfs3svc_decode_sattrargs(struct svc_rqst *, u32 *, |
| 250 | struct nfsd3_sattrargs *); |
| 251 | int nfs3svc_decode_diropargs(struct svc_rqst *, u32 *, |
| 252 | struct nfsd3_diropargs *); |
| 253 | int nfs3svc_decode_accessargs(struct svc_rqst *, u32 *, |
| 254 | struct nfsd3_accessargs *); |
| 255 | int nfs3svc_decode_readargs(struct svc_rqst *, u32 *, |
| 256 | struct nfsd3_readargs *); |
| 257 | int nfs3svc_decode_writeargs(struct svc_rqst *, u32 *, |
| 258 | struct nfsd3_writeargs *); |
| 259 | int nfs3svc_decode_createargs(struct svc_rqst *, u32 *, |
| 260 | struct nfsd3_createargs *); |
| 261 | int nfs3svc_decode_mkdirargs(struct svc_rqst *, u32 *, |
| 262 | struct nfsd3_createargs *); |
| 263 | int nfs3svc_decode_mknodargs(struct svc_rqst *, u32 *, |
| 264 | struct nfsd3_mknodargs *); |
| 265 | int nfs3svc_decode_renameargs(struct svc_rqst *, u32 *, |
| 266 | struct nfsd3_renameargs *); |
| 267 | int nfs3svc_decode_readlinkargs(struct svc_rqst *, u32 *, |
| 268 | struct nfsd3_readlinkargs *); |
| 269 | int nfs3svc_decode_linkargs(struct svc_rqst *, u32 *, |
| 270 | struct nfsd3_linkargs *); |
| 271 | int nfs3svc_decode_symlinkargs(struct svc_rqst *, u32 *, |
| 272 | struct nfsd3_symlinkargs *); |
| 273 | int nfs3svc_decode_readdirargs(struct svc_rqst *, u32 *, |
| 274 | struct nfsd3_readdirargs *); |
| 275 | int nfs3svc_decode_readdirplusargs(struct svc_rqst *, u32 *, |
| 276 | struct nfsd3_readdirargs *); |
| 277 | int nfs3svc_decode_commitargs(struct svc_rqst *, u32 *, |
| 278 | struct nfsd3_commitargs *); |
| 279 | int nfs3svc_encode_voidres(struct svc_rqst *, u32 *, void *); |
| 280 | int nfs3svc_encode_attrstat(struct svc_rqst *, u32 *, |
| 281 | struct nfsd3_attrstat *); |
| 282 | int nfs3svc_encode_wccstat(struct svc_rqst *, u32 *, |
| 283 | struct nfsd3_attrstat *); |
| 284 | int nfs3svc_encode_diropres(struct svc_rqst *, u32 *, |
| 285 | struct nfsd3_diropres *); |
| 286 | int nfs3svc_encode_accessres(struct svc_rqst *, u32 *, |
| 287 | struct nfsd3_accessres *); |
| 288 | int nfs3svc_encode_readlinkres(struct svc_rqst *, u32 *, |
| 289 | struct nfsd3_readlinkres *); |
| 290 | int nfs3svc_encode_readres(struct svc_rqst *, u32 *, struct nfsd3_readres *); |
| 291 | int nfs3svc_encode_writeres(struct svc_rqst *, u32 *, struct nfsd3_writeres *); |
| 292 | int nfs3svc_encode_createres(struct svc_rqst *, u32 *, |
| 293 | struct nfsd3_diropres *); |
| 294 | int nfs3svc_encode_renameres(struct svc_rqst *, u32 *, |
| 295 | struct nfsd3_renameres *); |
| 296 | int nfs3svc_encode_linkres(struct svc_rqst *, u32 *, |
| 297 | struct nfsd3_linkres *); |
| 298 | int nfs3svc_encode_readdirres(struct svc_rqst *, u32 *, |
| 299 | struct nfsd3_readdirres *); |
| 300 | int nfs3svc_encode_fsstatres(struct svc_rqst *, u32 *, |
| 301 | struct nfsd3_fsstatres *); |
| 302 | int nfs3svc_encode_fsinfores(struct svc_rqst *, u32 *, |
| 303 | struct nfsd3_fsinfores *); |
| 304 | int nfs3svc_encode_pathconfres(struct svc_rqst *, u32 *, |
| 305 | struct nfsd3_pathconfres *); |
| 306 | int nfs3svc_encode_commitres(struct svc_rqst *, u32 *, |
| 307 | struct nfsd3_commitres *); |
| 308 | |
| 309 | int nfs3svc_release_fhandle(struct svc_rqst *, u32 *, |
| 310 | struct nfsd3_attrstat *); |
| 311 | int nfs3svc_release_fhandle2(struct svc_rqst *, u32 *, |
| 312 | struct nfsd3_fhandle_pair *); |
| 313 | int nfs3svc_encode_entry(struct readdir_cd *, const char *name, |
| 314 | int namlen, loff_t offset, ino_t ino, |
| 315 | unsigned int); |
| 316 | int nfs3svc_encode_entry_plus(struct readdir_cd *, const char *name, |
| 317 | int namlen, loff_t offset, ino_t ino, |
| 318 | unsigned int); |
| 319 | |
| 320 | |
| 321 | #endif /* _LINUX_NFSD_XDR3_H */ |