hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/fs/nfsd/nfsproc.c
....@@ -11,30 +11,14 @@
1111 #include "xdr.h"
1212 #include "vfs.h"
1313
14
-typedef struct svc_rqst svc_rqst;
15
-typedef struct svc_buf svc_buf;
16
-
1714 #define NFSDDBG_FACILITY NFSDDBG_PROC
18
-
1915
2016 static __be32
2117 nfsd_proc_null(struct svc_rqst *rqstp)
2218 {
23
- return nfs_ok;
19
+ return rpc_success;
2420 }
2521
26
-static __be32
27
-nfsd_return_attrs(__be32 err, struct nfsd_attrstat *resp)
28
-{
29
- if (err) return err;
30
- return fh_getattr(&resp->fh, &resp->stat);
31
-}
32
-static __be32
33
-nfsd_return_dirop(__be32 err, struct nfsd_diropres *resp)
34
-{
35
- if (err) return err;
36
- return fh_getattr(&resp->fh, &resp->stat);
37
-}
3822 /*
3923 * Get a file's attributes
4024 * N.B. After this call resp->fh needs an fh_put
....@@ -44,13 +28,17 @@
4428 {
4529 struct nfsd_fhandle *argp = rqstp->rq_argp;
4630 struct nfsd_attrstat *resp = rqstp->rq_resp;
47
- __be32 nfserr;
31
+
4832 dprintk("nfsd: GETATTR %s\n", SVCFH_fmt(&argp->fh));
4933
5034 fh_copy(&resp->fh, &argp->fh);
51
- nfserr = fh_verify(rqstp, &resp->fh, 0,
52
- NFSD_MAY_NOP | NFSD_MAY_BYPASS_GSS_ON_ROOT);
53
- return nfsd_return_attrs(nfserr, resp);
35
+ resp->status = fh_verify(rqstp, &resp->fh, 0,
36
+ NFSD_MAY_NOP | NFSD_MAY_BYPASS_GSS_ON_ROOT);
37
+ if (resp->status != nfs_ok)
38
+ goto out;
39
+ resp->status = fh_getattr(&resp->fh, &resp->stat);
40
+out:
41
+ return rpc_success;
5442 }
5543
5644 /*
....@@ -64,7 +52,6 @@
6452 struct nfsd_attrstat *resp = rqstp->rq_resp;
6553 struct iattr *iap = &argp->attrs;
6654 struct svc_fh *fhp;
67
- __be32 nfserr;
6855
6956 dprintk("nfsd: SETATTR %s, valid=%x, size=%ld\n",
7057 SVCFH_fmt(&argp->fh),
....@@ -94,11 +81,11 @@
9481 * Solaris, at least, doesn't seem to care what the time
9582 * request is. We require it be within 30 minutes of now.
9683 */
97
- time_t delta = iap->ia_atime.tv_sec - get_seconds();
84
+ time64_t delta = iap->ia_atime.tv_sec - ktime_get_real_seconds();
9885
99
- nfserr = fh_verify(rqstp, fhp, 0, NFSD_MAY_NOP);
100
- if (nfserr)
101
- goto done;
86
+ resp->status = fh_verify(rqstp, fhp, 0, NFSD_MAY_NOP);
87
+ if (resp->status != nfs_ok)
88
+ goto out;
10289
10390 if (delta < 0)
10491 delta = -delta;
....@@ -113,16 +100,20 @@
113100 }
114101 }
115102
116
- nfserr = nfsd_setattr(rqstp, fhp, iap, 0, (time_t)0);
117
-done:
118
- return nfsd_return_attrs(nfserr, resp);
103
+ resp->status = nfsd_setattr(rqstp, fhp, iap, 0, (time64_t)0);
104
+ if (resp->status != nfs_ok)
105
+ goto out;
106
+
107
+ resp->status = fh_getattr(&resp->fh, &resp->stat);
108
+out:
109
+ return rpc_success;
119110 }
120111
121112 /* Obsolete, replaced by MNTPROC_MNT. */
122113 static __be32
123114 nfsd_proc_root(struct svc_rqst *rqstp)
124115 {
125
- return nfs_ok;
116
+ return rpc_success;
126117 }
127118
128119 /*
....@@ -136,17 +127,20 @@
136127 {
137128 struct nfsd_diropargs *argp = rqstp->rq_argp;
138129 struct nfsd_diropres *resp = rqstp->rq_resp;
139
- __be32 nfserr;
140130
141131 dprintk("nfsd: LOOKUP %s %.*s\n",
142132 SVCFH_fmt(&argp->fh), argp->len, argp->name);
143133
144134 fh_init(&resp->fh, NFS_FHSIZE);
145
- nfserr = nfsd_lookup(rqstp, &argp->fh, argp->name, argp->len,
146
- &resp->fh);
147
-
135
+ resp->status = nfsd_lookup(rqstp, &argp->fh, argp->name, argp->len,
136
+ &resp->fh);
148137 fh_put(&argp->fh);
149
- return nfsd_return_dirop(nfserr, resp);
138
+ if (resp->status != nfs_ok)
139
+ goto out;
140
+
141
+ resp->status = fh_getattr(&resp->fh, &resp->stat);
142
+out:
143
+ return rpc_success;
150144 }
151145
152146 /*
....@@ -157,16 +151,15 @@
157151 {
158152 struct nfsd_readlinkargs *argp = rqstp->rq_argp;
159153 struct nfsd_readlinkres *resp = rqstp->rq_resp;
160
- __be32 nfserr;
161154
162155 dprintk("nfsd: READLINK %s\n", SVCFH_fmt(&argp->fh));
163156
164157 /* Read the symlink. */
165158 resp->len = NFS_MAXPATHLEN;
166
- nfserr = nfsd_readlink(rqstp, &argp->fh, argp->buffer, &resp->len);
159
+ resp->status = nfsd_readlink(rqstp, &argp->fh, argp->buffer, &resp->len);
167160
168161 fh_put(&argp->fh);
169
- return nfserr;
162
+ return rpc_success;
170163 }
171164
172165 /*
....@@ -178,7 +171,7 @@
178171 {
179172 struct nfsd_readargs *argp = rqstp->rq_argp;
180173 struct nfsd_readres *resp = rqstp->rq_resp;
181
- __be32 nfserr;
174
+ u32 eof;
182175
183176 dprintk("nfsd: READ %s %d bytes at %d\n",
184177 SVCFH_fmt(&argp->fh),
....@@ -199,20 +192,23 @@
199192 svc_reserve_auth(rqstp, (19<<2) + argp->count + 4);
200193
201194 resp->count = argp->count;
202
- nfserr = nfsd_read(rqstp, fh_copy(&resp->fh, &argp->fh),
203
- argp->offset,
204
- rqstp->rq_vec, argp->vlen,
205
- &resp->count);
206
-
207
- if (nfserr) return nfserr;
208
- return fh_getattr(&resp->fh, &resp->stat);
195
+ resp->status = nfsd_read(rqstp, fh_copy(&resp->fh, &argp->fh),
196
+ argp->offset,
197
+ rqstp->rq_vec, argp->vlen,
198
+ &resp->count,
199
+ &eof);
200
+ if (resp->status == nfs_ok)
201
+ resp->status = fh_getattr(&resp->fh, &resp->stat);
202
+ else if (resp->status == nfserr_jukebox)
203
+ return rpc_drop_reply;
204
+ return rpc_success;
209205 }
210206
211207 /* Reserved */
212208 static __be32
213209 nfsd_proc_writecache(struct svc_rqst *rqstp)
214210 {
215
- return nfs_ok;
211
+ return rpc_success;
216212 }
217213
218214 /*
....@@ -224,22 +220,29 @@
224220 {
225221 struct nfsd_writeargs *argp = rqstp->rq_argp;
226222 struct nfsd_attrstat *resp = rqstp->rq_resp;
227
- __be32 nfserr;
228223 unsigned long cnt = argp->len;
229224 unsigned int nvecs;
230225
231
- dprintk("nfsd: WRITE %s %d bytes at %d\n",
226
+ dprintk("nfsd: WRITE %s %u bytes at %d\n",
232227 SVCFH_fmt(&argp->fh),
233228 argp->len, argp->offset);
234229
235230 nvecs = svc_fill_write_vector(rqstp, rqstp->rq_arg.pages,
236231 &argp->first, cnt);
237
- if (!nvecs)
238
- return nfserr_io;
239
- nfserr = nfsd_write(rqstp, fh_copy(&resp->fh, &argp->fh),
240
- argp->offset, rqstp->rq_vec, nvecs,
241
- &cnt, NFS_DATA_SYNC);
242
- return nfsd_return_attrs(nfserr, resp);
232
+ if (!nvecs) {
233
+ resp->status = nfserr_io;
234
+ goto out;
235
+ }
236
+
237
+ resp->status = nfsd_write(rqstp, fh_copy(&resp->fh, &argp->fh),
238
+ argp->offset, rqstp->rq_vec, nvecs,
239
+ &cnt, NFS_DATA_SYNC, NULL);
240
+ if (resp->status == nfs_ok)
241
+ resp->status = fh_getattr(&resp->fh, &resp->stat);
242
+ else if (resp->status == nfserr_jukebox)
243
+ return rpc_drop_reply;
244
+out:
245
+ return rpc_success;
243246 }
244247
245248 /*
....@@ -259,7 +262,6 @@
259262 struct inode *inode;
260263 struct dentry *dchild;
261264 int type, mode;
262
- __be32 nfserr;
263265 int hosterr;
264266 dev_t rdev = 0, wanted = new_decode_dev(attr->ia_size);
265267
....@@ -267,40 +269,40 @@
267269 SVCFH_fmt(dirfhp), argp->len, argp->name);
268270
269271 /* First verify the parent file handle */
270
- nfserr = fh_verify(rqstp, dirfhp, S_IFDIR, NFSD_MAY_EXEC);
271
- if (nfserr)
272
+ resp->status = fh_verify(rqstp, dirfhp, S_IFDIR, NFSD_MAY_EXEC);
273
+ if (resp->status != nfs_ok)
272274 goto done; /* must fh_put dirfhp even on error */
273275
274276 /* Check for NFSD_MAY_WRITE in nfsd_create if necessary */
275277
276
- nfserr = nfserr_exist;
278
+ resp->status = nfserr_exist;
277279 if (isdotent(argp->name, argp->len))
278280 goto done;
279281 hosterr = fh_want_write(dirfhp);
280282 if (hosterr) {
281
- nfserr = nfserrno(hosterr);
283
+ resp->status = nfserrno(hosterr);
282284 goto done;
283285 }
284286
285287 fh_lock_nested(dirfhp, I_MUTEX_PARENT);
286288 dchild = lookup_one_len(argp->name, dirfhp->fh_dentry, argp->len);
287289 if (IS_ERR(dchild)) {
288
- nfserr = nfserrno(PTR_ERR(dchild));
290
+ resp->status = nfserrno(PTR_ERR(dchild));
289291 goto out_unlock;
290292 }
291293 fh_init(newfhp, NFS_FHSIZE);
292
- nfserr = fh_compose(newfhp, dirfhp->fh_export, dchild, dirfhp);
293
- if (!nfserr && d_really_is_negative(dchild))
294
- nfserr = nfserr_noent;
294
+ resp->status = fh_compose(newfhp, dirfhp->fh_export, dchild, dirfhp);
295
+ if (!resp->status && d_really_is_negative(dchild))
296
+ resp->status = nfserr_noent;
295297 dput(dchild);
296
- if (nfserr) {
297
- if (nfserr != nfserr_noent)
298
+ if (resp->status) {
299
+ if (resp->status != nfserr_noent)
298300 goto out_unlock;
299301 /*
300302 * If the new file handle wasn't verified, we can't tell
301303 * whether the file exists or not. Time to bail ...
302304 */
303
- nfserr = nfserr_acces;
305
+ resp->status = nfserr_acces;
304306 if (!newfhp->fh_dentry) {
305307 printk(KERN_WARNING
306308 "nfsd_proc_create: file handle not verified\n");
....@@ -326,18 +328,18 @@
326328 rdev = inode->i_rdev;
327329 attr->ia_valid |= ATTR_SIZE;
328330
329
- /* FALLTHROUGH */
331
+ fallthrough;
330332 case S_IFIFO:
331333 /* this is probably a permission check..
332334 * at least IRIX implements perm checking on
333335 * echo thing > device-special-file-or-pipe
334336 * by doing a CREATE with type==0
335337 */
336
- nfserr = nfsd_permission(rqstp,
338
+ resp->status = nfsd_permission(rqstp,
337339 newfhp->fh_export,
338340 newfhp->fh_dentry,
339341 NFSD_MAY_WRITE|NFSD_MAY_LOCAL_ACCESS);
340
- if (nfserr && nfserr != nfserr_rofs)
342
+ if (resp->status && resp->status != nfserr_rofs)
341343 goto out_unlock;
342344 }
343345 } else
....@@ -373,16 +375,17 @@
373375 attr->ia_valid &= ~ATTR_SIZE;
374376
375377 /* Make sure the type and device matches */
376
- nfserr = nfserr_exist;
377
- if (inode && type != (inode->i_mode & S_IFMT))
378
+ resp->status = nfserr_exist;
379
+ if (inode && inode_wrong_type(inode, type))
378380 goto out_unlock;
379381 }
380382
381
- nfserr = 0;
383
+ resp->status = nfs_ok;
382384 if (!inode) {
383385 /* File doesn't exist. Create it and set attrs */
384
- nfserr = nfsd_create_locked(rqstp, dirfhp, argp->name,
385
- argp->len, attr, type, rdev, newfhp);
386
+ resp->status = nfsd_create_locked(rqstp, dirfhp, argp->name,
387
+ argp->len, attr, type, rdev,
388
+ newfhp);
386389 } else if (type == S_IFREG) {
387390 dprintk("nfsd: existing %s, valid=%x, size=%ld\n",
388391 argp->name, attr->ia_valid, (long) attr->ia_size);
....@@ -392,7 +395,8 @@
392395 */
393396 attr->ia_valid &= ATTR_SIZE;
394397 if (attr->ia_valid)
395
- nfserr = nfsd_setattr(rqstp, newfhp, attr, 0, (time_t)0);
398
+ resp->status = nfsd_setattr(rqstp, newfhp, attr, 0,
399
+ (time64_t)0);
396400 }
397401
398402 out_unlock:
....@@ -401,47 +405,52 @@
401405 fh_drop_write(dirfhp);
402406 done:
403407 fh_put(dirfhp);
404
- return nfsd_return_dirop(nfserr, resp);
408
+ if (resp->status != nfs_ok)
409
+ goto out;
410
+ resp->status = fh_getattr(&resp->fh, &resp->stat);
411
+out:
412
+ return rpc_success;
405413 }
406414
407415 static __be32
408416 nfsd_proc_remove(struct svc_rqst *rqstp)
409417 {
410418 struct nfsd_diropargs *argp = rqstp->rq_argp;
411
- __be32 nfserr;
419
+ struct nfsd_stat *resp = rqstp->rq_resp;
412420
413421 dprintk("nfsd: REMOVE %s %.*s\n", SVCFH_fmt(&argp->fh),
414422 argp->len, argp->name);
415423
416424 /* Unlink. -SIFDIR means file must not be a directory */
417
- nfserr = nfsd_unlink(rqstp, &argp->fh, -S_IFDIR, argp->name, argp->len);
425
+ resp->status = nfsd_unlink(rqstp, &argp->fh, -S_IFDIR,
426
+ argp->name, argp->len);
418427 fh_put(&argp->fh);
419
- return nfserr;
428
+ return rpc_success;
420429 }
421430
422431 static __be32
423432 nfsd_proc_rename(struct svc_rqst *rqstp)
424433 {
425434 struct nfsd_renameargs *argp = rqstp->rq_argp;
426
- __be32 nfserr;
435
+ struct nfsd_stat *resp = rqstp->rq_resp;
427436
428437 dprintk("nfsd: RENAME %s %.*s -> \n",
429438 SVCFH_fmt(&argp->ffh), argp->flen, argp->fname);
430439 dprintk("nfsd: -> %s %.*s\n",
431440 SVCFH_fmt(&argp->tfh), argp->tlen, argp->tname);
432441
433
- nfserr = nfsd_rename(rqstp, &argp->ffh, argp->fname, argp->flen,
434
- &argp->tfh, argp->tname, argp->tlen);
442
+ resp->status = nfsd_rename(rqstp, &argp->ffh, argp->fname, argp->flen,
443
+ &argp->tfh, argp->tname, argp->tlen);
435444 fh_put(&argp->ffh);
436445 fh_put(&argp->tfh);
437
- return nfserr;
446
+ return rpc_success;
438447 }
439448
440449 static __be32
441450 nfsd_proc_link(struct svc_rqst *rqstp)
442451 {
443452 struct nfsd_linkargs *argp = rqstp->rq_argp;
444
- __be32 nfserr;
453
+ struct nfsd_stat *resp = rqstp->rq_resp;
445454
446455 dprintk("nfsd: LINK %s ->\n",
447456 SVCFH_fmt(&argp->ffh));
....@@ -450,41 +459,46 @@
450459 argp->tlen,
451460 argp->tname);
452461
453
- nfserr = nfsd_link(rqstp, &argp->tfh, argp->tname, argp->tlen,
454
- &argp->ffh);
462
+ resp->status = nfsd_link(rqstp, &argp->tfh, argp->tname, argp->tlen,
463
+ &argp->ffh);
455464 fh_put(&argp->ffh);
456465 fh_put(&argp->tfh);
457
- return nfserr;
466
+ return rpc_success;
458467 }
459468
460469 static __be32
461470 nfsd_proc_symlink(struct svc_rqst *rqstp)
462471 {
463472 struct nfsd_symlinkargs *argp = rqstp->rq_argp;
473
+ struct nfsd_stat *resp = rqstp->rq_resp;
464474 struct svc_fh newfh;
465
- __be32 nfserr;
466475
467
- if (argp->tlen > NFS_MAXPATHLEN)
468
- return nfserr_nametoolong;
476
+ if (argp->tlen > NFS_MAXPATHLEN) {
477
+ resp->status = nfserr_nametoolong;
478
+ goto out;
479
+ }
469480
470481 argp->tname = svc_fill_symlink_pathname(rqstp, &argp->first,
471482 page_address(rqstp->rq_arg.pages[0]),
472483 argp->tlen);
473
- if (IS_ERR(argp->tname))
474
- return nfserrno(PTR_ERR(argp->tname));
484
+ if (IS_ERR(argp->tname)) {
485
+ resp->status = nfserrno(PTR_ERR(argp->tname));
486
+ goto out;
487
+ }
475488
476489 dprintk("nfsd: SYMLINK %s %.*s -> %.*s\n",
477490 SVCFH_fmt(&argp->ffh), argp->flen, argp->fname,
478491 argp->tlen, argp->tname);
479492
480493 fh_init(&newfh, NFS_FHSIZE);
481
- nfserr = nfsd_symlink(rqstp, &argp->ffh, argp->fname, argp->flen,
482
- argp->tname, &newfh);
494
+ resp->status = nfsd_symlink(rqstp, &argp->ffh, argp->fname, argp->flen,
495
+ argp->tname, &newfh);
483496
484497 kfree(argp->tname);
485498 fh_put(&argp->ffh);
486499 fh_put(&newfh);
487
- return nfserr;
500
+out:
501
+ return rpc_success;
488502 }
489503
490504 /*
....@@ -496,7 +510,6 @@
496510 {
497511 struct nfsd_createargs *argp = rqstp->rq_argp;
498512 struct nfsd_diropres *resp = rqstp->rq_resp;
499
- __be32 nfserr;
500513
501514 dprintk("nfsd: MKDIR %s %.*s\n", SVCFH_fmt(&argp->fh), argp->len, argp->name);
502515
....@@ -507,10 +520,15 @@
507520
508521 argp->attrs.ia_valid &= ~ATTR_SIZE;
509522 fh_init(&resp->fh, NFS_FHSIZE);
510
- nfserr = nfsd_create(rqstp, &argp->fh, argp->name, argp->len,
511
- &argp->attrs, S_IFDIR, 0, &resp->fh);
523
+ resp->status = nfsd_create(rqstp, &argp->fh, argp->name, argp->len,
524
+ &argp->attrs, S_IFDIR, 0, &resp->fh);
512525 fh_put(&argp->fh);
513
- return nfsd_return_dirop(nfserr, resp);
526
+ if (resp->status != nfs_ok)
527
+ goto out;
528
+
529
+ resp->status = fh_getattr(&resp->fh, &resp->stat);
530
+out:
531
+ return rpc_success;
514532 }
515533
516534 /*
....@@ -520,13 +538,14 @@
520538 nfsd_proc_rmdir(struct svc_rqst *rqstp)
521539 {
522540 struct nfsd_diropargs *argp = rqstp->rq_argp;
523
- __be32 nfserr;
541
+ struct nfsd_stat *resp = rqstp->rq_resp;
524542
525543 dprintk("nfsd: RMDIR %s %.*s\n", SVCFH_fmt(&argp->fh), argp->len, argp->name);
526544
527
- nfserr = nfsd_unlink(rqstp, &argp->fh, S_IFDIR, argp->name, argp->len);
545
+ resp->status = nfsd_unlink(rqstp, &argp->fh, S_IFDIR,
546
+ argp->name, argp->len);
528547 fh_put(&argp->fh);
529
- return nfserr;
548
+ return rpc_success;
530549 }
531550
532551 /*
....@@ -538,7 +557,6 @@
538557 struct nfsd_readdirargs *argp = rqstp->rq_argp;
539558 struct nfsd_readdirres *resp = rqstp->rq_resp;
540559 int count;
541
- __be32 nfserr;
542560 loff_t offset;
543561
544562 dprintk("nfsd: READDIR %s %d bytes at %d\n",
....@@ -559,15 +577,15 @@
559577 resp->common.err = nfs_ok;
560578 /* Read directory and encode entries on the fly */
561579 offset = argp->cookie;
562
- nfserr = nfsd_readdir(rqstp, &argp->fh, &offset,
563
- &resp->common, nfssvc_encode_entry);
580
+ resp->status = nfsd_readdir(rqstp, &argp->fh, &offset,
581
+ &resp->common, nfssvc_encode_entry);
564582
565583 resp->count = resp->buffer - argp->buffer;
566584 if (resp->offset)
567585 *resp->offset = htonl(offset);
568586
569587 fh_put(&argp->fh);
570
- return nfserr;
588
+ return rpc_success;
571589 }
572590
573591 /*
....@@ -578,14 +596,13 @@
578596 {
579597 struct nfsd_fhandle *argp = rqstp->rq_argp;
580598 struct nfsd_statfsres *resp = rqstp->rq_resp;
581
- __be32 nfserr;
582599
583600 dprintk("nfsd: STATFS %s\n", SVCFH_fmt(&argp->fh));
584601
585
- nfserr = nfsd_statfs(rqstp, &argp->fh, &resp->stats,
586
- NFSD_MAY_BYPASS_GSS_ON_ROOT);
602
+ resp->status = nfsd_statfs(rqstp, &argp->fh, &resp->stats,
603
+ NFSD_MAY_BYPASS_GSS_ON_ROOT);
587604 fh_put(&argp->fh);
588
- return nfserr;
605
+ return rpc_success;
589606 }
590607
591608 /*
....@@ -606,13 +623,13 @@
606623 .pc_argsize = sizeof(struct nfsd_void),
607624 .pc_ressize = sizeof(struct nfsd_void),
608625 .pc_cachetype = RC_NOCACHE,
609
- .pc_xdrressize = ST,
626
+ .pc_xdrressize = 0,
610627 },
611628 [NFSPROC_GETATTR] = {
612629 .pc_func = nfsd_proc_getattr,
613630 .pc_decode = nfssvc_decode_fhandle,
614631 .pc_encode = nfssvc_encode_attrstat,
615
- .pc_release = nfssvc_release_fhandle,
632
+ .pc_release = nfssvc_release_attrstat,
616633 .pc_argsize = sizeof(struct nfsd_fhandle),
617634 .pc_ressize = sizeof(struct nfsd_attrstat),
618635 .pc_cachetype = RC_NOCACHE,
....@@ -622,7 +639,7 @@
622639 .pc_func = nfsd_proc_setattr,
623640 .pc_decode = nfssvc_decode_sattrargs,
624641 .pc_encode = nfssvc_encode_attrstat,
625
- .pc_release = nfssvc_release_fhandle,
642
+ .pc_release = nfssvc_release_attrstat,
626643 .pc_argsize = sizeof(struct nfsd_sattrargs),
627644 .pc_ressize = sizeof(struct nfsd_attrstat),
628645 .pc_cachetype = RC_REPLBUFF,
....@@ -635,13 +652,13 @@
635652 .pc_argsize = sizeof(struct nfsd_void),
636653 .pc_ressize = sizeof(struct nfsd_void),
637654 .pc_cachetype = RC_NOCACHE,
638
- .pc_xdrressize = ST,
655
+ .pc_xdrressize = 0,
639656 },
640657 [NFSPROC_LOOKUP] = {
641658 .pc_func = nfsd_proc_lookup,
642659 .pc_decode = nfssvc_decode_diropargs,
643660 .pc_encode = nfssvc_encode_diropres,
644
- .pc_release = nfssvc_release_fhandle,
661
+ .pc_release = nfssvc_release_diropres,
645662 .pc_argsize = sizeof(struct nfsd_diropargs),
646663 .pc_ressize = sizeof(struct nfsd_diropres),
647664 .pc_cachetype = RC_NOCACHE,
....@@ -660,7 +677,7 @@
660677 .pc_func = nfsd_proc_read,
661678 .pc_decode = nfssvc_decode_readargs,
662679 .pc_encode = nfssvc_encode_readres,
663
- .pc_release = nfssvc_release_fhandle,
680
+ .pc_release = nfssvc_release_readres,
664681 .pc_argsize = sizeof(struct nfsd_readargs),
665682 .pc_ressize = sizeof(struct nfsd_readres),
666683 .pc_cachetype = RC_NOCACHE,
....@@ -673,13 +690,13 @@
673690 .pc_argsize = sizeof(struct nfsd_void),
674691 .pc_ressize = sizeof(struct nfsd_void),
675692 .pc_cachetype = RC_NOCACHE,
676
- .pc_xdrressize = ST,
693
+ .pc_xdrressize = 0,
677694 },
678695 [NFSPROC_WRITE] = {
679696 .pc_func = nfsd_proc_write,
680697 .pc_decode = nfssvc_decode_writeargs,
681698 .pc_encode = nfssvc_encode_attrstat,
682
- .pc_release = nfssvc_release_fhandle,
699
+ .pc_release = nfssvc_release_attrstat,
683700 .pc_argsize = sizeof(struct nfsd_writeargs),
684701 .pc_ressize = sizeof(struct nfsd_attrstat),
685702 .pc_cachetype = RC_REPLBUFF,
....@@ -689,7 +706,7 @@
689706 .pc_func = nfsd_proc_create,
690707 .pc_decode = nfssvc_decode_createargs,
691708 .pc_encode = nfssvc_encode_diropres,
692
- .pc_release = nfssvc_release_fhandle,
709
+ .pc_release = nfssvc_release_diropres,
693710 .pc_argsize = sizeof(struct nfsd_createargs),
694711 .pc_ressize = sizeof(struct nfsd_diropres),
695712 .pc_cachetype = RC_REPLBUFF,
....@@ -698,36 +715,36 @@
698715 [NFSPROC_REMOVE] = {
699716 .pc_func = nfsd_proc_remove,
700717 .pc_decode = nfssvc_decode_diropargs,
701
- .pc_encode = nfssvc_encode_void,
718
+ .pc_encode = nfssvc_encode_stat,
702719 .pc_argsize = sizeof(struct nfsd_diropargs),
703
- .pc_ressize = sizeof(struct nfsd_void),
720
+ .pc_ressize = sizeof(struct nfsd_stat),
704721 .pc_cachetype = RC_REPLSTAT,
705722 .pc_xdrressize = ST,
706723 },
707724 [NFSPROC_RENAME] = {
708725 .pc_func = nfsd_proc_rename,
709726 .pc_decode = nfssvc_decode_renameargs,
710
- .pc_encode = nfssvc_encode_void,
727
+ .pc_encode = nfssvc_encode_stat,
711728 .pc_argsize = sizeof(struct nfsd_renameargs),
712
- .pc_ressize = sizeof(struct nfsd_void),
729
+ .pc_ressize = sizeof(struct nfsd_stat),
713730 .pc_cachetype = RC_REPLSTAT,
714731 .pc_xdrressize = ST,
715732 },
716733 [NFSPROC_LINK] = {
717734 .pc_func = nfsd_proc_link,
718735 .pc_decode = nfssvc_decode_linkargs,
719
- .pc_encode = nfssvc_encode_void,
736
+ .pc_encode = nfssvc_encode_stat,
720737 .pc_argsize = sizeof(struct nfsd_linkargs),
721
- .pc_ressize = sizeof(struct nfsd_void),
738
+ .pc_ressize = sizeof(struct nfsd_stat),
722739 .pc_cachetype = RC_REPLSTAT,
723740 .pc_xdrressize = ST,
724741 },
725742 [NFSPROC_SYMLINK] = {
726743 .pc_func = nfsd_proc_symlink,
727744 .pc_decode = nfssvc_decode_symlinkargs,
728
- .pc_encode = nfssvc_encode_void,
745
+ .pc_encode = nfssvc_encode_stat,
729746 .pc_argsize = sizeof(struct nfsd_symlinkargs),
730
- .pc_ressize = sizeof(struct nfsd_void),
747
+ .pc_ressize = sizeof(struct nfsd_stat),
731748 .pc_cachetype = RC_REPLSTAT,
732749 .pc_xdrressize = ST,
733750 },
....@@ -735,7 +752,7 @@
735752 .pc_func = nfsd_proc_mkdir,
736753 .pc_decode = nfssvc_decode_createargs,
737754 .pc_encode = nfssvc_encode_diropres,
738
- .pc_release = nfssvc_release_fhandle,
755
+ .pc_release = nfssvc_release_diropres,
739756 .pc_argsize = sizeof(struct nfsd_createargs),
740757 .pc_ressize = sizeof(struct nfsd_diropres),
741758 .pc_cachetype = RC_REPLBUFF,
....@@ -744,9 +761,9 @@
744761 [NFSPROC_RMDIR] = {
745762 .pc_func = nfsd_proc_rmdir,
746763 .pc_decode = nfssvc_decode_diropargs,
747
- .pc_encode = nfssvc_encode_void,
764
+ .pc_encode = nfssvc_encode_stat,
748765 .pc_argsize = sizeof(struct nfsd_diropargs),
749
- .pc_ressize = sizeof(struct nfsd_void),
766
+ .pc_ressize = sizeof(struct nfsd_stat),
750767 .pc_cachetype = RC_REPLSTAT,
751768 .pc_xdrressize = ST,
752769 },