blob: 045c9081eabeb0242a0f60d49ec9177dc9c0c6f4 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
Linus Torvalds1da177e2005-04-16 15:20:36 -07002 * Process version 3 NFS requests.
3 *
4 * Copyright (C) 1996, 1997, 1998 Olaf Kirch <okir@monad.swb.de>
5 */
6
Linus Torvalds1da177e2005-04-16 15:20:36 -07007#include <linux/fs.h>
8#include <linux/ext2_fs.h>
Qinghuang Feng12214cb2009-01-12 03:13:53 +08009#include <linux/magic.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070010
Boaz Harrosh9a74af22009-12-03 20:30:56 +020011#include "cache.h"
12#include "xdr3.h"
J. Bruce Fields0a3adad2009-11-04 18:12:35 -050013#include "vfs.h"
Linus Torvalds1da177e2005-04-16 15:20:36 -070014
15#define NFSDDBG_FACILITY NFSDDBG_PROC
16
17#define RETURN_STATUS(st) { resp->status = (st); return (st); }
18
19static int nfs3_ftypes[] = {
20 0, /* NF3NON */
21 S_IFREG, /* NF3REG */
22 S_IFDIR, /* NF3DIR */
23 S_IFBLK, /* NF3BLK */
24 S_IFCHR, /* NF3CHR */
25 S_IFLNK, /* NF3LNK */
26 S_IFSOCK, /* NF3SOCK */
27 S_IFIFO, /* NF3FIFO */
28};
29
30/*
31 * NULL call.
32 */
Al Viro7111c662006-10-19 23:28:45 -070033static __be32
Linus Torvalds1da177e2005-04-16 15:20:36 -070034nfsd3_proc_null(struct svc_rqst *rqstp, void *argp, void *resp)
35{
36 return nfs_ok;
37}
38
39/*
40 * Get a file's attributes
41 */
Al Viro7111c662006-10-19 23:28:45 -070042static __be32
Linus Torvalds1da177e2005-04-16 15:20:36 -070043nfsd3_proc_getattr(struct svc_rqst *rqstp, struct nfsd_fhandle *argp,
44 struct nfsd3_attrstat *resp)
45{
Al Viroc4d987b2006-10-19 23:29:00 -070046 __be32 nfserr;
Linus Torvalds1da177e2005-04-16 15:20:36 -070047
48 dprintk("nfsd: GETATTR(3) %s\n",
David Shawa334de22006-01-06 00:19:58 -080049 SVCFH_fmt(&argp->fh));
Linus Torvalds1da177e2005-04-16 15:20:36 -070050
51 fh_copy(&resp->fh, &argp->fh);
J. Bruce Fields04716e62008-08-07 13:00:20 -040052 nfserr = fh_verify(rqstp, &resp->fh, 0,
53 NFSD_MAY_NOP | NFSD_MAY_BYPASS_GSS_ON_ROOT);
David Shawa334de22006-01-06 00:19:58 -080054 if (nfserr)
55 RETURN_STATUS(nfserr);
56
Al Viro3dadecc2013-01-24 02:18:08 -050057 nfserr = fh_getattr(&resp->fh, &resp->stat);
David Shawa334de22006-01-06 00:19:58 -080058
Linus Torvalds1da177e2005-04-16 15:20:36 -070059 RETURN_STATUS(nfserr);
60}
61
62/*
63 * Set a file's attributes
64 */
Al Viro7111c662006-10-19 23:28:45 -070065static __be32
Linus Torvalds1da177e2005-04-16 15:20:36 -070066nfsd3_proc_setattr(struct svc_rqst *rqstp, struct nfsd3_sattrargs *argp,
67 struct nfsd3_attrstat *resp)
68{
Al Viroc4d987b2006-10-19 23:29:00 -070069 __be32 nfserr;
Linus Torvalds1da177e2005-04-16 15:20:36 -070070
71 dprintk("nfsd: SETATTR(3) %s\n",
72 SVCFH_fmt(&argp->fh));
73
74 fh_copy(&resp->fh, &argp->fh);
75 nfserr = nfsd_setattr(rqstp, &resp->fh, &argp->attrs,
76 argp->check_guard, argp->guardtime);
77 RETURN_STATUS(nfserr);
78}
79
80/*
81 * Look up a path name component
82 */
Al Viro7111c662006-10-19 23:28:45 -070083static __be32
Linus Torvalds1da177e2005-04-16 15:20:36 -070084nfsd3_proc_lookup(struct svc_rqst *rqstp, struct nfsd3_diropargs *argp,
85 struct nfsd3_diropres *resp)
86{
Al Viroc4d987b2006-10-19 23:29:00 -070087 __be32 nfserr;
Linus Torvalds1da177e2005-04-16 15:20:36 -070088
89 dprintk("nfsd: LOOKUP(3) %s %.*s\n",
90 SVCFH_fmt(&argp->fh),
91 argp->len,
92 argp->name);
93
94 fh_copy(&resp->dirfh, &argp->fh);
95 fh_init(&resp->fh, NFS3_FHSIZE);
96
97 nfserr = nfsd_lookup(rqstp, &resp->dirfh,
98 argp->name,
99 argp->len,
100 &resp->fh);
101 RETURN_STATUS(nfserr);
102}
103
104/*
105 * Check file access
106 */
Al Viro7111c662006-10-19 23:28:45 -0700107static __be32
Linus Torvalds1da177e2005-04-16 15:20:36 -0700108nfsd3_proc_access(struct svc_rqst *rqstp, struct nfsd3_accessargs *argp,
109 struct nfsd3_accessres *resp)
110{
Al Viroc4d987b2006-10-19 23:29:00 -0700111 __be32 nfserr;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700112
113 dprintk("nfsd: ACCESS(3) %s 0x%x\n",
114 SVCFH_fmt(&argp->fh),
115 argp->access);
116
117 fh_copy(&resp->fh, &argp->fh);
118 resp->access = argp->access;
119 nfserr = nfsd_access(rqstp, &resp->fh, &resp->access, NULL);
120 RETURN_STATUS(nfserr);
121}
122
123/*
124 * Read a symlink.
125 */
Al Viro7111c662006-10-19 23:28:45 -0700126static __be32
Linus Torvalds1da177e2005-04-16 15:20:36 -0700127nfsd3_proc_readlink(struct svc_rqst *rqstp, struct nfsd3_readlinkargs *argp,
128 struct nfsd3_readlinkres *resp)
129{
Al Viroc4d987b2006-10-19 23:29:00 -0700130 __be32 nfserr;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700131
132 dprintk("nfsd: READLINK(3) %s\n", SVCFH_fmt(&argp->fh));
133
134 /* Read the symlink. */
135 fh_copy(&resp->fh, &argp->fh);
136 resp->len = NFS3_MAXPATHLEN;
137 nfserr = nfsd_readlink(rqstp, &resp->fh, argp->buffer, &resp->len);
138 RETURN_STATUS(nfserr);
139}
140
141/*
142 * Read a portion of a file.
143 */
Al Viro7111c662006-10-19 23:28:45 -0700144static __be32
Linus Torvalds1da177e2005-04-16 15:20:36 -0700145nfsd3_proc_read(struct svc_rqst *rqstp, struct nfsd3_readargs *argp,
146 struct nfsd3_readres *resp)
147{
Al Viroc4d987b2006-10-19 23:29:00 -0700148 __be32 nfserr;
Greg Banks7adae482006-10-04 02:15:47 -0700149 u32 max_blocksize = svc_max_payload(rqstp);
Benjamin Coddingtonac503e42016-03-22 10:28:36 -0400150 unsigned long cnt = min(argp->count, max_blocksize);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700151
J. Bruce Fields18b631f2010-11-29 15:28:10 -0500152 dprintk("nfsd: READ(3) %s %lu bytes at %Lu\n",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700153 SVCFH_fmt(&argp->fh),
154 (unsigned long) argp->count,
J. Bruce Fields18b631f2010-11-29 15:28:10 -0500155 (unsigned long long) argp->offset);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700156
157 /* Obtain buffer pointer for payload.
158 * 1 (status) + 22 (post_op_attr) + 1 (count) + 1 (eof)
159 * + 1 (xdr opaque byte count) = 26
160 */
Benjamin Coddingtonac503e42016-03-22 10:28:36 -0400161 resp->count = cnt;
Jeff Laytoncd123012007-05-09 02:34:50 -0700162 svc_reserve_auth(rqstp, ((1 + NFS3_POST_OP_ATTR_WORDS + 3)<<2) + resp->count +4);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700163
164 fh_copy(&resp->fh, &argp->fh);
J. Bruce Fields039a87c2010-07-30 11:33:32 -0400165 nfserr = nfsd_read(rqstp, &resp->fh,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700166 argp->offset,
NeilBrown3cc03b12006-10-04 02:15:47 -0700167 rqstp->rq_vec, argp->vlen,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700168 &resp->count);
169 if (nfserr == 0) {
David Howells2b0143b2015-03-17 22:25:59 +0000170 struct inode *inode = d_inode(resp->fh.fh_dentry);
Benjamin Coddingtonac503e42016-03-22 10:28:36 -0400171 resp->eof = nfsd_eof_on_read(cnt, resp->count, argp->offset,
172 inode->i_size);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700173 }
174
175 RETURN_STATUS(nfserr);
176}
177
178/*
179 * Write data to a file
180 */
Al Viro7111c662006-10-19 23:28:45 -0700181static __be32
Linus Torvalds1da177e2005-04-16 15:20:36 -0700182nfsd3_proc_write(struct svc_rqst *rqstp, struct nfsd3_writeargs *argp,
183 struct nfsd3_writeres *resp)
184{
Al Viroc4d987b2006-10-19 23:29:00 -0700185 __be32 nfserr;
David Shaw31dec252009-03-05 20:16:14 -0500186 unsigned long cnt = argp->len;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700187
J. Bruce Fields18b631f2010-11-29 15:28:10 -0500188 dprintk("nfsd: WRITE(3) %s %d bytes at %Lu%s\n",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700189 SVCFH_fmt(&argp->fh),
190 argp->len,
J. Bruce Fields18b631f2010-11-29 15:28:10 -0500191 (unsigned long long) argp->offset,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700192 argp->stable? " stable" : "");
193
194 fh_copy(&resp->fh, &argp->fh);
195 resp->committed = argp->stable;
Kinglong Mee52e380e2016-12-31 21:00:13 +0800196 nfserr = nfsd_write(rqstp, &resp->fh, argp->offset,
197 rqstp->rq_vec, argp->vlen,
198 &cnt, resp->committed);
David Shaw31dec252009-03-05 20:16:14 -0500199 resp->count = cnt;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700200 RETURN_STATUS(nfserr);
201}
202
203/*
204 * With NFSv3, CREATE processing is a lot easier than with NFSv2.
205 * At least in theory; we'll see how it fares in practice when the
206 * first reports about SunOS compatibility problems start to pour in...
207 */
Al Viro7111c662006-10-19 23:28:45 -0700208static __be32
Linus Torvalds1da177e2005-04-16 15:20:36 -0700209nfsd3_proc_create(struct svc_rqst *rqstp, struct nfsd3_createargs *argp,
210 struct nfsd3_diropres *resp)
211{
212 svc_fh *dirfhp, *newfhp = NULL;
213 struct iattr *attr;
Al Viroc4d987b2006-10-19 23:29:00 -0700214 __be32 nfserr;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700215
216 dprintk("nfsd: CREATE(3) %s %.*s\n",
217 SVCFH_fmt(&argp->fh),
218 argp->len,
219 argp->name);
220
221 dirfhp = fh_copy(&resp->dirfh, &argp->fh);
222 newfhp = fh_init(&resp->fh, NFS3_FHSIZE);
223 attr = &argp->attrs;
224
Linus Torvalds1da177e2005-04-16 15:20:36 -0700225 /* Unfudge the mode bits */
226 attr->ia_mode &= ~S_IFMT;
227 if (!(attr->ia_valid & ATTR_MODE)) {
228 attr->ia_valid |= ATTR_MODE;
229 attr->ia_mode = S_IFREG;
230 } else {
231 attr->ia_mode = (attr->ia_mode & ~S_IFMT) | S_IFREG;
232 }
233
234 /* Now create the file and set attributes */
Mi Jinlongac6721a2011-04-20 17:06:25 +0800235 nfserr = do_nfsd_create(rqstp, dirfhp, argp->name, argp->len,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700236 attr, newfhp,
J. Bruce Fields95c7a202012-07-27 15:50:11 -0400237 argp->createmode, (u32 *)argp->verf, NULL, NULL);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700238
239 RETURN_STATUS(nfserr);
240}
241
242/*
243 * Make directory. This operation is not idempotent.
244 */
Al Viro7111c662006-10-19 23:28:45 -0700245static __be32
Linus Torvalds1da177e2005-04-16 15:20:36 -0700246nfsd3_proc_mkdir(struct svc_rqst *rqstp, struct nfsd3_createargs *argp,
247 struct nfsd3_diropres *resp)
248{
Al Viroc4d987b2006-10-19 23:29:00 -0700249 __be32 nfserr;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700250
251 dprintk("nfsd: MKDIR(3) %s %.*s\n",
252 SVCFH_fmt(&argp->fh),
253 argp->len,
254 argp->name);
255
256 argp->attrs.ia_valid &= ~ATTR_SIZE;
257 fh_copy(&resp->dirfh, &argp->fh);
258 fh_init(&resp->fh, NFS3_FHSIZE);
259 nfserr = nfsd_create(rqstp, &resp->dirfh, argp->name, argp->len,
260 &argp->attrs, S_IFDIR, 0, &resp->fh);
Chuck Lever43a9aa62010-07-06 16:53:34 -0400261 fh_unlock(&resp->dirfh);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700262 RETURN_STATUS(nfserr);
263}
264
Al Viro7111c662006-10-19 23:28:45 -0700265static __be32
Linus Torvalds1da177e2005-04-16 15:20:36 -0700266nfsd3_proc_symlink(struct svc_rqst *rqstp, struct nfsd3_symlinkargs *argp,
267 struct nfsd3_diropres *resp)
268{
Al Viroc4d987b2006-10-19 23:29:00 -0700269 __be32 nfserr;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700270
271 dprintk("nfsd: SYMLINK(3) %s %.*s -> %.*s\n",
272 SVCFH_fmt(&argp->ffh),
273 argp->flen, argp->fname,
274 argp->tlen, argp->tname);
275
276 fh_copy(&resp->dirfh, &argp->ffh);
277 fh_init(&resp->fh, NFS3_FHSIZE);
278 nfserr = nfsd_symlink(rqstp, &resp->dirfh, argp->fname, argp->flen,
Kinglong Mee1e444f52014-07-01 17:48:02 +0800279 argp->tname, &resp->fh);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700280 RETURN_STATUS(nfserr);
281}
282
283/*
284 * Make socket/fifo/device.
285 */
Al Viro7111c662006-10-19 23:28:45 -0700286static __be32
Linus Torvalds1da177e2005-04-16 15:20:36 -0700287nfsd3_proc_mknod(struct svc_rqst *rqstp, struct nfsd3_mknodargs *argp,
288 struct nfsd3_diropres *resp)
289{
Al Viroc4d987b2006-10-19 23:29:00 -0700290 __be32 nfserr;
291 int type;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700292 dev_t rdev = 0;
293
294 dprintk("nfsd: MKNOD(3) %s %.*s\n",
295 SVCFH_fmt(&argp->fh),
296 argp->len,
297 argp->name);
298
299 fh_copy(&resp->dirfh, &argp->fh);
300 fh_init(&resp->fh, NFS3_FHSIZE);
301
302 if (argp->ftype == 0 || argp->ftype >= NF3BAD)
303 RETURN_STATUS(nfserr_inval);
304 if (argp->ftype == NF3CHR || argp->ftype == NF3BLK) {
305 rdev = MKDEV(argp->major, argp->minor);
306 if (MAJOR(rdev) != argp->major ||
307 MINOR(rdev) != argp->minor)
308 RETURN_STATUS(nfserr_inval);
309 } else
310 if (argp->ftype != NF3SOCK && argp->ftype != NF3FIFO)
311 RETURN_STATUS(nfserr_inval);
312
313 type = nfs3_ftypes[argp->ftype];
314 nfserr = nfsd_create(rqstp, &resp->dirfh, argp->name, argp->len,
315 &argp->attrs, type, rdev, &resp->fh);
Chuck Lever43a9aa62010-07-06 16:53:34 -0400316 fh_unlock(&resp->dirfh);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700317 RETURN_STATUS(nfserr);
318}
319
320/*
321 * Remove file/fifo/socket etc.
322 */
Al Viro7111c662006-10-19 23:28:45 -0700323static __be32
Linus Torvalds1da177e2005-04-16 15:20:36 -0700324nfsd3_proc_remove(struct svc_rqst *rqstp, struct nfsd3_diropargs *argp,
325 struct nfsd3_attrstat *resp)
326{
Al Viroc4d987b2006-10-19 23:29:00 -0700327 __be32 nfserr;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700328
329 dprintk("nfsd: REMOVE(3) %s %.*s\n",
330 SVCFH_fmt(&argp->fh),
331 argp->len,
332 argp->name);
333
334 /* Unlink. -S_IFDIR means file must not be a directory */
335 fh_copy(&resp->fh, &argp->fh);
336 nfserr = nfsd_unlink(rqstp, &resp->fh, -S_IFDIR, argp->name, argp->len);
Chuck Lever43a9aa62010-07-06 16:53:34 -0400337 fh_unlock(&resp->fh);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700338 RETURN_STATUS(nfserr);
339}
340
341/*
342 * Remove a directory
343 */
Al Viro7111c662006-10-19 23:28:45 -0700344static __be32
Linus Torvalds1da177e2005-04-16 15:20:36 -0700345nfsd3_proc_rmdir(struct svc_rqst *rqstp, struct nfsd3_diropargs *argp,
346 struct nfsd3_attrstat *resp)
347{
Al Viroc4d987b2006-10-19 23:29:00 -0700348 __be32 nfserr;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700349
350 dprintk("nfsd: RMDIR(3) %s %.*s\n",
351 SVCFH_fmt(&argp->fh),
352 argp->len,
353 argp->name);
354
355 fh_copy(&resp->fh, &argp->fh);
356 nfserr = nfsd_unlink(rqstp, &resp->fh, S_IFDIR, argp->name, argp->len);
Chuck Lever43a9aa62010-07-06 16:53:34 -0400357 fh_unlock(&resp->fh);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700358 RETURN_STATUS(nfserr);
359}
360
Al Viro7111c662006-10-19 23:28:45 -0700361static __be32
Linus Torvalds1da177e2005-04-16 15:20:36 -0700362nfsd3_proc_rename(struct svc_rqst *rqstp, struct nfsd3_renameargs *argp,
363 struct nfsd3_renameres *resp)
364{
Al Viroc4d987b2006-10-19 23:29:00 -0700365 __be32 nfserr;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700366
367 dprintk("nfsd: RENAME(3) %s %.*s ->\n",
368 SVCFH_fmt(&argp->ffh),
369 argp->flen,
370 argp->fname);
371 dprintk("nfsd: -> %s %.*s\n",
372 SVCFH_fmt(&argp->tfh),
373 argp->tlen,
374 argp->tname);
375
376 fh_copy(&resp->ffh, &argp->ffh);
377 fh_copy(&resp->tfh, &argp->tfh);
378 nfserr = nfsd_rename(rqstp, &resp->ffh, argp->fname, argp->flen,
379 &resp->tfh, argp->tname, argp->tlen);
380 RETURN_STATUS(nfserr);
381}
382
Al Viro7111c662006-10-19 23:28:45 -0700383static __be32
Linus Torvalds1da177e2005-04-16 15:20:36 -0700384nfsd3_proc_link(struct svc_rqst *rqstp, struct nfsd3_linkargs *argp,
385 struct nfsd3_linkres *resp)
386{
Al Viroc4d987b2006-10-19 23:29:00 -0700387 __be32 nfserr;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700388
389 dprintk("nfsd: LINK(3) %s ->\n",
390 SVCFH_fmt(&argp->ffh));
391 dprintk("nfsd: -> %s %.*s\n",
392 SVCFH_fmt(&argp->tfh),
393 argp->tlen,
394 argp->tname);
395
396 fh_copy(&resp->fh, &argp->ffh);
397 fh_copy(&resp->tfh, &argp->tfh);
398 nfserr = nfsd_link(rqstp, &resp->tfh, argp->tname, argp->tlen,
399 &resp->fh);
400 RETURN_STATUS(nfserr);
401}
402
403/*
404 * Read a portion of a directory.
405 */
Al Viro7111c662006-10-19 23:28:45 -0700406static __be32
Linus Torvalds1da177e2005-04-16 15:20:36 -0700407nfsd3_proc_readdir(struct svc_rqst *rqstp, struct nfsd3_readdirargs *argp,
408 struct nfsd3_readdirres *resp)
409{
Al Viroc4d987b2006-10-19 23:29:00 -0700410 __be32 nfserr;
411 int count;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700412
413 dprintk("nfsd: READDIR(3) %s %d bytes at %d\n",
414 SVCFH_fmt(&argp->fh),
415 argp->count, (u32) argp->cookie);
416
417 /* Make sure we've room for the NULL ptr & eof flag, and shrink to
418 * client read size */
419 count = (argp->count >> 2) - 2;
420
421 /* Read directory and encode entries on the fly */
422 fh_copy(&resp->fh, &argp->fh);
423
424 resp->buflen = count;
425 resp->common.err = nfs_ok;
426 resp->buffer = argp->buffer;
427 resp->rqstp = rqstp;
428 nfserr = nfsd_readdir(rqstp, &resp->fh, (loff_t*) &argp->cookie,
429 &resp->common, nfs3svc_encode_entry);
430 memcpy(resp->verf, argp->verf, 8);
431 resp->count = resp->buffer - argp->buffer;
432 if (resp->offset)
433 xdr_encode_hyper(resp->offset, argp->cookie);
434
435 RETURN_STATUS(nfserr);
436}
437
438/*
439 * Read a portion of a directory, including file handles and attrs.
440 * For now, we choose to ignore the dircount parameter.
441 */
Al Viro7111c662006-10-19 23:28:45 -0700442static __be32
Linus Torvalds1da177e2005-04-16 15:20:36 -0700443nfsd3_proc_readdirplus(struct svc_rqst *rqstp, struct nfsd3_readdirargs *argp,
444 struct nfsd3_readdirres *resp)
445{
Al Viroc4d987b2006-10-19 23:29:00 -0700446 __be32 nfserr;
447 int count = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700448 loff_t offset;
J. Bruce Fieldsafc59402012-12-10 18:01:37 -0500449 struct page **p;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700450 caddr_t page_addr = NULL;
451
452 dprintk("nfsd: READDIR+(3) %s %d bytes at %d\n",
453 SVCFH_fmt(&argp->fh),
454 argp->count, (u32) argp->cookie);
455
456 /* Convert byte count to number of words (i.e. >> 2),
457 * and reserve room for the NULL ptr & eof flag (-2 words) */
458 resp->count = (argp->count >> 2) - 2;
459
460 /* Read directory and encode entries on the fly */
461 fh_copy(&resp->fh, &argp->fh);
462
463 resp->common.err = nfs_ok;
464 resp->buffer = argp->buffer;
465 resp->buflen = resp->count;
466 resp->rqstp = rqstp;
467 offset = argp->cookie;
Rajesh Ghanekar18c01ab2014-08-01 22:17:30 -0400468
469 nfserr = fh_verify(rqstp, &resp->fh, S_IFDIR, NFSD_MAY_NOP);
470 if (nfserr)
471 RETURN_STATUS(nfserr);
472
473 if (resp->fh.fh_export->ex_flags & NFSEXP_NOREADDIRPLUS)
474 RETURN_STATUS(nfserr_notsupp);
475
Linus Torvalds1da177e2005-04-16 15:20:36 -0700476 nfserr = nfsd_readdir(rqstp, &resp->fh,
477 &offset,
478 &resp->common,
479 nfs3svc_encode_entry_plus);
480 memcpy(resp->verf, argp->verf, 8);
J. Bruce Fieldsafc59402012-12-10 18:01:37 -0500481 for (p = rqstp->rq_respages + 1; p < rqstp->rq_next_page; p++) {
482 page_addr = page_address(*p);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700483
484 if (((caddr_t)resp->buffer >= page_addr) &&
485 ((caddr_t)resp->buffer < page_addr + PAGE_SIZE)) {
486 count += (caddr_t)resp->buffer - page_addr;
487 break;
488 }
489 count += PAGE_SIZE;
490 }
491 resp->count = count >> 2;
492 if (resp->offset) {
493 if (unlikely(resp->offset1)) {
494 /* we ended up with offset on a page boundary */
495 *resp->offset = htonl(offset >> 32);
496 *resp->offset1 = htonl(offset & 0xffffffff);
497 resp->offset1 = NULL;
498 } else {
499 xdr_encode_hyper(resp->offset, offset);
500 }
501 }
502
503 RETURN_STATUS(nfserr);
504}
505
506/*
507 * Get file system stats
508 */
Al Viro7111c662006-10-19 23:28:45 -0700509static __be32
Linus Torvalds1da177e2005-04-16 15:20:36 -0700510nfsd3_proc_fsstat(struct svc_rqst * rqstp, struct nfsd_fhandle *argp,
511 struct nfsd3_fsstatres *resp)
512{
Al Viroc4d987b2006-10-19 23:29:00 -0700513 __be32 nfserr;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700514
515 dprintk("nfsd: FSSTAT(3) %s\n",
516 SVCFH_fmt(&argp->fh));
517
J. Bruce Fields04716e62008-08-07 13:00:20 -0400518 nfserr = nfsd_statfs(rqstp, &argp->fh, &resp->stats, 0);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700519 fh_put(&argp->fh);
520 RETURN_STATUS(nfserr);
521}
522
523/*
524 * Get file system info
525 */
Al Viro7111c662006-10-19 23:28:45 -0700526static __be32
Linus Torvalds1da177e2005-04-16 15:20:36 -0700527nfsd3_proc_fsinfo(struct svc_rqst * rqstp, struct nfsd_fhandle *argp,
528 struct nfsd3_fsinfores *resp)
529{
Al Viroc4d987b2006-10-19 23:29:00 -0700530 __be32 nfserr;
Greg Banks7adae482006-10-04 02:15:47 -0700531 u32 max_blocksize = svc_max_payload(rqstp);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700532
533 dprintk("nfsd: FSINFO(3) %s\n",
534 SVCFH_fmt(&argp->fh));
535
Greg Banks7adae482006-10-04 02:15:47 -0700536 resp->f_rtmax = max_blocksize;
537 resp->f_rtpref = max_blocksize;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700538 resp->f_rtmult = PAGE_SIZE;
Greg Banks7adae482006-10-04 02:15:47 -0700539 resp->f_wtmax = max_blocksize;
540 resp->f_wtpref = max_blocksize;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700541 resp->f_wtmult = PAGE_SIZE;
542 resp->f_dtpref = PAGE_SIZE;
543 resp->f_maxfilesize = ~(u32) 0;
544 resp->f_properties = NFS3_FSF_DEFAULT;
545
J. Bruce Fields04716e62008-08-07 13:00:20 -0400546 nfserr = fh_verify(rqstp, &argp->fh, 0,
547 NFSD_MAY_NOP | NFSD_MAY_BYPASS_GSS_ON_ROOT);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700548
549 /* Check special features of the file system. May request
550 * different read/write sizes for file systems known to have
551 * problems with large blocks */
552 if (nfserr == 0) {
Al Virofc640052016-04-10 01:33:30 -0400553 struct super_block *sb = argp->fh.fh_dentry->d_sb;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700554
555 /* Note that we don't care for remote fs's here */
Qinghuang Feng12214cb2009-01-12 03:13:53 +0800556 if (sb->s_magic == MSDOS_SUPER_MAGIC) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700557 resp->f_properties = NFS3_FSF_BILLYBOY;
558 }
559 resp->f_maxfilesize = sb->s_maxbytes;
560 }
561
562 fh_put(&argp->fh);
563 RETURN_STATUS(nfserr);
564}
565
566/*
567 * Get pathconf info for the specified file
568 */
Al Viro7111c662006-10-19 23:28:45 -0700569static __be32
Linus Torvalds1da177e2005-04-16 15:20:36 -0700570nfsd3_proc_pathconf(struct svc_rqst * rqstp, struct nfsd_fhandle *argp,
571 struct nfsd3_pathconfres *resp)
572{
Al Viroc4d987b2006-10-19 23:29:00 -0700573 __be32 nfserr;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700574
575 dprintk("nfsd: PATHCONF(3) %s\n",
576 SVCFH_fmt(&argp->fh));
577
578 /* Set default pathconf */
579 resp->p_link_max = 255; /* at least */
580 resp->p_name_max = 255; /* at least */
581 resp->p_no_trunc = 0;
582 resp->p_chown_restricted = 1;
583 resp->p_case_insensitive = 0;
584 resp->p_case_preserving = 1;
585
Miklos Szeredi8837abc2008-06-16 13:20:29 +0200586 nfserr = fh_verify(rqstp, &argp->fh, 0, NFSD_MAY_NOP);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700587
588 if (nfserr == 0) {
Al Virofc640052016-04-10 01:33:30 -0400589 struct super_block *sb = argp->fh.fh_dentry->d_sb;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700590
591 /* Note that we don't care for remote fs's here */
592 switch (sb->s_magic) {
593 case EXT2_SUPER_MAGIC:
594 resp->p_link_max = EXT2_LINK_MAX;
595 resp->p_name_max = EXT2_NAME_LEN;
596 break;
Qinghuang Feng12214cb2009-01-12 03:13:53 +0800597 case MSDOS_SUPER_MAGIC:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700598 resp->p_case_insensitive = 1;
599 resp->p_case_preserving = 0;
600 break;
601 }
602 }
603
604 fh_put(&argp->fh);
605 RETURN_STATUS(nfserr);
606}
607
608
609/*
610 * Commit a file (range) to stable storage.
611 */
Al Viro7111c662006-10-19 23:28:45 -0700612static __be32
Linus Torvalds1da177e2005-04-16 15:20:36 -0700613nfsd3_proc_commit(struct svc_rqst * rqstp, struct nfsd3_commitargs *argp,
614 struct nfsd3_commitres *resp)
615{
Al Viroc4d987b2006-10-19 23:29:00 -0700616 __be32 nfserr;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700617
618 dprintk("nfsd: COMMIT(3) %s %u@%Lu\n",
619 SVCFH_fmt(&argp->fh),
620 argp->count,
621 (unsigned long long) argp->offset);
622
623 if (argp->offset > NFS_OFFSET_MAX)
624 RETURN_STATUS(nfserr_inval);
625
626 fh_copy(&resp->fh, &argp->fh);
627 nfserr = nfsd_commit(rqstp, &resp->fh, argp->offset, argp->count);
628
629 RETURN_STATUS(nfserr);
630}
631
632
633/*
634 * NFSv3 Server procedures.
635 * Only the results of non-idempotent operations are cached.
636 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700637#define nfs3svc_decode_fhandleargs nfs3svc_decode_fhandle
638#define nfs3svc_encode_attrstatres nfs3svc_encode_attrstat
639#define nfs3svc_encode_wccstatres nfs3svc_encode_wccstat
640#define nfsd3_mkdirargs nfsd3_createargs
641#define nfsd3_readdirplusargs nfsd3_readdirargs
642#define nfsd3_fhandleargs nfsd_fhandle
643#define nfsd3_fhandleres nfsd3_attrstat
644#define nfsd3_attrstatres nfsd3_attrstat
645#define nfsd3_wccstatres nfsd3_attrstat
646#define nfsd3_createres nfsd3_diropres
647#define nfsd3_voidres nfsd3_voidargs
648struct nfsd3_voidargs { int dummy; };
649
650#define PROC(name, argt, rest, relt, cache, respsize) \
651 { (svc_procfunc) nfsd3_proc_##name, \
652 (kxdrproc_t) nfs3svc_decode_##argt##args, \
653 (kxdrproc_t) nfs3svc_encode_##rest##res, \
654 (kxdrproc_t) nfs3svc_release_##relt, \
655 sizeof(struct nfsd3_##argt##args), \
656 sizeof(struct nfsd3_##rest##res), \
657 0, \
658 cache, \
659 respsize, \
660 }
661
662#define ST 1 /* status*/
663#define FH 17 /* filehandle with length */
664#define AT 21 /* attributes */
665#define pAT (1+AT) /* post attributes - conditional */
666#define WC (7+pAT) /* WCC attributes */
667
668static struct svc_procedure nfsd_procedures3[22] = {
Yu Zhiguob9081d92009-06-09 17:33:34 +0800669 [NFS3PROC_NULL] = {
670 .pc_func = (svc_procfunc) nfsd3_proc_null,
671 .pc_encode = (kxdrproc_t) nfs3svc_encode_voidres,
672 .pc_argsize = sizeof(struct nfsd3_voidargs),
673 .pc_ressize = sizeof(struct nfsd3_voidres),
674 .pc_cachetype = RC_NOCACHE,
675 .pc_xdrressize = ST,
676 },
677 [NFS3PROC_GETATTR] = {
678 .pc_func = (svc_procfunc) nfsd3_proc_getattr,
679 .pc_decode = (kxdrproc_t) nfs3svc_decode_fhandleargs,
680 .pc_encode = (kxdrproc_t) nfs3svc_encode_attrstatres,
681 .pc_release = (kxdrproc_t) nfs3svc_release_fhandle,
682 .pc_argsize = sizeof(struct nfsd3_fhandleargs),
683 .pc_ressize = sizeof(struct nfsd3_attrstatres),
684 .pc_cachetype = RC_NOCACHE,
685 .pc_xdrressize = ST+AT,
686 },
687 [NFS3PROC_SETATTR] = {
688 .pc_func = (svc_procfunc) nfsd3_proc_setattr,
689 .pc_decode = (kxdrproc_t) nfs3svc_decode_sattrargs,
690 .pc_encode = (kxdrproc_t) nfs3svc_encode_wccstatres,
691 .pc_release = (kxdrproc_t) nfs3svc_release_fhandle,
692 .pc_argsize = sizeof(struct nfsd3_sattrargs),
693 .pc_ressize = sizeof(struct nfsd3_wccstatres),
694 .pc_cachetype = RC_REPLBUFF,
695 .pc_xdrressize = ST+WC,
696 },
697 [NFS3PROC_LOOKUP] = {
698 .pc_func = (svc_procfunc) nfsd3_proc_lookup,
699 .pc_decode = (kxdrproc_t) nfs3svc_decode_diropargs,
700 .pc_encode = (kxdrproc_t) nfs3svc_encode_diropres,
701 .pc_release = (kxdrproc_t) nfs3svc_release_fhandle2,
702 .pc_argsize = sizeof(struct nfsd3_diropargs),
703 .pc_ressize = sizeof(struct nfsd3_diropres),
704 .pc_cachetype = RC_NOCACHE,
705 .pc_xdrressize = ST+FH+pAT+pAT,
706 },
707 [NFS3PROC_ACCESS] = {
708 .pc_func = (svc_procfunc) nfsd3_proc_access,
709 .pc_decode = (kxdrproc_t) nfs3svc_decode_accessargs,
710 .pc_encode = (kxdrproc_t) nfs3svc_encode_accessres,
711 .pc_release = (kxdrproc_t) nfs3svc_release_fhandle,
712 .pc_argsize = sizeof(struct nfsd3_accessargs),
713 .pc_ressize = sizeof(struct nfsd3_accessres),
714 .pc_cachetype = RC_NOCACHE,
715 .pc_xdrressize = ST+pAT+1,
716 },
717 [NFS3PROC_READLINK] = {
718 .pc_func = (svc_procfunc) nfsd3_proc_readlink,
719 .pc_decode = (kxdrproc_t) nfs3svc_decode_readlinkargs,
720 .pc_encode = (kxdrproc_t) nfs3svc_encode_readlinkres,
721 .pc_release = (kxdrproc_t) nfs3svc_release_fhandle,
722 .pc_argsize = sizeof(struct nfsd3_readlinkargs),
723 .pc_ressize = sizeof(struct nfsd3_readlinkres),
724 .pc_cachetype = RC_NOCACHE,
725 .pc_xdrressize = ST+pAT+1+NFS3_MAXPATHLEN/4,
726 },
727 [NFS3PROC_READ] = {
728 .pc_func = (svc_procfunc) nfsd3_proc_read,
729 .pc_decode = (kxdrproc_t) nfs3svc_decode_readargs,
730 .pc_encode = (kxdrproc_t) nfs3svc_encode_readres,
731 .pc_release = (kxdrproc_t) nfs3svc_release_fhandle,
732 .pc_argsize = sizeof(struct nfsd3_readargs),
733 .pc_ressize = sizeof(struct nfsd3_readres),
734 .pc_cachetype = RC_NOCACHE,
735 .pc_xdrressize = ST+pAT+4+NFSSVC_MAXBLKSIZE/4,
736 },
737 [NFS3PROC_WRITE] = {
738 .pc_func = (svc_procfunc) nfsd3_proc_write,
739 .pc_decode = (kxdrproc_t) nfs3svc_decode_writeargs,
740 .pc_encode = (kxdrproc_t) nfs3svc_encode_writeres,
741 .pc_release = (kxdrproc_t) nfs3svc_release_fhandle,
742 .pc_argsize = sizeof(struct nfsd3_writeargs),
743 .pc_ressize = sizeof(struct nfsd3_writeres),
744 .pc_cachetype = RC_REPLBUFF,
745 .pc_xdrressize = ST+WC+4,
746 },
747 [NFS3PROC_CREATE] = {
748 .pc_func = (svc_procfunc) nfsd3_proc_create,
749 .pc_decode = (kxdrproc_t) nfs3svc_decode_createargs,
750 .pc_encode = (kxdrproc_t) nfs3svc_encode_createres,
751 .pc_release = (kxdrproc_t) nfs3svc_release_fhandle2,
752 .pc_argsize = sizeof(struct nfsd3_createargs),
753 .pc_ressize = sizeof(struct nfsd3_createres),
754 .pc_cachetype = RC_REPLBUFF,
755 .pc_xdrressize = ST+(1+FH+pAT)+WC,
756 },
757 [NFS3PROC_MKDIR] = {
758 .pc_func = (svc_procfunc) nfsd3_proc_mkdir,
759 .pc_decode = (kxdrproc_t) nfs3svc_decode_mkdirargs,
760 .pc_encode = (kxdrproc_t) nfs3svc_encode_createres,
761 .pc_release = (kxdrproc_t) nfs3svc_release_fhandle2,
762 .pc_argsize = sizeof(struct nfsd3_mkdirargs),
763 .pc_ressize = sizeof(struct nfsd3_createres),
764 .pc_cachetype = RC_REPLBUFF,
765 .pc_xdrressize = ST+(1+FH+pAT)+WC,
766 },
767 [NFS3PROC_SYMLINK] = {
768 .pc_func = (svc_procfunc) nfsd3_proc_symlink,
769 .pc_decode = (kxdrproc_t) nfs3svc_decode_symlinkargs,
770 .pc_encode = (kxdrproc_t) nfs3svc_encode_createres,
771 .pc_release = (kxdrproc_t) nfs3svc_release_fhandle2,
772 .pc_argsize = sizeof(struct nfsd3_symlinkargs),
773 .pc_ressize = sizeof(struct nfsd3_createres),
774 .pc_cachetype = RC_REPLBUFF,
775 .pc_xdrressize = ST+(1+FH+pAT)+WC,
776 },
777 [NFS3PROC_MKNOD] = {
778 .pc_func = (svc_procfunc) nfsd3_proc_mknod,
779 .pc_decode = (kxdrproc_t) nfs3svc_decode_mknodargs,
780 .pc_encode = (kxdrproc_t) nfs3svc_encode_createres,
781 .pc_release = (kxdrproc_t) nfs3svc_release_fhandle2,
782 .pc_argsize = sizeof(struct nfsd3_mknodargs),
783 .pc_ressize = sizeof(struct nfsd3_createres),
784 .pc_cachetype = RC_REPLBUFF,
785 .pc_xdrressize = ST+(1+FH+pAT)+WC,
786 },
787 [NFS3PROC_REMOVE] = {
788 .pc_func = (svc_procfunc) nfsd3_proc_remove,
789 .pc_decode = (kxdrproc_t) nfs3svc_decode_diropargs,
790 .pc_encode = (kxdrproc_t) nfs3svc_encode_wccstatres,
791 .pc_release = (kxdrproc_t) nfs3svc_release_fhandle,
792 .pc_argsize = sizeof(struct nfsd3_diropargs),
793 .pc_ressize = sizeof(struct nfsd3_wccstatres),
794 .pc_cachetype = RC_REPLBUFF,
795 .pc_xdrressize = ST+WC,
796 },
797 [NFS3PROC_RMDIR] = {
798 .pc_func = (svc_procfunc) nfsd3_proc_rmdir,
799 .pc_decode = (kxdrproc_t) nfs3svc_decode_diropargs,
800 .pc_encode = (kxdrproc_t) nfs3svc_encode_wccstatres,
801 .pc_release = (kxdrproc_t) nfs3svc_release_fhandle,
802 .pc_argsize = sizeof(struct nfsd3_diropargs),
803 .pc_ressize = sizeof(struct nfsd3_wccstatres),
804 .pc_cachetype = RC_REPLBUFF,
805 .pc_xdrressize = ST+WC,
806 },
807 [NFS3PROC_RENAME] = {
808 .pc_func = (svc_procfunc) nfsd3_proc_rename,
809 .pc_decode = (kxdrproc_t) nfs3svc_decode_renameargs,
810 .pc_encode = (kxdrproc_t) nfs3svc_encode_renameres,
811 .pc_release = (kxdrproc_t) nfs3svc_release_fhandle2,
812 .pc_argsize = sizeof(struct nfsd3_renameargs),
813 .pc_ressize = sizeof(struct nfsd3_renameres),
814 .pc_cachetype = RC_REPLBUFF,
815 .pc_xdrressize = ST+WC+WC,
816 },
817 [NFS3PROC_LINK] = {
818 .pc_func = (svc_procfunc) nfsd3_proc_link,
819 .pc_decode = (kxdrproc_t) nfs3svc_decode_linkargs,
820 .pc_encode = (kxdrproc_t) nfs3svc_encode_linkres,
821 .pc_release = (kxdrproc_t) nfs3svc_release_fhandle2,
822 .pc_argsize = sizeof(struct nfsd3_linkargs),
823 .pc_ressize = sizeof(struct nfsd3_linkres),
824 .pc_cachetype = RC_REPLBUFF,
825 .pc_xdrressize = ST+pAT+WC,
826 },
827 [NFS3PROC_READDIR] = {
828 .pc_func = (svc_procfunc) nfsd3_proc_readdir,
829 .pc_decode = (kxdrproc_t) nfs3svc_decode_readdirargs,
830 .pc_encode = (kxdrproc_t) nfs3svc_encode_readdirres,
831 .pc_release = (kxdrproc_t) nfs3svc_release_fhandle,
832 .pc_argsize = sizeof(struct nfsd3_readdirargs),
833 .pc_ressize = sizeof(struct nfsd3_readdirres),
834 .pc_cachetype = RC_NOCACHE,
835 },
836 [NFS3PROC_READDIRPLUS] = {
837 .pc_func = (svc_procfunc) nfsd3_proc_readdirplus,
838 .pc_decode = (kxdrproc_t) nfs3svc_decode_readdirplusargs,
839 .pc_encode = (kxdrproc_t) nfs3svc_encode_readdirres,
840 .pc_release = (kxdrproc_t) nfs3svc_release_fhandle,
841 .pc_argsize = sizeof(struct nfsd3_readdirplusargs),
842 .pc_ressize = sizeof(struct nfsd3_readdirres),
843 .pc_cachetype = RC_NOCACHE,
844 },
845 [NFS3PROC_FSSTAT] = {
846 .pc_func = (svc_procfunc) nfsd3_proc_fsstat,
847 .pc_decode = (kxdrproc_t) nfs3svc_decode_fhandleargs,
848 .pc_encode = (kxdrproc_t) nfs3svc_encode_fsstatres,
849 .pc_argsize = sizeof(struct nfsd3_fhandleargs),
850 .pc_ressize = sizeof(struct nfsd3_fsstatres),
851 .pc_cachetype = RC_NOCACHE,
852 .pc_xdrressize = ST+pAT+2*6+1,
853 },
854 [NFS3PROC_FSINFO] = {
855 .pc_func = (svc_procfunc) nfsd3_proc_fsinfo,
856 .pc_decode = (kxdrproc_t) nfs3svc_decode_fhandleargs,
857 .pc_encode = (kxdrproc_t) nfs3svc_encode_fsinfores,
858 .pc_argsize = sizeof(struct nfsd3_fhandleargs),
859 .pc_ressize = sizeof(struct nfsd3_fsinfores),
860 .pc_cachetype = RC_NOCACHE,
861 .pc_xdrressize = ST+pAT+12,
862 },
863 [NFS3PROC_PATHCONF] = {
864 .pc_func = (svc_procfunc) nfsd3_proc_pathconf,
865 .pc_decode = (kxdrproc_t) nfs3svc_decode_fhandleargs,
866 .pc_encode = (kxdrproc_t) nfs3svc_encode_pathconfres,
867 .pc_argsize = sizeof(struct nfsd3_fhandleargs),
868 .pc_ressize = sizeof(struct nfsd3_pathconfres),
869 .pc_cachetype = RC_NOCACHE,
870 .pc_xdrressize = ST+pAT+6,
871 },
872 [NFS3PROC_COMMIT] = {
873 .pc_func = (svc_procfunc) nfsd3_proc_commit,
874 .pc_decode = (kxdrproc_t) nfs3svc_decode_commitargs,
875 .pc_encode = (kxdrproc_t) nfs3svc_encode_commitres,
876 .pc_release = (kxdrproc_t) nfs3svc_release_fhandle,
877 .pc_argsize = sizeof(struct nfsd3_commitargs),
878 .pc_ressize = sizeof(struct nfsd3_commitres),
879 .pc_cachetype = RC_NOCACHE,
880 .pc_xdrressize = ST+WC+2,
881 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700882};
883
884struct svc_version nfsd_version3 = {
885 .vs_vers = 3,
886 .vs_nproc = 22,
887 .vs_proc = nfsd_procedures3,
888 .vs_dispatch = nfsd_dispatch,
889 .vs_xdrsize = NFS3_SVC_XDRSIZE,
890};