Remove support for Solaris pre-8
[openafs.git] / src / afs / afs_nfsdisp.c
index d89ff02..9c7c56c 100644 (file)
 #include <afsconfig.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 */
-#if defined(AFS_SUN55_ENV) && !defined(AFS_NONFSTRANS)
+#if defined(AFS_SUN5_ENV) && !defined(AFS_NONFSTRANS)
 #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"
-#endif
 #include "sys/tiuser.h"
 #include "rpc/xdr.h"
 #include "rpc/svc.h"
@@ -63,8 +58,12 @@ struct afs_nfs2_resp {
 };
 
 #ifndef ACL2_NPROC
+#if defined(AFS_SUN510_ENV)
+#define ACL2_NPROC      6
+#else
 #define ACL2_NPROC      5
 #endif
+#endif
 struct afs_nfs_disp_tbl afs_rfs_disp_tbl[RFS_NPROC];
 struct afs_nfs_disp_tbl afs_acl_disp_tbl[ACL2_NPROC];
 
@@ -173,7 +172,7 @@ nfs2_to_afs_call(int which, caddr_t * args, fhandle_t ** fhpp,
     }
 
     /* Ok if arg 1 is in AFS or if 2 args and arg 2 is in AFS */
-    if (is_afs_fh(fhp1)) {
+    if (fhp1 && is_afs_fh(fhp1)) {
        *fhpp = fhp1;
        if (fhp2)
            *fh2pp = fhp2;
@@ -221,7 +220,7 @@ acl2_to_afs_call(int which, caddr_t * args, fhandle_t ** fhpp)
            fhp = &sargs->fh;
            break;
        }
-#if defined(AFS_SUN510_ENV) 
+#if defined(AFS_SUN510_ENV)
     case ACLPROC2_GETXATTRDIR:
        {
            struct GETXATTRDIR2args *sargs = (struct GETXATTRDIR2args *)args;
@@ -233,7 +232,7 @@ acl2_to_afs_call(int which, caddr_t * args, fhandle_t ** fhpp)
        return NULL;
     }
 
-    if (is_afs_fh(fhp)) {
+    if (fhp && is_afs_fh(fhp)) {
        *fhpp = fhp;
        return 1;
     }
@@ -244,7 +243,7 @@ acl2_to_afs_call(int which, caddr_t * args, fhandle_t ** fhpp)
 int
 afs_nfs2_dispatcher(int type, afs_int32 which, char *argp,
                    struct exportinfo **expp, struct svc_req *rp,
-                   struct AFS_UCRED *crp)
+                   afs_ucred_t *crp)
 {
     afs_int32 call = 0;
     afs_int32 code = 0;
@@ -308,11 +307,11 @@ afs_nfs2_dispatcher(int type, afs_int32 which, char *argp,
 void
 afs_nfs2_smallfidder(struct nfsdiropres *dr)
 {
-    register fhandle_t *fhp = (fhandle_t *) & dr->dr_fhandle;
+    fhandle_t *fhp = (fhandle_t *) & dr->dr_fhandle;
     afs_int32 addr[2];
     struct vcache *vcp;
 
-#if defined(AFS_SUN57_64BIT_ENV)
+#if defined(AFS_SUN5_64BIT_ENV)
     /* See also afs_fid() */
     memcpy((char *)addr, fhp->fh_data, SIZEOF_SMALLFID);
     addr[1] = (addr[1] >> 48) & 0xffff;
@@ -329,12 +328,12 @@ afs_nfs2_smallfidder(struct nfsdiropres *dr)
            struct cell *tcell;
 
            /* Make up and copy out a SmallFid */
-           tcell = afs_GetCell(vcp->fid.Cell, READ_LOCK);
-           Sfid.Volume = vcp->fid.Fid.Volume;
+           tcell = afs_GetCell(vcp->f.fid.Cell, READ_LOCK);
+           Sfid.Volume = vcp->f.fid.Fid.Volume;
            Sfid.CellAndUnique =
-               ((tcell->cellIndex << 24) | (vcp->fid.Fid.Unique & 0xffffff));
+               ((tcell->cellIndex << 24) | (vcp->f.fid.Fid.Unique & 0xffffff));
            afs_PutCell(tcell, READ_LOCK);
-           Sfid.Vnode = (u_short) (vcp->fid.Fid.Vnode & 0xffff);
+           Sfid.Vnode = (u_short) (vcp->f.fid.Fid.Vnode & 0xffff);
            fhp->fh_len = SIZEOF_SMALLFID;
            memcpy(dr->dr_fhandle.fh_data, (char *)&Sfid, fhp->fh_len);
 
@@ -374,8 +373,8 @@ void
 afs_nfs2_getattr(char *args, char *xp, char *exp, char *rp, char *crp)
 {
     u_int call;
-    struct cred *svcred = curthread->t_cred;
-    curthread->t_cred = (struct cred *)crp;
+    afs_ucred_t *svcred = curthread->t_cred;
+    curthread->t_cred = (afs_ucred_t *)crp;
     call = afs_nfs2_dispatcher(0, RFS_GETATTR, (char *)args, &exp, rp, crp);
     if (call > 1)
        afs_nfs2_noaccess((struct afs_nfs2_resp *)xp);
@@ -389,8 +388,8 @@ void
 afs_nfs2_setattr(char *args, char *xp, char *exp, char *rp, char *crp)
 {
     u_int call;
-    struct cred *svcred = curthread->t_cred;
-    curthread->t_cred = (struct cred *)crp;
+    afs_ucred_t *svcred = curthread->t_cred;
+    curthread->t_cred = (afs_ucred_t *)crp;
     call = afs_nfs2_dispatcher(0, RFS_SETATTR, (char *)args, &exp, rp, crp);
     if (call > 1)
        afs_nfs2_noaccess((struct afs_nfs2_resp *)xp);
@@ -404,8 +403,8 @@ void
 afs_nfs2_lookup(char *args, char *xp, char *exp, char *rp, char *crp)
 {
     u_int call;
-    struct cred *svcred = curthread->t_cred;
-    curthread->t_cred = (struct cred *)crp;
+    afs_ucred_t *svcred = curthread->t_cred;
+    curthread->t_cred = (afs_ucred_t *)crp;
     call = afs_nfs2_dispatcher(0, RFS_LOOKUP, (char *)args, &exp, rp, crp);
     if (call > 1)
        afs_nfs2_noaccess((struct afs_nfs2_resp *)xp);
@@ -422,8 +421,8 @@ void
 afs_nfs2_readlink(char *args, char *xp, char *exp, char *rp, char *crp)
 {
     u_int call;
-    struct cred *svcred = curthread->t_cred;
-    curthread->t_cred = (struct cred *)crp;
+    afs_ucred_t *svcred = curthread->t_cred;
+    curthread->t_cred = (afs_ucred_t *)crp;
     call = afs_nfs2_dispatcher(0, RFS_READLINK, (char *)args, &exp, rp, crp);
     if (call > 1)
        afs_nfs2_noaccess((struct afs_nfs2_resp *)xp);
@@ -437,8 +436,8 @@ void
 afs_nfs2_read(char *args, char *xp, char *exp, char *rp, char *crp)
 {
     u_int call;
-    struct cred *svcred = curthread->t_cred;
-    curthread->t_cred = (struct cred *)crp;
+    afs_ucred_t *svcred = curthread->t_cred;
+    curthread->t_cred = (afs_ucred_t *)crp;
     call = afs_nfs2_dispatcher(0, RFS_READ, (char *)args, &exp, rp, crp);
     if (call > 1)
        afs_nfs2_noaccess((struct afs_nfs2_resp *)xp);
@@ -452,8 +451,8 @@ void
 afs_nfs2_write(char *args, char *xp, char *exp, char *rp, char *crp)
 {
     u_int call;
-    struct cred *svcred = curthread->t_cred;
-    curthread->t_cred = (struct cred *)crp;
+    afs_ucred_t *svcred = curthread->t_cred;
+    curthread->t_cred = (afs_ucred_t *)crp;
     call = afs_nfs2_dispatcher(0, RFS_WRITE, (char *)args, &exp, rp, crp);
     if (call > 1)
        afs_nfs2_noaccess((struct afs_nfs2_resp *)xp);
@@ -467,8 +466,8 @@ void
 afs_nfs2_create(char *args, char *xp, char *exp, char *rp, char *crp)
 {
     u_int call;
-    struct cred *svcred = curthread->t_cred;
-    curthread->t_cred = (struct cred *)crp;
+    afs_ucred_t *svcred = curthread->t_cred;
+    curthread->t_cred = (afs_ucred_t *)crp;
     call = afs_nfs2_dispatcher(0, RFS_CREATE, (char *)args, &exp, rp, crp);
     if (call > 1)
        afs_nfs2_noaccess((struct afs_nfs2_resp *)xp);
@@ -485,8 +484,8 @@ void
 afs_nfs2_remove(char *args, char *xp, char *exp, char *rp, char *crp)
 {
     u_int call;
-    struct cred *svcred = curthread->t_cred;
-    curthread->t_cred = (struct cred *)crp;
+    afs_ucred_t *svcred = curthread->t_cred;
+    curthread->t_cred = (afs_ucred_t *)crp;
     call = afs_nfs2_dispatcher(0, RFS_REMOVE, (char *)args, &exp, rp, crp);
     if (call > 1)
        afs_nfs2_noaccess((struct afs_nfs2_resp *)xp);
@@ -500,8 +499,8 @@ void
 afs_nfs2_rename(char *args, char *xp, char *exp, char *rp, char *crp)
 {
     u_int call;
-    struct cred *svcred = curthread->t_cred;
-    curthread->t_cred = (struct cred *)crp;
+    afs_ucred_t *svcred = curthread->t_cred;
+    curthread->t_cred = (afs_ucred_t *)crp;
     call = afs_nfs2_dispatcher(0, RFS_RENAME, (char *)args, &exp, rp, crp);
     if (call > 1)
        afs_nfs2_noaccess((struct afs_nfs2_resp *)xp);
@@ -515,8 +514,8 @@ void
 afs_nfs2_link(char *args, char *xp, char *exp, char *rp, char *crp)
 {
     u_int call;
-    struct cred *svcred = curthread->t_cred;
-    curthread->t_cred = (struct cred *)crp;
+    afs_ucred_t *svcred = curthread->t_cred;
+    curthread->t_cred = (afs_ucred_t *)crp;
     call = afs_nfs2_dispatcher(0, RFS_LINK, (char *)args, &exp, rp, crp);
     if (call > 1)
        afs_nfs2_noaccess((struct afs_nfs2_resp *)xp);
@@ -530,8 +529,8 @@ void
 afs_nfs2_symlink(char *args, char *xp, char *exp, char *rp, char *crp)
 {
     u_int call;
-    struct cred *svcred = curthread->t_cred;
-    curthread->t_cred = (struct cred *)crp;
+    afs_ucred_t *svcred = curthread->t_cred;
+    curthread->t_cred = (afs_ucred_t *)crp;
     call = afs_nfs2_dispatcher(0, RFS_SYMLINK, (char *)args, &exp, rp, crp);
     if (call > 1)
        afs_nfs2_noaccess((struct afs_nfs2_resp *)xp);
@@ -545,8 +544,8 @@ void
 afs_nfs2_mkdir(char *args, char *xp, char *exp, char *rp, char *crp)
 {
     u_int call;
-    struct cred *svcred = curthread->t_cred;
-    curthread->t_cred = (struct cred *)crp;
+    afs_ucred_t *svcred = curthread->t_cred;
+    curthread->t_cred = (afs_ucred_t *)crp;
     call = afs_nfs2_dispatcher(0, RFS_MKDIR, (char *)args, &exp, rp, crp);
     if (call > 1)
        afs_nfs2_noaccess((struct afs_nfs2_resp *)xp);
@@ -563,8 +562,8 @@ void
 afs_nfs2_rmdir(char *args, char *xp, char *exp, char *rp, char *crp)
 {
     u_int call;
-    struct cred *svcred = curthread->t_cred;
-    curthread->t_cred = (struct cred *)crp;
+    afs_ucred_t *svcred = curthread->t_cred;
+    curthread->t_cred = (afs_ucred_t *)crp;
     call = afs_nfs2_dispatcher(0, RFS_RMDIR, (char *)args, &exp, rp, crp);
     if (call > 1)
        afs_nfs2_noaccess((struct afs_nfs2_resp *)xp);
@@ -578,8 +577,8 @@ void
 afs_nfs2_readdir(char *args, char *xp, char *exp, char *rp, char *crp)
 {
     u_int call;
-    struct cred *svcred = curthread->t_cred;
-    curthread->t_cred = (struct cred *)crp;
+    afs_ucred_t *svcred = curthread->t_cred;
+    curthread->t_cred = (afs_ucred_t *)crp;
     call = afs_nfs2_dispatcher(0, RFS_READDIR, (char *)args, &exp, rp, crp);
     if (call > 1)
        afs_nfs2_noaccess((struct afs_nfs2_resp *)xp);
@@ -593,8 +592,8 @@ void
 afs_nfs2_statfs(char *args, char *xp, char *exp, char *rp, char *crp)
 {
     u_int call;
-    struct cred *svcred = curthread->t_cred;
-    curthread->t_cred = (struct cred *)crp;
+    afs_ucred_t *svcred = curthread->t_cred;
+    curthread->t_cred = (afs_ucred_t *)crp;
     call = afs_nfs2_dispatcher(0, RFS_STATFS, (char *)args, &exp, rp, crp);
     if (call > 1)
        afs_nfs2_noaccess((struct afs_nfs2_resp *)xp);
@@ -629,8 +628,8 @@ void
 afs_acl2_getacl(char *args, char *xp, char *exp, char *rp, char *crp)
 {
     u_int call;
-    struct cred *svcred = curthread->t_cred;
-    curthread->t_cred = (struct cred *)crp;
+    afs_ucred_t *svcred = curthread->t_cred;
+    curthread->t_cred = (afs_ucred_t *)crp;
     call =
        afs_nfs2_dispatcher(1, ACLPROC2_GETACL, (char *)args, &exp, rp, crp);
     if (call > 1)
@@ -646,8 +645,8 @@ void
 afs_acl2_setacl(char *args, char *xp, char *exp, char *rp, char *crp)
 {
     u_int call;
-    struct cred *svcred = curthread->t_cred;
-    curthread->t_cred = (struct cred *)crp;
+    afs_ucred_t *svcred = curthread->t_cred;
+    curthread->t_cred = (afs_ucred_t *)crp;
     call =
        afs_nfs2_dispatcher(1, ACLPROC2_SETACL, (char *)args, &exp, rp, crp);
     if (call > 1)
@@ -663,8 +662,8 @@ void
 afs_acl2_getattr(char *args, char *xp, char *exp, char *rp, char *crp)
 {
     u_int call;
-    struct cred *svcred = curthread->t_cred;
-    curthread->t_cred = (struct cred *)crp;
+    afs_ucred_t *svcred = curthread->t_cred;
+    curthread->t_cred = (afs_ucred_t *)crp;
     call =
        afs_nfs2_dispatcher(1, ACLPROC2_GETATTR, (char *)args, &exp, rp, crp);
     if (call > 1)
@@ -680,8 +679,8 @@ void
 afs_acl2_access(char *args, char *xp, char *exp, char *rp, char *crp)
 {
     u_int call;
-    struct cred *svcred = curthread->t_cred;
-    curthread->t_cred = (struct cred *)crp;
+    afs_ucred_t *svcred = curthread->t_cred;
+    curthread->t_cred = (afs_ucred_t *)crp;
     call =
        afs_nfs2_dispatcher(1, ACLPROC2_ACCESS, (char *)args, &exp, rp, crp);
     if (call > 1)
@@ -693,13 +692,13 @@ afs_acl2_access(char *args, char *xp, char *exp, char *rp, char *crp)
     return;
 }
 
-#if defined(AFS_SUN510_ENV) 
+#if defined(AFS_SUN510_ENV)
 void
 afs_acl2_getxattrdir(char *args, char *xp, char *exp, char *rp, char *crp)
 {
     u_int call;
-    struct cred *svcred = curthread->t_cred;
-    curthread->t_cred = (struct cred *)crp;
+    afs_ucred_t *svcred = curthread->t_cred;
+    curthread->t_cred = (afs_ucred_t *)crp;
     call =
        afs_nfs2_dispatcher(1, ACLPROC2_GETXATTRDIR, (char *)args, &exp, rp, crp);
     if (call > 1)
@@ -712,13 +711,13 @@ afs_acl2_getxattrdir(char *args, char *xp, char *exp, char *rp, char *crp)
 }
 #endif
 
-struct afs_nfs_disp_tbl afs_acl_disp_tbl[5] = {
+struct afs_nfs_disp_tbl afs_acl_disp_tbl[ACL2_NPROC] = {
     {afs_nfs2_null},
     {afs_acl2_getacl},
     {afs_acl2_setacl},
     {afs_acl2_getattr},
     {afs_acl2_access},
-#if defined(AFS_SUN510_ENV) 
+#if defined(AFS_SUN510_ENV)
     {afs_acl2_getxattrdir}
 #endif
 };
@@ -749,8 +748,12 @@ afs_xlatorinit_v2(struct rfs_disp_tbl *_rfs_tbl,
 #endif
 
 #ifndef ACL3_NPROC
+#if defined(AFS_SUN510_ENV)
+#define ACL3_NPROC      4
+#else
 #define ACL3_NPROC      3
 #endif
+#endif
 
 struct afs_nfs_disp_tbl afs_rfs3_disp_tbl[RFS3_NPROC];
 struct afs_nfs_disp_tbl afs_acl3_disp_tbl[ACL3_NPROC];
@@ -810,11 +813,7 @@ nfs3_to_afs_call(int which, caddr_t * args, nfs_fh3 ** fhpp, nfs_fh3 ** fh2pp)
     case NFSPROC3_LOOKUP:
        {
            LOOKUP3args *arg = (LOOKUP3args *) args;
-#ifdef AFS_SUN58_ENV
            fhp1 = (nfs_fh3 *) arg->what.dirp;
-#else
-           fhp1 = (nfs_fh3 *) & arg->what.dir;
-#endif
            break;
        }
     case NFSPROC3_ACCESS:
@@ -844,84 +843,51 @@ nfs3_to_afs_call(int which, caddr_t * args, nfs_fh3 ** fhpp, nfs_fh3 ** fh2pp)
     case NFSPROC3_CREATE:
        {
            CREATE3args *arg = (CREATE3args *) args;
-#ifdef AFS_SUN58_ENV
            fhp1 = (nfs_fh3 *) arg->where.dirp;
-#else
-           fhp1 = (nfs_fh3 *) & arg->where.dir;
-#endif
            break;
        }
     case NFSPROC3_MKDIR:
        {
            MKDIR3args *arg = (MKDIR3args *) args;
-#ifdef AFS_SUN58_ENV
            fhp1 = (nfs_fh3 *) arg->where.dirp;
-#else
-           fhp1 = (nfs_fh3 *) & arg->where.dir;
-#endif
            break;
        }
     case NFSPROC3_SYMLINK:
        {
            SYMLINK3args *arg = (SYMLINK3args *) args;
-#ifdef AFS_SUN58_ENV
            fhp1 = (nfs_fh3 *) arg->where.dirp;
-#else
-           fhp1 = (nfs_fh3 *) & arg->where.dir;
-#endif
            break;
        }
     case NFSPROC3_MKNOD:
        {
            MKNOD3args *arg = (MKNOD3args *) args;
-#ifdef AFS_SUN58_ENV
            fhp1 = (nfs_fh3 *) arg->where.dirp;
-#else
-           fhp1 = (nfs_fh3 *) & arg->where.dir;
-#endif
            break;
        }
     case NFSPROC3_REMOVE:
        {
            REMOVE3args *arg = (REMOVE3args *) args;
-#ifdef AFS_SUN58_ENV
            fhp1 = (nfs_fh3 *) arg->object.dirp;
-#else
-           fhp1 = (nfs_fh3 *) & arg->object.dir;
-#endif
            break;
        }
     case NFSPROC3_RMDIR:
        {
            RMDIR3args *arg = (RMDIR3args *) args;
-#ifdef AFS_SUN58_ENV
            fhp1 = (nfs_fh3 *) arg->object.dirp;
-#else
-           fhp1 = (nfs_fh3 *) & arg->object.dir;
-#endif
            break;
        }
     case NFSPROC3_RENAME:
        {
            RENAME3args *arg = (RENAME3args *) args;
-#ifdef AFS_SUN58_ENV
            fhp1 = (nfs_fh3 *) arg->from.dirp;
            fhp2 = (nfs_fh3 *) arg->to.dirp;
-#else
-           fhp1 = (nfs_fh3 *) & arg->from.dir;
-           fhp2 = (nfs_fh3 *) & arg->to.dir;
-#endif
            break;
        }
     case NFSPROC3_LINK:
        {
            LINK3args *arg = (LINK3args *) args;
            fhp1 = (nfs_fh3 *) & arg->file;
-#ifdef AFS_SUN58_ENV
            fhp2 = (nfs_fh3 *) arg->link.dirp;
-#else
-           fhp2 = (nfs_fh3 *) & arg->link.dir;
-#endif
            break;
        }
     case NFSPROC3_READDIR:
@@ -964,7 +930,7 @@ nfs3_to_afs_call(int which, caddr_t * args, nfs_fh3 ** fhpp, nfs_fh3 ** fh2pp)
        return NULL;
     }
 
-    if (is_afs_fh3(fhp1)) {
+    if (fhp1 && is_afs_fh3(fhp1)) {
        *fhpp = fhp1;
        if (fhp2)
            *fh2pp = fhp2;
@@ -996,7 +962,7 @@ acl3_to_afs_call(int which, caddr_t * args, nfs_fh3 ** fhpp)
            fhp = &sargs->fh;
            break;
        }
-#if defined(AFS_SUN510_ENV) 
+#if defined(AFS_SUN510_ENV)
     case ACLPROC3_GETXATTRDIR:
        {
            struct GETXATTRDIR3args *sargs = (struct GETXATTRDIR3args *)args;
@@ -1008,7 +974,7 @@ acl3_to_afs_call(int which, caddr_t * args, nfs_fh3 ** fhpp)
        return NULL;
     }
 
-    if (is_afs_fh3(fhp)) {
+    if (fhp && is_afs_fh3(fhp)) {
        *fhpp = fhp;
        return 1;
     }
@@ -1019,7 +985,7 @@ acl3_to_afs_call(int which, caddr_t * args, nfs_fh3 ** fhpp)
 int
 afs_nfs3_dispatcher(int type, afs_int32 which, char *argp,
                    struct exportinfo **expp, struct svc_req *rp,
-                   struct AFS_UCRED *crp)
+                   afs_ucred_t *crp)
 {
     afs_int32 call = 0;
     afs_int32 code = 0;
@@ -1032,7 +998,7 @@ afs_nfs3_dispatcher(int type, afs_int32 which, char *argp,
        return 2;
 
     sa = (struct sockaddr *)svc_getrpccaller(rp->rq_xprt)->buf;
-    if (sa == NULL) 
+    if (sa == NULL)
        return;
 
     if (sa->sa_family == AF_INET)
@@ -1089,7 +1055,7 @@ afs_nfs3_smallfidder(struct nfs_fh3 *fhp, int status)
     afs_int32 addr[2];
     struct vcache *vcp;
 
-#if defined(AFS_SUN57_64BIT_ENV)
+#if defined(AFS_SUN5_64BIT_ENV)
     /* See also afs_fid() */
     memcpy((char *)addr, fhp->fh3_data, 10);
     addr[1] = (addr[1] >> 48) & 0xffff;
@@ -1107,12 +1073,12 @@ afs_nfs3_smallfidder(struct nfs_fh3 *fhp, int status)
            struct cell *tcell;
 
            /* Make up and copy out a SmallFid */
-           tcell = afs_GetCell(vcp->fid.Cell, READ_LOCK);
-           Sfid.Volume = vcp->fid.Fid.Volume;
+           tcell = afs_GetCell(vcp->f.fid.Cell, READ_LOCK);
+           Sfid.Volume = vcp->f.fid.Fid.Volume;
            Sfid.CellAndUnique =
-               ((tcell->cellIndex << 24) | (vcp->fid.Fid.Unique & 0xffffff));
+               ((tcell->cellIndex << 24) | (vcp->f.fid.Fid.Unique & 0xffffff));
            afs_PutCell(tcell, READ_LOCK);
-           Sfid.Vnode = (u_short) (vcp->fid.Fid.Vnode & 0xffff);
+           Sfid.Vnode = (u_short) (vcp->f.fid.Fid.Vnode & 0xffff);
            fhp->fh3_len = SIZEOF_SMALLFID;
            memcpy(fhp->fh3_data, (char *)&Sfid, fhp->fh3_len);
 
@@ -1132,8 +1098,8 @@ afs_nfs3_getattr(char *args, char *xp, char *exp, char *rp, char *crp)
 {
     u_int call;
     afs_nfs3_resp dummy;
-    struct cred *svcred = curthread->t_cred;
-    curthread->t_cred = (struct cred *)crp;
+    afs_ucred_t *svcred = curthread->t_cred;
+    curthread->t_cred = (afs_ucred_t *)crp;
     call =
        afs_nfs3_dispatcher(0, NFSPROC3_GETATTR, (char *)args, &exp, rp, crp);
     if (call > 1)
@@ -1150,8 +1116,8 @@ afs_nfs3_setattr(char *args, char *xp, char *exp, char *rp, char *crp)
 {
     u_int call;
     afs_nfs3_resp dummy;
-    struct cred *svcred = curthread->t_cred;
-    curthread->t_cred = (struct cred *)crp;
+    afs_ucred_t *svcred = curthread->t_cred;
+    curthread->t_cred = (afs_ucred_t *)crp;
     call =
        afs_nfs3_dispatcher(0, NFSPROC3_SETATTR, (char *)args, &exp, rp, crp);
     if (call > 1)
@@ -1168,8 +1134,8 @@ afs_nfs3_lookup(char *args, char *xp, char *exp, char *rp, char *crp)
 {
     u_int call;
     afs_nfs3_resp dummy;
-    struct cred *svcred = curthread->t_cred;
-    curthread->t_cred = (struct cred *)crp;
+    afs_ucred_t *svcred = curthread->t_cred;
+    curthread->t_cred = (afs_ucred_t *)crp;
     call =
        afs_nfs3_dispatcher(0, NFSPROC3_LOOKUP, (char *)args, &exp, rp, crp);
     if (call > 1)
@@ -1191,8 +1157,8 @@ afs_nfs3_access(char *args, char *xp, char *exp, char *rp, char *crp)
 {
     u_int call;
     afs_nfs3_resp dummy;
-    struct cred *svcred = curthread->t_cred;
-    curthread->t_cred = (struct cred *)crp;
+    afs_ucred_t *svcred = curthread->t_cred;
+    curthread->t_cred = (afs_ucred_t *)crp;
     call =
        afs_nfs3_dispatcher(0, NFSPROC3_ACCESS, (char *)args, &exp, rp, crp);
     if (call > 1)
@@ -1209,8 +1175,8 @@ afs_nfs3_readlink(char *args, char *xp, char *exp, char *rp, char *crp)
 {
     u_int call;
     afs_nfs3_resp dummy;
-    struct cred *svcred = curthread->t_cred;
-    curthread->t_cred = (struct cred *)crp;
+    afs_ucred_t *svcred = curthread->t_cred;
+    curthread->t_cred = (afs_ucred_t *)crp;
     call =
        afs_nfs3_dispatcher(0, NFSPROC3_READLINK, (char *)args, &exp, rp,
                            crp);
@@ -1228,8 +1194,8 @@ afs_nfs3_read(char *args, char *xp, char *exp, char *rp, char *crp)
 {
     u_int call;
     afs_nfs3_resp dummy;
-    struct cred *svcred = curthread->t_cred;
-    curthread->t_cred = (struct cred *)crp;
+    afs_ucred_t *svcred = curthread->t_cred;
+    curthread->t_cred = (afs_ucred_t *)crp;
     call = afs_nfs3_dispatcher(0, NFSPROC3_READ, (char *)args, &exp, rp, crp);
     if (call > 1)
        afs_nfs3_noaccess((struct afs_nfs3_resp *)xp);
@@ -1245,8 +1211,8 @@ afs_nfs3_write(char *args, char *xp, char *exp, char *rp, char *crp)
 {
     u_int call;
     afs_nfs3_resp dummy;
-    struct cred *svcred = curthread->t_cred;
-    curthread->t_cred = (struct cred *)crp;
+    afs_ucred_t *svcred = curthread->t_cred;
+    curthread->t_cred = (afs_ucred_t *)crp;
     call =
        afs_nfs3_dispatcher(0, NFSPROC3_WRITE, (char *)args, &exp, rp, crp);
     if (call > 1)
@@ -1263,8 +1229,8 @@ afs_nfs3_create(char *args, char *xp, char *exp, char *rp, char *crp)
 {
     u_int call;
     afs_nfs3_resp dummy;
-    struct cred *svcred = curthread->t_cred;
-    curthread->t_cred = (struct cred *)crp;
+    afs_ucred_t *svcred = curthread->t_cred;
+    curthread->t_cred = (afs_ucred_t *)crp;
     call =
        afs_nfs3_dispatcher(0, NFSPROC3_CREATE, (char *)args, &exp, rp, crp);
     if (call > 1)
@@ -1286,8 +1252,8 @@ afs_nfs3_mkdir(char *args, char *xp, char *exp, char *rp, char *crp)
 {
     u_int call;
     afs_nfs3_resp dummy;
-    struct cred *svcred = curthread->t_cred;
-    curthread->t_cred = (struct cred *)crp;
+    afs_ucred_t *svcred = curthread->t_cred;
+    curthread->t_cred = (afs_ucred_t *)crp;
     call =
        afs_nfs3_dispatcher(0, NFSPROC3_MKDIR, (char *)args, &exp, rp, crp);
     if (call > 1)
@@ -1309,8 +1275,8 @@ afs_nfs3_symlink(char *args, char *xp, char *exp, char *rp, char *crp)
 {
     u_int call;
     afs_nfs3_resp dummy;
-    struct cred *svcred = curthread->t_cred;
-    curthread->t_cred = (struct cred *)crp;
+    afs_ucred_t *svcred = curthread->t_cred;
+    curthread->t_cred = (afs_ucred_t *)crp;
     call =
        afs_nfs3_dispatcher(0, NFSPROC3_SYMLINK, (char *)args, &exp, rp, crp);
     if (call > 1)
@@ -1332,8 +1298,8 @@ afs_nfs3_mknod(char *args, char *xp, char *exp, char *rp, char *crp)
 {
     u_int call;
     afs_nfs3_resp dummy;
-    struct cred *svcred = curthread->t_cred;
-    curthread->t_cred = (struct cred *)crp;
+    afs_ucred_t *svcred = curthread->t_cred;
+    curthread->t_cred = (afs_ucred_t *)crp;
     call =
        afs_nfs3_dispatcher(0, NFSPROC3_MKNOD, (char *)args, &exp, rp, crp);
     if (call > 1)
@@ -1355,8 +1321,8 @@ afs_nfs3_remove(char *args, char *xp, char *exp, char *rp, char *crp)
 {
     u_int call;
     afs_nfs3_resp dummy;
-    struct cred *svcred = curthread->t_cred;
-    curthread->t_cred = (struct cred *)crp;
+    afs_ucred_t *svcred = curthread->t_cred;
+    curthread->t_cred = (afs_ucred_t *)crp;
     call =
        afs_nfs3_dispatcher(0, NFSPROC3_REMOVE, (char *)args, &exp, rp, crp);
     if (call > 1)
@@ -1373,8 +1339,8 @@ afs_nfs3_rmdir(char *args, char *xp, char *exp, char *rp, char *crp)
 {
     u_int call;
     afs_nfs3_resp dummy;
-    struct cred *svcred = curthread->t_cred;
-    curthread->t_cred = (struct cred *)crp;
+    afs_ucred_t *svcred = curthread->t_cred;
+    curthread->t_cred = (afs_ucred_t *)crp;
     call =
        afs_nfs3_dispatcher(0, NFSPROC3_RMDIR, (char *)args, &exp, rp, crp);
     if (call > 1)
@@ -1391,8 +1357,8 @@ afs_nfs3_rename(char *args, char *xp, char *exp, char *rp, char *crp)
 {
     u_int call;
     afs_nfs3_resp dummy;
-    struct cred *svcred = curthread->t_cred;
-    curthread->t_cred = (struct cred *)crp;
+    afs_ucred_t *svcred = curthread->t_cred;
+    curthread->t_cred = (afs_ucred_t *)crp;
     call =
        afs_nfs3_dispatcher(0, NFSPROC3_RENAME, (char *)args, &exp, rp, crp);
     if (call > 1)
@@ -1409,8 +1375,8 @@ afs_nfs3_link(char *args, char *xp, char *exp, char *rp, char *crp)
 {
     u_int call;
     afs_nfs3_resp dummy;
-    struct cred *svcred = curthread->t_cred;
-    curthread->t_cred = (struct cred *)crp;
+    afs_ucred_t *svcred = curthread->t_cred;
+    curthread->t_cred = (afs_ucred_t *)crp;
     call = afs_nfs3_dispatcher(0, NFSPROC3_LINK, (char *)args, &exp, rp, crp);
     if (call > 1)
        afs_nfs3_noaccess((struct afs_nfs3_resp *)xp);
@@ -1426,8 +1392,8 @@ afs_nfs3_readdir(char *args, char *xp, char *exp, char *rp, char *crp)
 {
     u_int call;
     afs_nfs3_resp dummy;
-    struct cred *svcred = curthread->t_cred;
-    curthread->t_cred = (struct cred *)crp;
+    afs_ucred_t *svcred = curthread->t_cred;
+    curthread->t_cred = (afs_ucred_t *)crp;
     call =
        afs_nfs3_dispatcher(0, NFSPROC3_READDIR, (char *)args, &exp, rp, crp);
     if (call > 1)
@@ -1444,8 +1410,8 @@ afs_nfs3_readdirplus(char *args, char *xp, char *exp, char *rp, char *crp)
 {
     u_int call;
     afs_nfs3_resp dummy;
-    struct cred *svcred = curthread->t_cred;
-    curthread->t_cred = (struct cred *)crp;
+    afs_ucred_t *svcred = curthread->t_cred;
+    curthread->t_cred = (afs_ucred_t *)crp;
     call =
        afs_nfs3_dispatcher(0, NFSPROC3_READDIRPLUS, (char *)args, &exp, rp,
                            crp);
@@ -1465,8 +1431,8 @@ afs_nfs3_fsstat(char *args, char *xp, char *exp, char *rp, char *crp)
 {
     u_int call;
     afs_nfs3_resp dummy;
-    struct cred *svcred = curthread->t_cred;
-    curthread->t_cred = (struct cred *)crp;
+    afs_ucred_t *svcred = curthread->t_cred;
+    curthread->t_cred = (afs_ucred_t *)crp;
     call =
        afs_nfs3_dispatcher(0, NFSPROC3_FSSTAT, (char *)args, &exp, rp, crp);
     if (call > 1)
@@ -1483,8 +1449,8 @@ afs_nfs3_fsinfo(char *args, char *xp, char *exp, char *rp, char *crp)
 {
     u_int call;
     afs_nfs3_resp dummy;
-    struct cred *svcred = curthread->t_cred;
-    curthread->t_cred = (struct cred *)crp;
+    afs_ucred_t *svcred = curthread->t_cred;
+    curthread->t_cred = (afs_ucred_t *)crp;
     call =
        afs_nfs3_dispatcher(0, NFSPROC3_FSINFO, (char *)args, &exp, rp, crp);
     if (call > 1)
@@ -1501,8 +1467,8 @@ afs_nfs3_pathconf(char *args, char *xp, char *exp, char *rp, char *crp)
 {
     u_int call;
     afs_nfs3_resp dummy;
-    struct cred *svcred = curthread->t_cred;
-    curthread->t_cred = (struct cred *)crp;
+    afs_ucred_t *svcred = curthread->t_cred;
+    curthread->t_cred = (afs_ucred_t *)crp;
     call =
        afs_nfs3_dispatcher(0, NFSPROC3_PATHCONF, (char *)args, &exp, rp,
                            crp);
@@ -1520,8 +1486,8 @@ afs_nfs3_commit(char *args, char *xp, char *exp, char *rp, char *crp)
 {
     u_int call;
     afs_nfs3_resp dummy;
-    struct cred *svcred = curthread->t_cred;
-    curthread->t_cred = (struct cred *)crp;
+    afs_ucred_t *svcred = curthread->t_cred;
+    curthread->t_cred = (afs_ucred_t *)crp;
     call =
        afs_nfs3_dispatcher(0, NFSPROC3_COMMIT, (char *)args, &exp, rp, crp);
     if (call > 1)
@@ -1562,8 +1528,8 @@ void
 afs_acl3_getacl(char *args, char *xp, char *exp, char *rp, char *crp)
 {
     u_int call;
-    struct cred *svcred = curthread->t_cred;
-    curthread->t_cred = (struct cred *)crp;
+    afs_ucred_t *svcred = curthread->t_cred;
+    curthread->t_cred = (afs_ucred_t *)crp;
     call =
        afs_nfs3_dispatcher(1, ACLPROC3_GETACL, (char *)args, &exp, rp, crp);
     if (call > 1)
@@ -1579,8 +1545,8 @@ void
 afs_acl3_setacl(char *args, char *xp, char *exp, char *rp, char *crp)
 {
     u_int call;
-    struct cred *svcred = curthread->t_cred;
-    curthread->t_cred = (struct cred *)crp;
+    afs_ucred_t *svcred = curthread->t_cred;
+    curthread->t_cred = (afs_ucred_t *)crp;
     call =
        afs_nfs3_dispatcher(1, ACLPROC3_SETACL, (char *)args, &exp, rp, crp);
     if (call > 1)
@@ -1592,13 +1558,13 @@ afs_acl3_setacl(char *args, char *xp, char *exp, char *rp, char *crp)
     return;
 }
 
-#if defined(AFS_SUN510_ENV) 
+#if defined(AFS_SUN510_ENV)
 void
 afs_acl3_getxattrdir(char *args, char *xp, char *exp, char *rp, char *crp)
 {
     u_int call;
-    struct cred *svcred = curthread->t_cred;
-    curthread->t_cred = (struct cred *)crp;
+    afs_ucred_t *svcred = curthread->t_cred;
+    curthread->t_cred = (afs_ucred_t *)crp;
     call =
        afs_nfs3_dispatcher(1, ACLPROC3_GETXATTRDIR, (char *)args, &exp, rp, crp);
     if (call > 1)
@@ -1611,11 +1577,11 @@ afs_acl3_getxattrdir(char *args, char *xp, char *exp, char *rp, char *crp)
 }
 #endif
 
-struct afs_nfs_disp_tbl afs_acl3_disp_tbl[3] = {
+struct afs_nfs_disp_tbl afs_acl3_disp_tbl[ACL3_NPROC] = {
     {afs_nfs2_null},
     {afs_acl3_getacl},
     {afs_acl3_setacl},
-#if defined(AFS_SUN510_ENV) 
+#if defined(AFS_SUN510_ENV)
     {afs_acl3_getxattrdir},
 #endif
 };