2 * This software has been released under the terms of the IBM Public
3 * License. For details, see the LICENSE file in the top-level source
4 * directory or online at http://www.openafs.org/dl/license10.html
10 #include <afsconfig.h>
11 #include "afs/param.h"
14 /* Ugly Ugly Ugly but precludes conflicting XDR macros; We want kernel xdr */
15 #define __XDR_INCLUDE__
17 #include "afs/sysincludes.h" /* Standard vendor system headers */
18 #if defined(AFS_SUN5_ENV) && !defined(AFS_NONFSTRANS)
19 #include "rpc/types.h"
21 #include "rpc/auth_unix.h"
22 #include "rpc/auth_des.h"
23 #include "sys/tiuser.h"
28 #include "nfs/export.h"
29 /* Solaris 11.1 defines areq to areq_u.areq (and auid to areq_u.auid), for
30 * shortcut accessors to the nfsauth_arg structure. Since we dare to use the
31 * names areq and auid as parameter names in a lot of functions, work around
32 * this by undefining it. */
40 #include "nfs/nfs_clnt.h"
41 #include "nfs/nfs_acl.h"
42 #include "afs/afsincludes.h"
43 #include "afs/afs_stats.h"
44 #include "afs/exporter.h"
46 static int xlatorinit_v2_done
= 0;
47 static int xlatorinit_v3_done
= 0;
48 extern int afs_nobody
;
49 extern int afs_NFSRootOnly
;
53 xdrproc_t dis_xdrargs
;
54 xdrproc_t dis_fastxdrargs
;
57 xdrproc_t dis_fastxdrres
;
59 void (*dis_resfree
) ();
61 fhandle_t(*dis_getfh
) ();
64 struct afs_nfs_disp_tbl
{
68 struct afs_nfs2_resp
{
73 #if defined(AFS_SUN510_ENV)
79 struct afs_nfs_disp_tbl afs_rfs_disp_tbl
[RFS_NPROC
];
80 struct afs_nfs_disp_tbl afs_acl_disp_tbl
[ACL2_NPROC
];
83 is_afs_fh(fhandle_t
* fhp
)
85 if ((fhp
->fh_fsid
.val
[0] == AFS_VFSMAGIC
)
86 && (fhp
->fh_fsid
.val
[1] == AFS_VFSFSID
))
92 nfs2_to_afs_call(int which
, caddr_t
* args
, fhandle_t
** fhpp
,
100 afs_Trace1(afs_iclSetp
, CM_TRACE_NFSIN
, ICL_TYPE_INT32
, which
);
101 *fh2pp
= (fhandle_t
*) 0;
106 fhp1
= (fhandle_t
*) args
;
110 struct nfssaargs
*sargs
= (struct nfssaargs
*)args
;
111 fhp1
= (fhandle_t
*) & sargs
->saa_fh
;
116 struct nfsdiropargs
*sargs
= (struct nfsdiropargs
*)args
;
117 fhp1
= sargs
->da_fhandle
;
122 struct nfsreadargs
*sargs
= (struct nfsreadargs
*)args
;
123 fhp1
= (fhandle_t
*) & sargs
->ra_fhandle
;
128 struct nfswriteargs
*sargs
= (struct nfswriteargs
*)args
;
129 fhp1
= (fhandle_t
*) & sargs
->wa_fhandle
;
134 struct nfscreatargs
*sargs
= (struct nfscreatargs
*)args
;
135 fhp1
= sargs
->ca_da
.da_fhandle
;
140 struct nfsdiropargs
*sargs
= (struct nfsdiropargs
*)args
;
141 fhp1
= sargs
->da_fhandle
;
146 struct nfsrnmargs
*sargs
= (struct nfsrnmargs
*)args
;
147 fhp1
= sargs
->rna_from
.da_fhandle
;
148 fhp2
= sargs
->rna_to
.da_fhandle
;
153 struct nfslinkargs
*sargs
= (struct nfslinkargs
*)args
;
154 fhp1
= sargs
->la_from
;
155 fhp2
= sargs
->la_to
.da_fhandle
;
160 struct nfsslargs
*sargs
= (struct nfsslargs
*)args
;
161 fhp1
= sargs
->sla_from
.da_fhandle
;
166 struct nfscreatargs
*sargs
= (struct nfscreatargs
*)args
;
167 fhp1
= sargs
->ca_da
.da_fhandle
;
172 struct nfsdiropargs
*sargs
= (struct nfsdiropargs
*)args
;
173 fhp1
= sargs
->da_fhandle
;
178 struct nfsrddirargs
*sargs
= (struct nfsrddirargs
*)args
;
179 fhp1
= (fhandle_t
*) & sargs
->rda_fh
;
186 /* Ok if arg 1 is in AFS or if 2 args and arg 2 is in AFS */
187 if (fhp1
&& is_afs_fh(fhp1
)) {
193 if (fhp2
&& is_afs_fh(fhp2
)) {
202 acl2_to_afs_call(int which
, caddr_t
* args
, fhandle_t
** fhpp
)
211 case ACLPROC2_GETACL
:
213 struct GETACL2args
*sargs
= (struct GETACL2args
*)args
;
217 case ACLPROC2_SETACL
:
219 struct SETACL2args
*sargs
= (struct SETACL2args
*)args
;
223 case ACLPROC2_GETATTR
:
225 struct GETATTR2args
*sargs
= (struct GETATTR2args
*)args
;
229 case ACLPROC2_ACCESS
:
231 struct ACCESS2args
*sargs
= (struct ACCESS2args
*)args
;
235 #if defined(AFS_SUN510_ENV)
236 case ACLPROC2_GETXATTRDIR
:
238 struct GETXATTRDIR2args
*sargs
= (struct GETXATTRDIR2args
*)args
;
247 if (fhp
&& is_afs_fh(fhp
)) {
256 afs_nfs2_dispatcher(int type
, afs_int32 which
, char *argp
,
257 struct exportinfo
**expp
, struct svc_req
*rp
,
262 afs_int32 client
= 0;
264 fhandle_t
*fh
= (fhandle_t
*) argp
;
265 fhandle_t
*fh2
= (fhandle_t
*) 0;
267 if (!xlatorinit_v2_done
)
270 sa
= (struct sockaddr
*)svc_getrpccaller(rp
->rq_xprt
)->buf
;
271 if (sa
->sa_family
== AF_INET
)
272 client
= ((struct sockaddr_in
*)sa
)->sin_addr
.s_addr
;
278 code
= (client
&& nfs2_to_afs_call(which
, argp
, &fh
, &fh2
));
281 code
= (client
&& acl2_to_afs_call(which
, argp
, &fh
));
288 struct afs_exporter
*out
= 0;
291 struct SmallFid Sfid
;
293 memcpy((char *)&Sfid
, fh
->fh_data
, SIZEOF_SMALLFID
);
295 afs_Trace2(afs_iclSetp
, CM_TRACE_NFSIN1
, ICL_TYPE_POINTER
, client
,
296 ICL_TYPE_FID
, &Sfid
);
300 if (!once
&& *expp
) {
301 afs_nobody
= (*expp
)->exi_export
.ex_anon
;
305 afs_nfsclient_reqhandler((struct afs_exporter
*)0, &crp
, client
,
320 afs_nfs2_smallfidder(struct nfsdiropres
*dr
)
322 fhandle_t
*fhp
= (fhandle_t
*) & dr
->dr_fhandle
;
326 #if defined(AFS_SUN5_64BIT_ENV)
327 /* See also afs_fid() */
328 memcpy((char *)addr
, fhp
->fh_data
, SIZEOF_SMALLFID
);
329 addr
[1] = (addr
[1] >> 48) & 0xffff;
331 memcpy((char *)addr
, fhp
->fh_data
, 2 * sizeof(long));
335 vcp
= VTOAFS((struct vnode
*)addr
[0]);
337 if (addr
[1] == AFS_XLATOR_MAGIC
) {
338 if (dr
->dr_status
== NFS_OK
) {
339 struct SmallFid Sfid
;
342 /* Make up and copy out a SmallFid */
343 tcell
= afs_GetCell(vcp
->f
.fid
.Cell
, READ_LOCK
);
344 Sfid
.Volume
= vcp
->f
.fid
.Fid
.Volume
;
346 ((tcell
->cellIndex
<< 24) | (vcp
->f
.fid
.Fid
.Unique
& 0xffffff));
347 afs_PutCell(tcell
, READ_LOCK
);
348 Sfid
.Vnode
= (u_short
) (vcp
->f
.fid
.Fid
.Vnode
& 0xffff);
349 fhp
->fh_len
= SIZEOF_SMALLFID
;
350 memcpy(dr
->dr_fhandle
.fh_data
, (char *)&Sfid
, fhp
->fh_len
);
352 afs_Trace3(afs_iclSetp
, CM_TRACE_NFSOUT
, ICL_TYPE_INT32
, 0,
353 ICL_TYPE_POINTER
, vcp
, ICL_TYPE_FID
, &Sfid
);
356 /* If we have a ref, release it */
357 if (vcp
->vrefCount
>= 1)
358 AFS_RELE(AFSTOV(vcp
));
364 afs_nfs2_noaccess(struct afs_nfs2_resp
*resp
)
366 resp
->status
= NFSERR_ACCES
;
370 afs_nfs2_null(char *args
, char *xp
, char *exp
, char *rp
, char *crp
)
375 afs_nfs2_root(char *args
, char *xp
, char *exp
, char *rp
, char *crp
)
380 afs_nfs2_writecache(char *args
, char *xp
, char *exp
, char *rp
, char *crp
)
385 afs_nfs2_getattr(char *args
, char *xp
, char *exp
, char *rp
, char *crp
)
388 afs_ucred_t
*svcred
= curthread
->t_cred
;
389 curthread
->t_cred
= (afs_ucred_t
*)crp
;
390 call
= afs_nfs2_dispatcher(0, RFS_GETATTR
, (char *)args
, &exp
, rp
, crp
);
392 afs_nfs2_noaccess((struct afs_nfs2_resp
*)xp
);
394 (*afs_rfs_disp_tbl
[RFS_GETATTR
].orig_proc
) (args
, xp
, exp
, rp
, crp
);
395 curthread
->t_cred
= svcred
;
400 afs_nfs2_setattr(char *args
, char *xp
, char *exp
, char *rp
, char *crp
)
403 afs_ucred_t
*svcred
= curthread
->t_cred
;
404 curthread
->t_cred
= (afs_ucred_t
*)crp
;
405 call
= afs_nfs2_dispatcher(0, RFS_SETATTR
, (char *)args
, &exp
, rp
, crp
);
407 afs_nfs2_noaccess((struct afs_nfs2_resp
*)xp
);
409 (*afs_rfs_disp_tbl
[RFS_SETATTR
].orig_proc
) (args
, xp
, exp
, rp
, crp
);
410 curthread
->t_cred
= svcred
;
415 afs_nfs2_lookup(char *args
, char *xp
, char *exp
, char *rp
, char *crp
)
418 afs_ucred_t
*svcred
= curthread
->t_cred
;
419 curthread
->t_cred
= (afs_ucred_t
*)crp
;
420 call
= afs_nfs2_dispatcher(0, RFS_LOOKUP
, (char *)args
, &exp
, rp
, crp
);
422 afs_nfs2_noaccess((struct afs_nfs2_resp
*)xp
);
424 (*afs_rfs_disp_tbl
[RFS_LOOKUP
].orig_proc
) (args
, xp
, exp
, rp
, crp
);
425 if (afs_NFSRootOnly
&& call
)
426 afs_nfs2_smallfidder(xp
);
428 curthread
->t_cred
= svcred
;
433 afs_nfs2_readlink(char *args
, char *xp
, char *exp
, char *rp
, char *crp
)
436 afs_ucred_t
*svcred
= curthread
->t_cred
;
437 curthread
->t_cred
= (afs_ucred_t
*)crp
;
438 call
= afs_nfs2_dispatcher(0, RFS_READLINK
, (char *)args
, &exp
, rp
, crp
);
440 afs_nfs2_noaccess((struct afs_nfs2_resp
*)xp
);
442 (*afs_rfs_disp_tbl
[RFS_READLINK
].orig_proc
) (args
, xp
, exp
, rp
, crp
);
443 curthread
->t_cred
= svcred
;
448 afs_nfs2_read(char *args
, char *xp
, char *exp
, char *rp
, char *crp
)
451 afs_ucred_t
*svcred
= curthread
->t_cred
;
452 curthread
->t_cred
= (afs_ucred_t
*)crp
;
453 call
= afs_nfs2_dispatcher(0, RFS_READ
, (char *)args
, &exp
, rp
, crp
);
455 afs_nfs2_noaccess((struct afs_nfs2_resp
*)xp
);
457 (*afs_rfs_disp_tbl
[RFS_READ
].orig_proc
) (args
, xp
, exp
, rp
, crp
);
458 curthread
->t_cred
= svcred
;
463 afs_nfs2_write(char *args
, char *xp
, char *exp
, char *rp
, char *crp
)
466 afs_ucred_t
*svcred
= curthread
->t_cred
;
467 curthread
->t_cred
= (afs_ucred_t
*)crp
;
468 call
= afs_nfs2_dispatcher(0, RFS_WRITE
, (char *)args
, &exp
, rp
, crp
);
470 afs_nfs2_noaccess((struct afs_nfs2_resp
*)xp
);
472 (*afs_rfs_disp_tbl
[RFS_WRITE
].orig_proc
) (args
, xp
, exp
, rp
, crp
);
473 curthread
->t_cred
= svcred
;
478 afs_nfs2_create(char *args
, char *xp
, char *exp
, char *rp
, char *crp
)
481 afs_ucred_t
*svcred
= curthread
->t_cred
;
482 curthread
->t_cred
= (afs_ucred_t
*)crp
;
483 call
= afs_nfs2_dispatcher(0, RFS_CREATE
, (char *)args
, &exp
, rp
, crp
);
485 afs_nfs2_noaccess((struct afs_nfs2_resp
*)xp
);
487 (*afs_rfs_disp_tbl
[RFS_CREATE
].orig_proc
) (args
, xp
, exp
, rp
, crp
);
488 if (afs_NFSRootOnly
&& call
)
489 afs_nfs2_smallfidder(xp
);
491 curthread
->t_cred
= svcred
;
496 afs_nfs2_remove(char *args
, char *xp
, char *exp
, char *rp
, char *crp
)
499 afs_ucred_t
*svcred
= curthread
->t_cred
;
500 curthread
->t_cred
= (afs_ucred_t
*)crp
;
501 call
= afs_nfs2_dispatcher(0, RFS_REMOVE
, (char *)args
, &exp
, rp
, crp
);
503 afs_nfs2_noaccess((struct afs_nfs2_resp
*)xp
);
505 (*afs_rfs_disp_tbl
[RFS_REMOVE
].orig_proc
) (args
, xp
, exp
, rp
, crp
);
506 curthread
->t_cred
= svcred
;
511 afs_nfs2_rename(char *args
, char *xp
, char *exp
, char *rp
, char *crp
)
514 afs_ucred_t
*svcred
= curthread
->t_cred
;
515 curthread
->t_cred
= (afs_ucred_t
*)crp
;
516 call
= afs_nfs2_dispatcher(0, RFS_RENAME
, (char *)args
, &exp
, rp
, crp
);
518 afs_nfs2_noaccess((struct afs_nfs2_resp
*)xp
);
520 (*afs_rfs_disp_tbl
[RFS_RENAME
].orig_proc
) (args
, xp
, exp
, rp
, crp
);
521 curthread
->t_cred
= svcred
;
526 afs_nfs2_link(char *args
, char *xp
, char *exp
, char *rp
, char *crp
)
529 afs_ucred_t
*svcred
= curthread
->t_cred
;
530 curthread
->t_cred
= (afs_ucred_t
*)crp
;
531 call
= afs_nfs2_dispatcher(0, RFS_LINK
, (char *)args
, &exp
, rp
, crp
);
533 afs_nfs2_noaccess((struct afs_nfs2_resp
*)xp
);
535 (*afs_rfs_disp_tbl
[RFS_LINK
].orig_proc
) (args
, xp
, exp
, rp
, crp
);
536 curthread
->t_cred
= svcred
;
541 afs_nfs2_symlink(char *args
, char *xp
, char *exp
, char *rp
, char *crp
)
544 afs_ucred_t
*svcred
= curthread
->t_cred
;
545 curthread
->t_cred
= (afs_ucred_t
*)crp
;
546 call
= afs_nfs2_dispatcher(0, RFS_SYMLINK
, (char *)args
, &exp
, rp
, crp
);
548 afs_nfs2_noaccess((struct afs_nfs2_resp
*)xp
);
550 (*afs_rfs_disp_tbl
[RFS_SYMLINK
].orig_proc
) (args
, xp
, exp
, rp
, crp
);
551 curthread
->t_cred
= svcred
;
556 afs_nfs2_mkdir(char *args
, char *xp
, char *exp
, char *rp
, char *crp
)
559 afs_ucred_t
*svcred
= curthread
->t_cred
;
560 curthread
->t_cred
= (afs_ucred_t
*)crp
;
561 call
= afs_nfs2_dispatcher(0, RFS_MKDIR
, (char *)args
, &exp
, rp
, crp
);
563 afs_nfs2_noaccess((struct afs_nfs2_resp
*)xp
);
565 (*afs_rfs_disp_tbl
[RFS_MKDIR
].orig_proc
) (args
, xp
, exp
, rp
, crp
);
566 if (afs_NFSRootOnly
&& call
)
567 afs_nfs2_smallfidder(xp
);
569 curthread
->t_cred
= svcred
;
574 afs_nfs2_rmdir(char *args
, char *xp
, char *exp
, char *rp
, char *crp
)
577 afs_ucred_t
*svcred
= curthread
->t_cred
;
578 curthread
->t_cred
= (afs_ucred_t
*)crp
;
579 call
= afs_nfs2_dispatcher(0, RFS_RMDIR
, (char *)args
, &exp
, rp
, crp
);
581 afs_nfs2_noaccess((struct afs_nfs2_resp
*)xp
);
583 (*afs_rfs_disp_tbl
[RFS_RMDIR
].orig_proc
) (args
, xp
, exp
, rp
, crp
);
584 curthread
->t_cred
= svcred
;
589 afs_nfs2_readdir(char *args
, char *xp
, char *exp
, char *rp
, char *crp
)
592 afs_ucred_t
*svcred
= curthread
->t_cred
;
593 curthread
->t_cred
= (afs_ucred_t
*)crp
;
594 call
= afs_nfs2_dispatcher(0, RFS_READDIR
, (char *)args
, &exp
, rp
, crp
);
596 afs_nfs2_noaccess((struct afs_nfs2_resp
*)xp
);
598 (*afs_rfs_disp_tbl
[RFS_READDIR
].orig_proc
) (args
, xp
, exp
, rp
, crp
);
599 curthread
->t_cred
= svcred
;
604 afs_nfs2_statfs(char *args
, char *xp
, char *exp
, char *rp
, char *crp
)
607 afs_ucred_t
*svcred
= curthread
->t_cred
;
608 curthread
->t_cred
= (afs_ucred_t
*)crp
;
609 call
= afs_nfs2_dispatcher(0, RFS_STATFS
, (char *)args
, &exp
, rp
, crp
);
611 afs_nfs2_noaccess((struct afs_nfs2_resp
*)xp
);
613 (*afs_rfs_disp_tbl
[RFS_STATFS
].orig_proc
) (args
, xp
, exp
, rp
, crp
);
614 curthread
->t_cred
= svcred
;
618 struct afs_nfs_disp_tbl afs_rfs_disp_tbl
[RFS_NPROC
] = {
626 {afs_nfs2_writecache
},
640 afs_acl2_getacl(char *args
, char *xp
, char *exp
, char *rp
, char *crp
)
643 afs_ucred_t
*svcred
= curthread
->t_cred
;
644 curthread
->t_cred
= (afs_ucred_t
*)crp
;
646 afs_nfs2_dispatcher(1, ACLPROC2_GETACL
, (char *)args
, &exp
, rp
, crp
);
648 afs_nfs2_noaccess((struct afs_nfs2_resp
*)xp
);
650 (*afs_acl_disp_tbl
[ACLPROC2_GETACL
].orig_proc
) (args
, xp
, exp
, rp
,
652 curthread
->t_cred
= svcred
;
657 afs_acl2_setacl(char *args
, char *xp
, char *exp
, char *rp
, char *crp
)
660 afs_ucred_t
*svcred
= curthread
->t_cred
;
661 curthread
->t_cred
= (afs_ucred_t
*)crp
;
663 afs_nfs2_dispatcher(1, ACLPROC2_SETACL
, (char *)args
, &exp
, rp
, crp
);
665 afs_nfs2_noaccess((struct afs_nfs2_resp
*)xp
);
667 (*afs_acl_disp_tbl
[ACLPROC2_SETACL
].orig_proc
) (args
, xp
, exp
, rp
,
669 curthread
->t_cred
= svcred
;
674 afs_acl2_getattr(char *args
, char *xp
, char *exp
, char *rp
, char *crp
)
677 afs_ucred_t
*svcred
= curthread
->t_cred
;
678 curthread
->t_cred
= (afs_ucred_t
*)crp
;
680 afs_nfs2_dispatcher(1, ACLPROC2_GETATTR
, (char *)args
, &exp
, rp
, crp
);
682 afs_nfs2_noaccess((struct afs_nfs2_resp
*)xp
);
684 (*afs_acl_disp_tbl
[ACLPROC2_GETATTR
].orig_proc
) (args
, xp
, exp
, rp
,
686 curthread
->t_cred
= svcred
;
691 afs_acl2_access(char *args
, char *xp
, char *exp
, char *rp
, char *crp
)
694 afs_ucred_t
*svcred
= curthread
->t_cred
;
695 curthread
->t_cred
= (afs_ucred_t
*)crp
;
697 afs_nfs2_dispatcher(1, ACLPROC2_ACCESS
, (char *)args
, &exp
, rp
, crp
);
699 afs_nfs2_noaccess((struct afs_nfs2_resp
*)xp
);
701 (*afs_acl_disp_tbl
[ACLPROC2_ACCESS
].orig_proc
) (args
, xp
, exp
, rp
,
703 curthread
->t_cred
= svcred
;
707 #if defined(AFS_SUN510_ENV)
709 afs_acl2_getxattrdir(char *args
, char *xp
, char *exp
, char *rp
, char *crp
)
712 afs_ucred_t
*svcred
= curthread
->t_cred
;
713 curthread
->t_cred
= (afs_ucred_t
*)crp
;
715 afs_nfs2_dispatcher(1, ACLPROC2_GETXATTRDIR
, (char *)args
, &exp
, rp
, crp
);
717 afs_nfs2_noaccess((struct afs_nfs2_resp
*)xp
);
719 (*afs_acl_disp_tbl
[ACLPROC2_GETXATTRDIR
].orig_proc
) (args
, xp
, exp
, rp
,
721 curthread
->t_cred
= svcred
;
726 struct afs_nfs_disp_tbl afs_acl_disp_tbl
[ACL2_NPROC
] = {
732 #if defined(AFS_SUN510_ENV)
733 {afs_acl2_getxattrdir
}
737 /* Munge the dispatch tables to link us in first */
739 afs_xlatorinit_v2(struct rfs_disp_tbl
*_rfs_tbl
,
740 struct rfs_disp_tbl
*_acl_tbl
)
744 if (xlatorinit_v2_done
++)
747 for (i
= 0; i
< RFS_NPROC
; i
++) {
748 afs_rfs_disp_tbl
[i
].orig_proc
= _rfs_tbl
[i
].dis_proc
;
749 _rfs_tbl
[i
].dis_proc
= afs_rfs_disp_tbl
[i
].afs_proc
;
752 for (i
= 0; i
< 5; i
++) {
753 afs_acl_disp_tbl
[i
].orig_proc
= _acl_tbl
[i
].dis_proc
;
754 _acl_tbl
[i
].dis_proc
= afs_acl_disp_tbl
[i
].afs_proc
;
759 #define RFS3_NPROC 22
763 #if defined(AFS_SUN510_ENV)
770 struct afs_nfs_disp_tbl afs_rfs3_disp_tbl
[RFS3_NPROC
];
771 struct afs_nfs_disp_tbl afs_acl3_disp_tbl
[ACL3_NPROC
];
773 struct afs_nfs3_resp
{
777 typedef struct afs_nfs3_resp afs_nfs3_resp
;
780 is_afs_fh3(nfs_fh3
* fhp
)
782 if ((fhp
->fh3_fsid
.val
[0] == AFS_VFSMAGIC
)
783 && (fhp
->fh3_fsid
.val
[1] == AFS_VFSFSID
))
789 afs_nfs3_noaccess(struct afs_nfs3_resp
*resp
)
791 resp
->status
= NFS3ERR_ACCES
;
796 afs_nfs3_notsupp(struct afs_nfs3_resp
*resp
)
798 resp
->status
= NFS3ERR_NOTSUPP
;
803 nfs3_to_afs_call(int which
, caddr_t
* args
, nfs_fh3
** fhpp
, nfs_fh3
** fh2pp
)
810 afs_Trace1(afs_iclSetp
, CM_TRACE_NFS3IN
, ICL_TYPE_INT32
, which
);
811 *fh2pp
= (nfs_fh3
*) 0;
813 case NFSPROC3_GETATTR
:
815 GETATTR3args
*arg
= (GETATTR3args
*) args
;
816 fhp1
= (nfs_fh3
*) & arg
->object
;
819 case NFSPROC3_SETATTR
:
821 SETATTR3args
*arg
= (SETATTR3args
*) args
;
822 fhp1
= (nfs_fh3
*) & arg
->object
;
825 case NFSPROC3_LOOKUP
:
827 LOOKUP3args
*arg
= (LOOKUP3args
*) args
;
828 fhp1
= (nfs_fh3
*) arg
->what
.dirp
;
831 case NFSPROC3_ACCESS
:
833 ACCESS3args
*arg
= (ACCESS3args
*) args
;
834 fhp1
= (nfs_fh3
*) & arg
->object
;
837 case NFSPROC3_READLINK
:
839 READLINK3args
*arg
= (READLINK3args
*) args
;
840 fhp1
= (nfs_fh3
*) & arg
->symlink
;
845 READ3args
*arg
= (READ3args
*) args
;
846 fhp1
= (nfs_fh3
*) & arg
->file
;
851 WRITE3args
*arg
= (WRITE3args
*) args
;
852 fhp1
= (nfs_fh3
*) & arg
->file
;
855 case NFSPROC3_CREATE
:
857 CREATE3args
*arg
= (CREATE3args
*) args
;
858 fhp1
= (nfs_fh3
*) arg
->where
.dirp
;
863 MKDIR3args
*arg
= (MKDIR3args
*) args
;
864 fhp1
= (nfs_fh3
*) arg
->where
.dirp
;
867 case NFSPROC3_SYMLINK
:
869 SYMLINK3args
*arg
= (SYMLINK3args
*) args
;
870 fhp1
= (nfs_fh3
*) arg
->where
.dirp
;
875 MKNOD3args
*arg
= (MKNOD3args
*) args
;
876 fhp1
= (nfs_fh3
*) arg
->where
.dirp
;
879 case NFSPROC3_REMOVE
:
881 REMOVE3args
*arg
= (REMOVE3args
*) args
;
882 fhp1
= (nfs_fh3
*) arg
->object
.dirp
;
887 RMDIR3args
*arg
= (RMDIR3args
*) args
;
888 fhp1
= (nfs_fh3
*) arg
->object
.dirp
;
891 case NFSPROC3_RENAME
:
893 RENAME3args
*arg
= (RENAME3args
*) args
;
894 fhp1
= (nfs_fh3
*) arg
->from
.dirp
;
895 fhp2
= (nfs_fh3
*) arg
->to
.dirp
;
900 LINK3args
*arg
= (LINK3args
*) args
;
901 fhp1
= (nfs_fh3
*) & arg
->file
;
902 fhp2
= (nfs_fh3
*) arg
->link
.dirp
;
905 case NFSPROC3_READDIR
:
907 READDIR3args
*arg
= (READDIR3args
*) args
;
908 fhp1
= (nfs_fh3
*) & arg
->dir
;
911 case NFSPROC3_READDIRPLUS
:
913 READDIRPLUS3args
*arg
= (READDIRPLUS3args
*) args
;
914 fhp1
= (nfs_fh3
*) & arg
->dir
;
917 case NFSPROC3_FSSTAT
:
919 FSSTAT3args
*arg
= (FSSTAT3args
*) args
;
920 fhp1
= (nfs_fh3
*) & arg
->fsroot
;
923 case NFSPROC3_FSINFO
:
925 FSINFO3args
*arg
= (FSINFO3args
*) args
;
926 fhp1
= (nfs_fh3
*) & arg
->fsroot
;
929 case NFSPROC3_PATHCONF
:
931 PATHCONF3args
*arg
= (PATHCONF3args
*) args
;
932 fhp1
= (nfs_fh3
*) & arg
->object
;
935 case NFSPROC3_COMMIT
:
937 COMMIT3args
*arg
= (COMMIT3args
*) args
;
938 fhp1
= (nfs_fh3
*) & arg
->file
;
945 if (fhp1
&& is_afs_fh3(fhp1
)) {
951 if (fhp2
&& is_afs_fh3(fhp2
)) {
960 acl3_to_afs_call(int which
, caddr_t
* args
, nfs_fh3
** fhpp
)
965 case ACLPROC3_GETACL
:
967 struct GETACL3args
*sargs
= (struct GETACL3args
*)args
;
971 case ACLPROC3_SETACL
:
973 struct SETACL3args
*sargs
= (struct SETACL3args
*)args
;
977 #if defined(AFS_SUN510_ENV)
978 case ACLPROC3_GETXATTRDIR
:
980 struct GETXATTRDIR3args
*sargs
= (struct GETXATTRDIR3args
*)args
;
989 if (fhp
&& is_afs_fh3(fhp
)) {
998 afs_nfs3_dispatcher(int type
, afs_int32 which
, char *argp
,
999 struct exportinfo
**expp
, struct svc_req
*rp
,
1004 afs_int32 client
= 0;
1005 struct sockaddr
*sa
;
1006 nfs_fh3
*fh
= (nfs_fh3
*) argp
;
1007 nfs_fh3
*fh2
= (nfs_fh3
*) 0;
1009 if (!xlatorinit_v3_done
)
1012 sa
= (struct sockaddr
*)svc_getrpccaller(rp
->rq_xprt
)->buf
;
1016 if (sa
->sa_family
== AF_INET
)
1017 client
= ((struct sockaddr_in
*)sa
)->sin_addr
.s_addr
;
1023 code
= (client
&& nfs3_to_afs_call(which
, argp
, &fh
, &fh2
));
1026 code
= (client
&& acl3_to_afs_call(which
, argp
, &fh
));
1033 struct afs_exporter
*out
= 0;
1035 static int once
= 0;
1036 struct SmallFid Sfid
;
1038 memcpy((char *)&Sfid
, fh
->fh3_data
, SIZEOF_SMALLFID
);
1040 afs_Trace2(afs_iclSetp
, CM_TRACE_NFS3IN1
, ICL_TYPE_INT32
, client
,
1041 ICL_TYPE_FID
, &Sfid
);
1044 if (!once
&& *expp
) {
1045 afs_nobody
= (*expp
)->exi_export
.ex_anon
;
1049 afs_nfsclient_reqhandler((struct afs_exporter
*)0, &crp
, client
,
1065 afs_nfs3_smallfidder(struct nfs_fh3
*fhp
, int status
)
1070 #if defined(AFS_SUN5_64BIT_ENV)
1071 /* See also afs_fid() */
1072 memcpy((char *)addr
, fhp
->fh3_data
, 10);
1073 addr
[1] = (addr
[1] >> 48) & 0xffff;
1075 memcpy((char *)addr
, fhp
->fh3_data
, 2 * sizeof(long));
1079 vcp
= VTOAFS((struct vnode
*)addr
[0]);
1081 /* See also afs_osi_vget */
1082 if (addr
[1] == AFS_XLATOR_MAGIC
) {
1083 if (status
== NFS_OK
) {
1084 struct SmallFid Sfid
;
1087 /* Make up and copy out a SmallFid */
1088 tcell
= afs_GetCell(vcp
->f
.fid
.Cell
, READ_LOCK
);
1089 Sfid
.Volume
= vcp
->f
.fid
.Fid
.Volume
;
1090 Sfid
.CellAndUnique
=
1091 ((tcell
->cellIndex
<< 24) | (vcp
->f
.fid
.Fid
.Unique
& 0xffffff));
1092 afs_PutCell(tcell
, READ_LOCK
);
1093 Sfid
.Vnode
= (u_short
) (vcp
->f
.fid
.Fid
.Vnode
& 0xffff);
1094 fhp
->fh3_len
= SIZEOF_SMALLFID
;
1095 memcpy(fhp
->fh3_data
, (char *)&Sfid
, fhp
->fh3_len
);
1097 afs_Trace3(afs_iclSetp
, CM_TRACE_NFS3OUT
, ICL_TYPE_INT32
, status
,
1098 ICL_TYPE_POINTER
, vcp
, ICL_TYPE_FID
, &Sfid
);
1101 /* If we have a ref, release it */
1102 if (vcp
->vrefCount
>= 1)
1103 AFS_RELE(AFSTOV(vcp
));
1109 afs_nfs3_getattr(char *args
, char *xp
, char *exp
, char *rp
, char *crp
)
1112 afs_nfs3_resp dummy
;
1113 afs_ucred_t
*svcred
= curthread
->t_cred
;
1114 curthread
->t_cred
= (afs_ucred_t
*)crp
;
1116 afs_nfs3_dispatcher(0, NFSPROC3_GETATTR
, (char *)args
, &exp
, rp
, crp
);
1118 afs_nfs3_noaccess((struct afs_nfs3_resp
*)xp
);
1120 (*afs_rfs3_disp_tbl
[NFSPROC3_GETATTR
].orig_proc
) (args
, xp
, exp
, rp
,
1122 curthread
->t_cred
= svcred
;
1127 afs_nfs3_setattr(char *args
, char *xp
, char *exp
, char *rp
, char *crp
)
1130 afs_nfs3_resp dummy
;
1131 afs_ucred_t
*svcred
= curthread
->t_cred
;
1132 curthread
->t_cred
= (afs_ucred_t
*)crp
;
1134 afs_nfs3_dispatcher(0, NFSPROC3_SETATTR
, (char *)args
, &exp
, rp
, crp
);
1136 afs_nfs3_noaccess((struct afs_nfs3_resp
*)xp
);
1138 (*afs_rfs3_disp_tbl
[NFSPROC3_SETATTR
].orig_proc
) (args
, xp
, exp
, rp
,
1140 curthread
->t_cred
= svcred
;
1145 afs_nfs3_lookup(char *args
, char *xp
, char *exp
, char *rp
, char *crp
)
1148 afs_nfs3_resp dummy
;
1149 afs_ucred_t
*svcred
= curthread
->t_cred
;
1150 curthread
->t_cred
= (afs_ucred_t
*)crp
;
1152 afs_nfs3_dispatcher(0, NFSPROC3_LOOKUP
, (char *)args
, &exp
, rp
, crp
);
1154 afs_nfs3_noaccess((struct afs_nfs3_resp
*)xp
);
1156 (*afs_rfs3_disp_tbl
[NFSPROC3_LOOKUP
].orig_proc
) (args
, xp
, exp
, rp
,
1158 if (afs_NFSRootOnly
&& call
) {
1159 LOOKUP3res
*resp
= (LOOKUP3res
*) xp
;
1160 afs_nfs3_smallfidder(&resp
->resok
.object
, resp
->status
);
1163 curthread
->t_cred
= svcred
;
1168 afs_nfs3_access(char *args
, char *xp
, char *exp
, char *rp
, char *crp
)
1171 afs_nfs3_resp dummy
;
1172 afs_ucred_t
*svcred
= curthread
->t_cred
;
1173 curthread
->t_cred
= (afs_ucred_t
*)crp
;
1175 afs_nfs3_dispatcher(0, NFSPROC3_ACCESS
, (char *)args
, &exp
, rp
, crp
);
1177 afs_nfs3_noaccess((struct afs_nfs3_resp
*)xp
);
1179 (*afs_rfs3_disp_tbl
[NFSPROC3_ACCESS
].orig_proc
) (args
, xp
, exp
, rp
,
1181 curthread
->t_cred
= svcred
;
1186 afs_nfs3_readlink(char *args
, char *xp
, char *exp
, char *rp
, char *crp
)
1189 afs_nfs3_resp dummy
;
1190 afs_ucred_t
*svcred
= curthread
->t_cred
;
1191 curthread
->t_cred
= (afs_ucred_t
*)crp
;
1193 afs_nfs3_dispatcher(0, NFSPROC3_READLINK
, (char *)args
, &exp
, rp
,
1196 afs_nfs3_noaccess((struct afs_nfs3_resp
*)xp
);
1198 (*afs_rfs3_disp_tbl
[NFSPROC3_READLINK
].orig_proc
) (args
, xp
, exp
, rp
,
1200 curthread
->t_cred
= svcred
;
1205 afs_nfs3_read(char *args
, char *xp
, char *exp
, char *rp
, char *crp
)
1208 afs_nfs3_resp dummy
;
1209 afs_ucred_t
*svcred
= curthread
->t_cred
;
1210 curthread
->t_cred
= (afs_ucred_t
*)crp
;
1211 call
= afs_nfs3_dispatcher(0, NFSPROC3_READ
, (char *)args
, &exp
, rp
, crp
);
1213 afs_nfs3_noaccess((struct afs_nfs3_resp
*)xp
);
1215 (*afs_rfs3_disp_tbl
[NFSPROC3_READ
].orig_proc
) (args
, xp
, exp
, rp
,
1217 curthread
->t_cred
= svcred
;
1222 afs_nfs3_write(char *args
, char *xp
, char *exp
, char *rp
, char *crp
)
1225 afs_nfs3_resp dummy
;
1226 afs_ucred_t
*svcred
= curthread
->t_cred
;
1227 curthread
->t_cred
= (afs_ucred_t
*)crp
;
1229 afs_nfs3_dispatcher(0, NFSPROC3_WRITE
, (char *)args
, &exp
, rp
, crp
);
1231 afs_nfs3_noaccess((struct afs_nfs3_resp
*)xp
);
1233 (*afs_rfs3_disp_tbl
[NFSPROC3_WRITE
].orig_proc
) (args
, xp
, exp
, rp
,
1235 curthread
->t_cred
= svcred
;
1240 afs_nfs3_create(char *args
, char *xp
, char *exp
, char *rp
, char *crp
)
1243 afs_nfs3_resp dummy
;
1244 afs_ucred_t
*svcred
= curthread
->t_cred
;
1245 curthread
->t_cred
= (afs_ucred_t
*)crp
;
1247 afs_nfs3_dispatcher(0, NFSPROC3_CREATE
, (char *)args
, &exp
, rp
, crp
);
1249 afs_nfs3_noaccess((struct afs_nfs3_resp
*)xp
);
1251 (*afs_rfs3_disp_tbl
[NFSPROC3_CREATE
].orig_proc
) (args
, xp
, exp
, rp
,
1253 if (afs_NFSRootOnly
&& call
) {
1254 CREATE3res
*resp
= (CREATE3res
*) xp
;
1255 afs_nfs3_smallfidder(&resp
->resok
.obj
.handle
, resp
->status
);
1258 curthread
->t_cred
= svcred
;
1263 afs_nfs3_mkdir(char *args
, char *xp
, char *exp
, char *rp
, char *crp
)
1266 afs_nfs3_resp dummy
;
1267 afs_ucred_t
*svcred
= curthread
->t_cred
;
1268 curthread
->t_cred
= (afs_ucred_t
*)crp
;
1270 afs_nfs3_dispatcher(0, NFSPROC3_MKDIR
, (char *)args
, &exp
, rp
, crp
);
1272 afs_nfs3_noaccess((struct afs_nfs3_resp
*)xp
);
1274 (*afs_rfs3_disp_tbl
[NFSPROC3_MKDIR
].orig_proc
) (args
, xp
, exp
, rp
,
1276 if (afs_NFSRootOnly
&& call
) {
1277 MKDIR3res
*resp
= (MKDIR3res
*) xp
;
1278 afs_nfs3_smallfidder(&resp
->resok
.obj
.handle
, resp
->status
);
1281 curthread
->t_cred
= svcred
;
1286 afs_nfs3_symlink(char *args
, char *xp
, char *exp
, char *rp
, char *crp
)
1289 afs_nfs3_resp dummy
;
1290 afs_ucred_t
*svcred
= curthread
->t_cred
;
1291 curthread
->t_cred
= (afs_ucred_t
*)crp
;
1293 afs_nfs3_dispatcher(0, NFSPROC3_SYMLINK
, (char *)args
, &exp
, rp
, crp
);
1295 afs_nfs3_noaccess((struct afs_nfs3_resp
*)xp
);
1297 (*afs_rfs3_disp_tbl
[NFSPROC3_SYMLINK
].orig_proc
) (args
, xp
, exp
, rp
,
1299 if (afs_NFSRootOnly
&& call
) {
1300 SYMLINK3res
*resp
= (SYMLINK3res
*) xp
;
1301 afs_nfs3_smallfidder(&resp
->resok
.obj
.handle
, resp
->status
);
1304 curthread
->t_cred
= svcred
;
1309 afs_nfs3_mknod(char *args
, char *xp
, char *exp
, char *rp
, char *crp
)
1312 afs_nfs3_resp dummy
;
1313 afs_ucred_t
*svcred
= curthread
->t_cred
;
1314 curthread
->t_cred
= (afs_ucred_t
*)crp
;
1316 afs_nfs3_dispatcher(0, NFSPROC3_MKNOD
, (char *)args
, &exp
, rp
, crp
);
1318 afs_nfs3_noaccess((struct afs_nfs3_resp
*)xp
);
1320 (*afs_rfs3_disp_tbl
[NFSPROC3_MKNOD
].orig_proc
) (args
, xp
, exp
, rp
,
1322 if (afs_NFSRootOnly
&& call
) {
1323 MKNOD3res
*resp
= (MKNOD3res
*) xp
;
1324 afs_nfs3_smallfidder(&resp
->resok
.obj
.handle
, resp
->status
);
1327 curthread
->t_cred
= svcred
;
1332 afs_nfs3_remove(char *args
, char *xp
, char *exp
, char *rp
, char *crp
)
1335 afs_nfs3_resp dummy
;
1336 afs_ucred_t
*svcred
= curthread
->t_cred
;
1337 curthread
->t_cred
= (afs_ucred_t
*)crp
;
1339 afs_nfs3_dispatcher(0, NFSPROC3_REMOVE
, (char *)args
, &exp
, rp
, crp
);
1341 afs_nfs3_noaccess((struct afs_nfs3_resp
*)xp
);
1343 (*afs_rfs3_disp_tbl
[NFSPROC3_REMOVE
].orig_proc
) (args
, xp
, exp
, rp
,
1345 curthread
->t_cred
= svcred
;
1350 afs_nfs3_rmdir(char *args
, char *xp
, char *exp
, char *rp
, char *crp
)
1353 afs_nfs3_resp dummy
;
1354 afs_ucred_t
*svcred
= curthread
->t_cred
;
1355 curthread
->t_cred
= (afs_ucred_t
*)crp
;
1357 afs_nfs3_dispatcher(0, NFSPROC3_RMDIR
, (char *)args
, &exp
, rp
, crp
);
1359 afs_nfs3_noaccess((struct afs_nfs3_resp
*)xp
);
1361 (*afs_rfs3_disp_tbl
[NFSPROC3_RMDIR
].orig_proc
) (args
, xp
, exp
, rp
,
1363 curthread
->t_cred
= svcred
;
1368 afs_nfs3_rename(char *args
, char *xp
, char *exp
, char *rp
, char *crp
)
1371 afs_nfs3_resp dummy
;
1372 afs_ucred_t
*svcred
= curthread
->t_cred
;
1373 curthread
->t_cred
= (afs_ucred_t
*)crp
;
1375 afs_nfs3_dispatcher(0, NFSPROC3_RENAME
, (char *)args
, &exp
, rp
, crp
);
1377 afs_nfs3_noaccess((struct afs_nfs3_resp
*)xp
);
1379 (*afs_rfs3_disp_tbl
[NFSPROC3_RENAME
].orig_proc
) (args
, xp
, exp
, rp
,
1381 curthread
->t_cred
= svcred
;
1386 afs_nfs3_link(char *args
, char *xp
, char *exp
, char *rp
, char *crp
)
1389 afs_nfs3_resp dummy
;
1390 afs_ucred_t
*svcred
= curthread
->t_cred
;
1391 curthread
->t_cred
= (afs_ucred_t
*)crp
;
1392 call
= afs_nfs3_dispatcher(0, NFSPROC3_LINK
, (char *)args
, &exp
, rp
, crp
);
1394 afs_nfs3_noaccess((struct afs_nfs3_resp
*)xp
);
1396 (*afs_rfs3_disp_tbl
[NFSPROC3_LINK
].orig_proc
) (args
, xp
, exp
, rp
,
1398 curthread
->t_cred
= svcred
;
1403 afs_nfs3_readdir(char *args
, char *xp
, char *exp
, char *rp
, char *crp
)
1406 afs_nfs3_resp dummy
;
1407 afs_ucred_t
*svcred
= curthread
->t_cred
;
1408 curthread
->t_cred
= (afs_ucred_t
*)crp
;
1410 afs_nfs3_dispatcher(0, NFSPROC3_READDIR
, (char *)args
, &exp
, rp
, crp
);
1412 afs_nfs3_noaccess((struct afs_nfs3_resp
*)xp
);
1414 (*afs_rfs3_disp_tbl
[NFSPROC3_READDIR
].orig_proc
) (args
, xp
, exp
, rp
,
1416 curthread
->t_cred
= svcred
;
1421 afs_nfs3_readdirplus(char *args
, char *xp
, char *exp
, char *rp
, char *crp
)
1424 afs_nfs3_resp dummy
;
1425 afs_ucred_t
*svcred
= curthread
->t_cred
;
1426 curthread
->t_cred
= (afs_ucred_t
*)crp
;
1428 afs_nfs3_dispatcher(0, NFSPROC3_READDIRPLUS
, (char *)args
, &exp
, rp
,
1431 afs_nfs3_noaccess((struct afs_nfs3_resp
*)xp
);
1433 afs_nfs3_notsupp((struct afs_nfs3_resp
*)xp
);
1435 (*afs_rfs3_disp_tbl
[NFSPROC3_READDIRPLUS
].orig_proc
) (args
, xp
, exp
,
1437 curthread
->t_cred
= svcred
;
1442 afs_nfs3_fsstat(char *args
, char *xp
, char *exp
, char *rp
, char *crp
)
1445 afs_nfs3_resp dummy
;
1446 afs_ucred_t
*svcred
= curthread
->t_cred
;
1447 curthread
->t_cred
= (afs_ucred_t
*)crp
;
1449 afs_nfs3_dispatcher(0, NFSPROC3_FSSTAT
, (char *)args
, &exp
, rp
, crp
);
1451 afs_nfs3_noaccess((struct afs_nfs3_resp
*)xp
);
1453 (*afs_rfs3_disp_tbl
[NFSPROC3_FSSTAT
].orig_proc
) (args
, xp
, exp
, rp
,
1455 curthread
->t_cred
= svcred
;
1460 afs_nfs3_fsinfo(char *args
, char *xp
, char *exp
, char *rp
, char *crp
)
1463 afs_nfs3_resp dummy
;
1464 afs_ucred_t
*svcred
= curthread
->t_cred
;
1465 curthread
->t_cred
= (afs_ucred_t
*)crp
;
1467 afs_nfs3_dispatcher(0, NFSPROC3_FSINFO
, (char *)args
, &exp
, rp
, crp
);
1469 afs_nfs3_noaccess((struct afs_nfs3_resp
*)xp
);
1471 (*afs_rfs3_disp_tbl
[NFSPROC3_FSINFO
].orig_proc
) (args
, xp
, exp
, rp
,
1473 curthread
->t_cred
= svcred
;
1478 afs_nfs3_pathconf(char *args
, char *xp
, char *exp
, char *rp
, char *crp
)
1481 afs_nfs3_resp dummy
;
1482 afs_ucred_t
*svcred
= curthread
->t_cred
;
1483 curthread
->t_cred
= (afs_ucred_t
*)crp
;
1485 afs_nfs3_dispatcher(0, NFSPROC3_PATHCONF
, (char *)args
, &exp
, rp
,
1488 afs_nfs3_noaccess((struct afs_nfs3_resp
*)xp
);
1490 (*afs_rfs3_disp_tbl
[NFSPROC3_PATHCONF
].orig_proc
) (args
, xp
, exp
, rp
,
1492 curthread
->t_cred
= svcred
;
1497 afs_nfs3_commit(char *args
, char *xp
, char *exp
, char *rp
, char *crp
)
1500 afs_nfs3_resp dummy
;
1501 afs_ucred_t
*svcred
= curthread
->t_cred
;
1502 curthread
->t_cred
= (afs_ucred_t
*)crp
;
1504 afs_nfs3_dispatcher(0, NFSPROC3_COMMIT
, (char *)args
, &exp
, rp
, crp
);
1506 afs_nfs3_noaccess((struct afs_nfs3_resp
*)xp
);
1508 (*afs_rfs3_disp_tbl
[NFSPROC3_COMMIT
].orig_proc
) (args
, xp
, exp
, rp
,
1510 curthread
->t_cred
= svcred
;
1514 struct afs_nfs_disp_tbl afs_rfs3_disp_tbl
[22] = {
1520 {afs_nfs3_readlink
},
1532 {afs_nfs3_readdirplus
},
1535 {afs_nfs3_pathconf
},
1540 afs_acl3_getacl(char *args
, char *xp
, char *exp
, char *rp
, char *crp
)
1543 afs_ucred_t
*svcred
= curthread
->t_cred
;
1544 curthread
->t_cred
= (afs_ucred_t
*)crp
;
1546 afs_nfs3_dispatcher(1, ACLPROC3_GETACL
, (char *)args
, &exp
, rp
, crp
);
1548 afs_nfs3_noaccess((struct afs_nfs3_resp
*)xp
);
1550 (*afs_acl3_disp_tbl
[ACLPROC3_GETACL
].orig_proc
) (args
, xp
, exp
, rp
,
1552 curthread
->t_cred
= svcred
;
1557 afs_acl3_setacl(char *args
, char *xp
, char *exp
, char *rp
, char *crp
)
1560 afs_ucred_t
*svcred
= curthread
->t_cred
;
1561 curthread
->t_cred
= (afs_ucred_t
*)crp
;
1563 afs_nfs3_dispatcher(1, ACLPROC3_SETACL
, (char *)args
, &exp
, rp
, crp
);
1565 afs_nfs3_noaccess((struct afs_nfs3_resp
*)xp
);
1567 (*afs_acl3_disp_tbl
[ACLPROC3_SETACL
].orig_proc
) (args
, xp
, exp
, rp
,
1569 curthread
->t_cred
= svcred
;
1573 #if defined(AFS_SUN510_ENV)
1575 afs_acl3_getxattrdir(char *args
, char *xp
, char *exp
, char *rp
, char *crp
)
1578 afs_ucred_t
*svcred
= curthread
->t_cred
;
1579 curthread
->t_cred
= (afs_ucred_t
*)crp
;
1581 afs_nfs3_dispatcher(1, ACLPROC3_GETXATTRDIR
, (char *)args
, &exp
, rp
, crp
);
1583 afs_nfs3_noaccess((struct afs_nfs3_resp
*)xp
);
1585 (*afs_acl3_disp_tbl
[ACLPROC3_GETXATTRDIR
].orig_proc
) (args
, xp
, exp
, rp
,
1587 curthread
->t_cred
= svcred
;
1592 struct afs_nfs_disp_tbl afs_acl3_disp_tbl
[ACL3_NPROC
] = {
1596 #if defined(AFS_SUN510_ENV)
1597 {afs_acl3_getxattrdir
},
1601 /* Munge the dispatch tables to link us in first */
1603 afs_xlatorinit_v3(struct rfs_disp_tbl
*_rfs_tbl
,
1604 struct rfs_disp_tbl
*_acl_tbl
)
1608 if (xlatorinit_v3_done
++)
1611 for (i
= 0; i
< 22; i
++) {
1612 afs_rfs3_disp_tbl
[i
].orig_proc
= _rfs_tbl
[i
].dis_proc
;
1613 _rfs_tbl
[i
].dis_proc
= afs_rfs3_disp_tbl
[i
].afs_proc
;
1616 for (i
= 0; i
< 3; i
++) {
1617 afs_acl3_disp_tbl
[i
].orig_proc
= _acl_tbl
[i
].dis_proc
;
1618 _acl_tbl
[i
].dis_proc
= afs_acl3_disp_tbl
[i
].afs_proc
;
1621 #endif /* !defined(AFS_NONFSTRANS) */