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