nfstrans-solaris-pre-7-support-20021210
[openafs.git] / src / afs / afs_nfsdisp.c
index feabd4e..e4fbf91 100644 (file)
@@ -8,32 +8,32 @@
  * Implements:
  */
 #include <afsconfig.h>
-#include "../afs/param.h"
+#include "afs/param.h"
 
 RCSID("$Header$");
 
 /* Ugly Ugly Ugly  but precludes conflicting XDR macros; We want kernel xdr */
 #define __XDR_INCLUDE__
-#include "../afs/stds.h"
-#include "../afs/sysincludes.h" /* Standard vendor system headers */
+#include "afs/stds.h"
+#include "afs/sysincludes.h" /* Standard vendor system headers */
 #if defined(AFS_SUN55_ENV) && !defined(AFS_NONFSTRANS) 
-#include "../rpc/types.h"
-#include "../rpc/auth.h"
-#include "../rpc/auth_unix.h"
-#include "../rpc/auth_des.h"
+#include "rpc/types.h"
+#include "rpc/auth.h"
+#include "rpc/auth_unix.h"
+#include "rpc/auth_des.h"
 #if !defined(AFS_SUN58_ENV)
-#include "../rpc/auth_kerb.h"
+#include "rpc/auth_kerb.h"
 #endif
-#include "../sys/tiuser.h"
-#include "../rpc/xdr.h"
-#include "../rpc/svc.h"
-#include "../nfs/nfs.h"
-#include "../nfs/export.h"
-#include "../nfs/nfs_clnt.h"
-#include "../nfs/nfs_acl.h"
-#include "../afs/afsincludes.h"        
-#include "../afs/afs_stats.h"   
-#include "../afs/exporter.h"
+#include "sys/tiuser.h"
+#include "rpc/xdr.h"
+#include "rpc/svc.h"
+#include "nfs/nfs.h"
+#include "nfs/export.h"
+#include "nfs/nfs_clnt.h"
+#include "nfs/nfs_acl.h"
+#include "afs/afsincludes.h"   
+#include "afs/afs_stats.h"   
+#include "afs/exporter.h"
 
 static int xlatorinit_v2_done=0;
 static int xlatorinit_v3_done=0;
@@ -83,6 +83,7 @@ nfs2_to_afs_call(int which, caddr_t *args, fhandle_t **fhpp, fhandle_t **fh2pp)
     fhandle_t *fhp2=0;
     int errorcode;
     
+    afs_Trace1(afs_iclSetp, CM_TRACE_NFSIN, ICL_TYPE_INT32, which);
     *fh2pp = (fhandle_t *)0;
     switch (which) {
     case RFS_GETATTR:
@@ -99,7 +100,7 @@ nfs2_to_afs_call(int which, caddr_t *args, fhandle_t **fhpp, fhandle_t **fh2pp)
     case RFS_LOOKUP:
     {
        struct nfsdiropargs *sargs = (struct nfsdiropargs *)args;
-       fhp1 = (fhandle_t *)&sargs->da_fhandle;
+       fhp1 = sargs->da_fhandle;
        break;
     }
     case RFS_READ:
@@ -117,45 +118,45 @@ nfs2_to_afs_call(int which, caddr_t *args, fhandle_t **fhpp, fhandle_t **fh2pp)
     case RFS_CREATE:
     {
        struct nfscreatargs *sargs = (struct nfscreatargs *)args;
-       fhp1 = (fhandle_t *)&sargs->ca_da.da_fhandle;
+       fhp1 = sargs->ca_da.da_fhandle;
        break;
     }
     case RFS_REMOVE:
     {
        struct nfsdiropargs *sargs = (struct nfsdiropargs *)args;
-       fhp1 = (fhandle_t *)&sargs->da_fhandle;
+       fhp1 = sargs->da_fhandle;
        break;
     }
     case RFS_RENAME:
     {
        struct nfsrnmargs *sargs = (struct nfsrnmargs *)args;
-       fhp1 = (fhandle_t *)&sargs->rna_from.da_fhandle;
-       fhp2 = (fhandle_t *)&sargs->rna_to.da_fhandle;
+       fhp1 = sargs->rna_from.da_fhandle;
+       fhp2 = sargs->rna_to.da_fhandle;
        break;
     }
     case RFS_LINK:
     {
        struct nfslinkargs *sargs = (struct nfslinkargs *)args;
-       fhp1 = (fhandle_t *)&sargs->la_from;
-       fhp2 = (fhandle_t *)&sargs->la_to.da_fhandle;
+       fhp1 = sargs->la_from;
+       fhp2 = sargs->la_to.da_fhandle;
        break;
     }
     case RFS_SYMLINK:
     {
        struct nfsslargs *sargs = (struct nfsslargs *)args;
-       fhp1 = (fhandle_t *)&sargs->sla_from.da_fhandle;
+       fhp1 = sargs->sla_from.da_fhandle;
        break;
     }
     case RFS_MKDIR:
     {
        struct nfscreatargs *sargs = (struct nfscreatargs *)args;
-       fhp1 = (fhandle_t *)&sargs->ca_da.da_fhandle;
+       fhp1 = sargs->ca_da.da_fhandle;
        break;
     }
     case RFS_RMDIR:
     {
        struct nfsdiropargs *sargs = (struct nfsdiropargs *)args;
-       fhp1 = (fhandle_t *)&sargs->da_fhandle;
+       fhp1 = sargs->da_fhandle;
        break;
     }
     case RFS_READDIR:
@@ -553,7 +554,7 @@ void afs_acl2_getacl(char *args, char *xp, char *exp, char *rp, char *crp) {
     curthread->t_cred = (struct cred*)crp; 
     call=afs_nfs2_dispatcher(1, ACLPROC2_GETACL, (char *)args, &exp, rp, crp); 
     if (call>1) afs_nfs2_noaccess((struct afs_nfs2_resp *)xp); 
-    else (*afs_rfs_disp_tbl[ACLPROC2_GETACL].orig_proc)(args, xp, exp, rp, crp); 
+    else (*afs_acl_disp_tbl[ACLPROC2_GETACL].orig_proc)(args, xp, exp, rp, crp); 
     curthread->t_cred = svcred; 
     return; 
 }
@@ -564,7 +565,7 @@ void afs_acl2_setacl(char *args, char *xp, char *exp, char *rp, char *crp) {
     curthread->t_cred = (struct cred*)crp; 
     call=afs_nfs2_dispatcher(1, ACLPROC2_SETACL, (char *)args, &exp, rp, crp); 
     if (call>1) afs_nfs2_noaccess((struct afs_nfs2_resp *)xp); 
-    else (*afs_rfs_disp_tbl[ACLPROC2_SETACL].orig_proc)(args, xp, exp, rp, crp); 
+    else (*afs_acl_disp_tbl[ACLPROC2_SETACL].orig_proc)(args, xp, exp, rp, crp); 
     curthread->t_cred = svcred; 
     return; 
 }
@@ -575,7 +576,7 @@ void afs_acl2_getattr(char *args, char *xp, char *exp, char *rp, char *crp) {
     curthread->t_cred = (struct cred*)crp; 
     call=afs_nfs2_dispatcher(1, ACLPROC2_GETATTR, (char *)args, &exp, rp, crp); 
     if (call>1) afs_nfs2_noaccess((struct afs_nfs2_resp *)xp); 
-    else (*afs_rfs_disp_tbl[ACLPROC2_GETATTR].orig_proc)(args, xp, exp, rp, crp); 
+    else (*afs_acl_disp_tbl[ACLPROC2_GETATTR].orig_proc)(args, xp, exp, rp, crp); 
     curthread->t_cred = svcred; 
     return; 
 }
@@ -586,7 +587,7 @@ void afs_acl2_access(char *args, char *xp, char *exp, char *rp, char *crp) {
     curthread->t_cred = (struct cred*)crp; 
     call=afs_nfs2_dispatcher(1, ACLPROC2_ACCESS, (char *)args, &exp, rp, crp); 
     if (call>1) afs_nfs2_noaccess((struct afs_nfs2_resp *)xp); 
-    else (*afs_rfs_disp_tbl[ACLPROC2_ACCESS].orig_proc)(args, xp, exp, rp, crp); 
+    else (*afs_acl_disp_tbl[ACLPROC2_ACCESS].orig_proc)(args, xp, exp, rp, crp); 
     curthread->t_cred = svcred; 
     return; 
 }
@@ -677,7 +678,11 @@ nfs3_to_afs_call(int which, caddr_t *args, nfs_fh3 **fhpp, nfs_fh3 **fh2pp)
     case NFSPROC3_LOOKUP:
     {
        LOOKUP3args *arg = (LOOKUP3args *)args;
-       fhp1 = (nfs_fh3 *) &arg->what.dirp;
+#ifdef AFS_SUN58_ENV
+       fhp1 = (nfs_fh3 *) arg->what.dirp;
+#else
+       fhp1 = (nfs_fh3 *) &arg->what.dir;
+#endif
        break;
     }
     case NFSPROC3_ACCESS:
@@ -1244,7 +1249,7 @@ void afs_acl3_getacl(char *args, char *xp, char *exp, char *rp, char *crp) {
     curthread->t_cred = (struct cred*)crp; 
     call=afs_nfs3_dispatcher(1, ACLPROC3_GETACL, (char *)args, &exp, rp, crp); 
     if (call>1) afs_nfs3_noaccess((struct afs_nfs3_resp *)xp); 
-    else (*afs_rfs3_disp_tbl[ACLPROC3_GETACL].orig_proc)(args, xp, exp, rp, crp); 
+    else (*afs_acl3_disp_tbl[ACLPROC3_GETACL].orig_proc)(args, xp, exp, rp, crp); 
     curthread->t_cred = svcred; 
     return; 
 }
@@ -1255,7 +1260,7 @@ void afs_acl3_setacl(char *args, char *xp, char *exp, char *rp, char *crp) {
     curthread->t_cred = (struct cred*)crp; 
     call=afs_nfs3_dispatcher(1, ACLPROC3_SETACL, (char *)args, &exp, rp, crp); 
     if (call>1) afs_nfs3_noaccess((struct afs_nfs3_resp *)xp); 
-    else (*afs_rfs3_disp_tbl[ACLPROC3_SETACL].orig_proc)(args, xp, exp, rp, crp); 
+    else (*afs_acl3_disp_tbl[ACLPROC3_SETACL].orig_proc)(args, xp, exp, rp, crp); 
     curthread->t_cred = svcred; 
     return; 
 }