Really apply improve-type-safety-and-prototype-matching-20020226.
[openafs.git] / src / viced / afsfileprocs.c
index 71d102a..dfa2e07 100644 (file)
@@ -169,7 +169,7 @@ struct afs_FSStats {
 
 struct afs_FSStats afs_fsstats;
 
-void   ResetDebug(), SetDebug(), GetStatus(), Terminate();
+void   ResetDebug(), SetDebug(), Terminate();
 int    CopyOnWrite();          /* returns 0 on success */
 
 
@@ -183,6 +183,8 @@ extern afs_int32 implicitAdminRights;
 
 static TryLocalVLServer();
 
+void GetStatus(Vnode *targetptr, AFSFetchStatus *status, afs_int32 rights, afs_int32 anyrights, Vnode *parentptr);
+
 /*
  * Externals used by the xstat code.
  */
@@ -259,27 +261,30 @@ static SetVolumeSync(async, avol)
 } /*SetVolumeSync*/
 
 /*
- * This call overwrites the pointed-to rx_call with an rx_connection.  This
- * is really bogus.  Note that this function always returns a held host, so
+ * Note that this function always returns a held host, so
  * that CallPostamble can block without the host's disappearing.
+ * Call returns rx connection in passed in *tconn
  */
-static CallPreamble(acall, activecall)
-    register struct rx_call **acall;
+static CallPreamble(acall, activecall, tconn)
+    register struct rx_call *acall;
     int activecall;
+    struct rx_connection **tconn;
 
 {
     struct host *thost;
-    struct rx_connection *tconn;
     struct client *tclient;
     int retry_flag=1;
     int code = 0;
     char hoststr[16];
-    tconn = rx_ConnectionOf(*acall);
-    *acall = (struct rx_call *)tconn;      /* change it! */
+    if (!tconn) {
+       ViceLog (0, ("CallPreamble: unexpected null tconn!\n"));
+       return -1;
+    }
+    *tconn = rx_ConnectionOf(acall);
 
     H_LOCK
 retry:
-    tclient = h_FindClient_r(tconn);
+    tclient = h_FindClient_r(*tconn);
     if (tclient->prfail == 1) {        /* couldn't get the CPS */
        if (!retry_flag) {
          h_ReleaseClient_r(tclient);
@@ -435,8 +440,8 @@ static int VolumeRootVnode (targetptr)
 } /*VolumeRootVnode*/
 
 
-SRXAFS_FetchData (tcon, Fid, Pos, Len, OutStatus, CallBack, Sync)
-    struct rx_connection *tcon;                /* Rx connection handle */
+SRXAFS_FetchData (acall, Fid, Pos, Len, OutStatus, CallBack, Sync)
+    struct rx_call *acall;             /* Rx call */
     struct AFSFid *Fid;                        /* Fid of file to fetch */
     afs_int32 Pos, Len;                        /* Not implemented yet */
     struct AFSFetchStatus *OutStatus;  /* Returned status for Fid */
@@ -446,13 +451,13 @@ SRXAFS_FetchData (tcon, Fid, Pos, Len, OutStatus, CallBack, Sync)
 {
     int code;
 
-    code = common_FetchData (tcon, Fid, Pos, Len, OutStatus,
-                                                 CallBack, Sync, 0);
+    code = common_FetchData (acall, Fid, Pos, Len, OutStatus,
+                            CallBack, Sync, 0);
     return code;
 }
 
-SRXAFS_FetchData64 (tcon, Fid, Pos, Len, OutStatus, CallBack, Sync)
-    struct rx_connection *tcon;         /* Rx connection handle */
+SRXAFS_FetchData64 (acall, Fid, Pos, Len, OutStatus, CallBack, Sync)
+    struct rx_call *acall;             /* Rx call */
     struct AFSFid *Fid;                 /* Fid of file to fetch */
     afs_int64 Pos, Len;                 /* Not implemented yet */
     struct AFSFetchStatus *OutStatus;   /* Returned status for Fid */
@@ -474,13 +479,13 @@ SRXAFS_FetchData64 (tcon, Fid, Pos, Len, OutStatus, CallBack, Sync)
     tLen = Len.low;
 #endif /* AFS_64BIT_ENV */
 
-    code = common_FetchData (tcon, Fid, tPos, tLen, OutStatus,
-                                                 CallBack, Sync, 1);
+    code = common_FetchData (acall, Fid, tPos, tLen, OutStatus,
+                            CallBack, Sync, 1);
     return code;
 }
 
-common_FetchData (tcon, Fid, Pos, Len, OutStatus, CallBack, Sync, type)
-    struct rx_connection *tcon;         /* Rx connection handle */
+common_FetchData (acall, Fid, Pos, Len, OutStatus, CallBack, Sync, type)
+    struct rx_call *acall;             /* Rx call */
     struct AFSFid *Fid;                 /* Fid of file to fetch */
     afs_int32 Pos, Len;                 /* Not implemented yet */
     struct AFSFetchStatus *OutStatus;   /* Returned status for Fid */
@@ -496,7 +501,7 @@ common_FetchData (tcon, Fid, Pos, Len, OutStatus, CallBack, Sync, type)
     int            fileCode =  0;                  /* return code from vol package */
     Volume * volptr = 0;                   /* pointer to the volume */
     struct client *client;                 /* pointer to the client data */
-    struct rx_call *tcall;                 /* the call we're a part of */
+    struct rx_connection *tcon;                    /* the connection we're part of */
     afs_int32 rights, anyrights;                   /* rights for this and any user */
     struct client *t_client;                /* tmp ptr to client data */
     struct in_addr logHostAddr;                    /* host ip holder for inet_ntoa */
@@ -531,9 +536,7 @@ common_FetchData (tcon, Fid, Pos, Len, OutStatus, CallBack, Sync, type)
     AFSCallStats.FetchData++, AFSCallStats.TotalCalls++;
     FS_UNLOCK
 
-    /* CallPreamble changes tcon from a call to a conn */
-    tcall = (struct rx_call *) tcon;
-    if (errorCode = CallPreamble((struct rx_call **) &tcon, ACTIVECALL))
+    if (errorCode = CallPreamble(acall, ACTIVECALL, &tcon))
        goto Bad_FetchData;
 
     /* Get ptr to client data for user Id for logging */
@@ -594,10 +597,10 @@ common_FetchData (tcon, Fid, Pos, Len, OutStatus, CallBack, Sync, type)
 
     /* actually do the data transfer */
 #if FS_STATS_DETAILED
-    errorCode = FetchData_RXStyle(volptr, targetptr, tcall, Pos, Len, type,
+    errorCode = FetchData_RXStyle(volptr, targetptr, acall, Pos, Len, type,
                                  &bytesToXfer, &bytesXferred);
 #else
-    if (errorCode = FetchData_RXStyle(volptr, targetptr, tcall, Pos, Len, type))
+    if (errorCode = FetchData_RXStyle(volptr, targetptr, acall, Pos, Len, type))
        goto Bad_FetchData;
 #endif /* FS_STATS_DETAILED */
 
@@ -713,19 +716,18 @@ Bad_FetchData:
 
 #endif /* FS_STATS_DETAILED */
 
-    osi_auditU (tcall, FetchDataEvent, errorCode, AUD_FID, Fid, AUD_END);
+    osi_auditU (acall, FetchDataEvent, errorCode, AUD_FID, Fid, AUD_END);
     return(errorCode);
 
 } /*SRXAFS_FetchData*/
 
 
-SRXAFS_FetchACL (tcon, Fid, AccessList, OutStatus, Sync)
-    struct AFSVolSync *Sync;
-    struct rx_connection *tcon;                /* Rx connection handle */
+SRXAFS_FetchACL (acall, Fid, AccessList, OutStatus, Sync)
+    struct rx_call *acall;             /* Rx call */
     struct AFSFid *Fid;                        /* Fid of target dir */
     struct AFSOpaque *AccessList;      /* Returned contents of dir's ACL */
     struct AFSFetchStatus *OutStatus;  /* Returned status for the dir */
-
+    struct AFSVolSync *Sync;
 {
     Vnode * targetptr =        0;              /* pointer to vnode to fetch */
     Vnode * parentwhentargetnotdir = 0;        /* parent vnode if targetptr is a file */
@@ -733,7 +735,7 @@ SRXAFS_FetchACL (tcon, Fid, AccessList, OutStatus, Sync)
     Volume * volptr = 0;               /* pointer to the volume */
     struct client *client;             /* pointer to the client data */
     afs_int32 rights, anyrights;               /* rights for this and any user */
-    struct rx_call *tcall = (struct rx_call *) tcon; 
+    struct rx_connection *tcon = rx_ConnectionOf(acall);
     struct client *t_client;                /* tmp ptr to client data */
     struct in_addr logHostAddr;                    /* host ip holder for inet_ntoa */
 #if FS_STATS_DETAILED
@@ -758,7 +760,7 @@ SRXAFS_FetchACL (tcon, Fid, AccessList, OutStatus, Sync)
     FS_LOCK
     AFSCallStats.FetchACL++, AFSCallStats.TotalCalls++;
     FS_UNLOCK
-    if (errorCode = CallPreamble((struct rx_call **) &tcon, ACTIVECALL))
+    if (errorCode = CallPreamble(acall, ACTIVECALL, &tcon))
        goto Bad_FetchACL;
 
     /* Get ptr to client data for user Id for logging */
@@ -821,7 +823,7 @@ Bad_FetchACL:
 
 #endif /* FS_STATS_DETAILED */
 
-    osi_auditU (tcall, FetchACLEvent, errorCode, AUD_FID, Fid, AUD_END);
+    osi_auditU (acall, FetchACLEvent, errorCode, AUD_FID, Fid, AUD_END);
     return errorCode;
 
 } /*SRXAFS_FetchACL*/
@@ -831,8 +833,8 @@ Bad_FetchACL:
  * This routine is called exclusively by SRXAFS_FetchStatus(), and should be
  * merged into it when possible.
  */
-SAFSS_FetchStatus (tcall, Fid, OutStatus, CallBack, Sync)
-    struct rx_call *tcall;
+SAFSS_FetchStatus (acall, Fid, OutStatus, CallBack, Sync)
+    struct rx_call *acall;
     struct AFSFid *Fid;                        /* Fid of target file */
     struct AFSFetchStatus *OutStatus;  /* Returned status for the fid */
     struct AFSCallBack *CallBack;      /* if r/w, callback promise for Fid */
@@ -847,7 +849,7 @@ SAFSS_FetchStatus (tcall, Fid, OutStatus, CallBack, Sync)
     afs_int32 rights, anyrights;               /* rights for this and any user */
     struct client *t_client;            /* tmp ptr to client data */
     struct in_addr logHostAddr;                /* host ip holder for inet_ntoa */
-    struct rx_connection *tcon = rx_ConnectionOf(tcall);
+    struct rx_connection *tcon = rx_ConnectionOf(acall);
 
     /* Get ptr to client data for user Id for logging */
     t_client = (struct client *)  rx_GetSpecific(tcon, rxcon_client_key);
@@ -874,8 +876,8 @@ SAFSS_FetchStatus (tcall, Fid, OutStatus, CallBack, Sync)
     if (targetptr->disk.type != vDirectory) {
       if (errorCode = Check_PermissionRights(targetptr, client, rights,
                                             CHK_FETCHSTATUS, 0)) {
-         if (rx_GetCallAbortCode(tcall) == errorCode) 
-             rx_SetCallAbortCode(tcall, 0);
+         if (rx_GetCallAbortCode(acall) == errorCode) 
+             rx_SetCallAbortCode(acall, 0);
          goto Bad_FetchStatus;
       }
     }
@@ -902,8 +904,8 @@ Bad_FetchStatus:
 } /*SAFSS_FetchStatus*/
 
 
-SRXAFS_BulkStatus(tcon, Fids, OutStats, CallBacks, Sync)
-    struct rx_connection *tcon;
+SRXAFS_BulkStatus(acall, Fids, OutStats, CallBacks, Sync)
+    struct rx_call *acall;
     struct AFSCBFids *Fids;
     struct AFSBulkStats *OutStats;
     struct AFSCBs *CallBacks;
@@ -919,7 +921,7 @@ SRXAFS_BulkStatus(tcon, Fids, OutStats, CallBacks, Sync)
     struct client *client;             /* pointer to the client data */
     afs_int32 rights, anyrights;               /* rights for this and any user */
     register struct AFSFid *tfid;      /* file id we're dealing with now */
-    struct rx_call *tcall = (struct rx_call *) tcon; 
+    struct rx_connection *tcon = rx_ConnectionOf(acall);
 #if FS_STATS_DETAILED
     struct fs_stats_opTimingData *opP;      /* Ptr to this op's timing struct */
     struct timeval opStartTime,
@@ -956,7 +958,7 @@ SRXAFS_BulkStatus(tcon, Fids, OutStats, CallBacks, Sync)
        malloc(nfiles * sizeof(struct AFSCallBack));
     CallBacks->AFSCBs_len = nfiles;
 
-    if (errorCode = CallPreamble((struct rx_call **) &tcon, ACTIVECALL))
+    if (errorCode = CallPreamble(acall, ACTIVECALL, &tcon))
        goto Bad_BulkStatus;
 
     tfid = Fids->AFSCBFids_val;
@@ -978,8 +980,8 @@ SRXAFS_BulkStatus(tcon, Fids, OutStats, CallBacks, Sync)
        if (targetptr->disk.type != vDirectory) {
            if (errorCode = Check_PermissionRights(targetptr, client, rights,
                                                   CHK_FETCHSTATUS, 0)) {
-               if (rx_GetCallAbortCode(tcall) == errorCode) 
-                   rx_SetCallAbortCode(tcall, 0);
+               if (rx_GetCallAbortCode(acall) == errorCode) 
+                   rx_SetCallAbortCode(acall, 0);
                goto Bad_BulkStatus;
            }
        }
@@ -1033,14 +1035,14 @@ Bad_BulkStatus:
 
 Audit_and_Return:
     ViceLog(2, ("SAFS_BulkStatus       returns %d\n", errorCode)); 
-    osi_auditU (tcall, BulkFetchStatusEvent, errorCode, AUD_FIDS, Fids, AUD_END);
+    osi_auditU (acall, BulkFetchStatusEvent, errorCode, AUD_FIDS, Fids, AUD_END);
     return errorCode;
 
 } /*SRXAFS_BulkStatus*/
 
 
-SRXAFS_InlineBulkStatus(tcon, Fids, OutStats, CallBacks, Sync)
-    struct rx_connection *tcon;
+SRXAFS_InlineBulkStatus(acall, Fids, OutStats, CallBacks, Sync)
+    struct rx_call *acall;
     struct AFSCBFids *Fids;
     struct AFSBulkStats *OutStats;
     struct AFSCBs *CallBacks;
@@ -1055,7 +1057,7 @@ SRXAFS_InlineBulkStatus(tcon, Fids, OutStats, CallBacks, Sync)
     struct client *client;             /* pointer to the client data */
     afs_int32 rights, anyrights;               /* rights for this and any user */
     register struct AFSFid *tfid;      /* file id we're dealing with now */
-    struct rx_call *tcall = (struct rx_call *) tcon; 
+    struct rx_connection *tcon;
     AFSFetchStatus *tstatus;
 #if FS_STATS_DETAILED
     struct fs_stats_opTimingData *opP;      /* Ptr to this op's timing struct */
@@ -1093,7 +1095,7 @@ SRXAFS_InlineBulkStatus(tcon, Fids, OutStats, CallBacks, Sync)
        malloc(nfiles * sizeof(struct AFSCallBack));
     CallBacks->AFSCBs_len = nfiles;
 
-    if (errorCode = CallPreamble((struct rx_call **) &tcon, ACTIVECALL)) {
+    if (errorCode = CallPreamble(acall, ACTIVECALL, &tcon)) {
        goto Bad_InlineBulkStatus;
     }
 
@@ -1134,8 +1136,8 @@ SRXAFS_InlineBulkStatus(tcon, Fids, OutStats, CallBacks, Sync)
        }
 
        /* set OutStatus From the Fid  */
-       GetStatus(targetptr, &OutStats->AFSBulkStats_val[i],
-                 rights, anyrights, parentwhentargetnotdir);
+       GetStatus(targetptr, (struct AFSFetchStatus *) &OutStats->AFSBulkStats_val[i], 
+         rights, anyrights, parentwhentargetnotdir);
 
        /* If a r/w volume, also set the CallBack state */
        if (VolumeWriteable(volptr))
@@ -1182,22 +1184,21 @@ Bad_InlineBulkStatus:
 
 Audit_and_Return:
     ViceLog(2, ("SAFS_InlineBulkStatus returns %d\n", errorCode)); 
-    osi_auditU (tcall, InlineBulkFetchStatusEvent, errorCode, AUD_FIDS, Fids, AUD_END);
+    osi_auditU (acall, InlineBulkFetchStatusEvent, errorCode, AUD_FIDS, Fids, AUD_END);
     return 0;
 
 } /*SRXAFS_InlineBulkStatus*/
 
 
-SRXAFS_FetchStatus (tcon, Fid, OutStatus, CallBack, Sync)
-    struct AFSVolSync *Sync;
-    struct rx_connection *tcon;                /* Rx connection handle */
+SRXAFS_FetchStatus (acall, Fid, OutStatus, CallBack, Sync)
+    struct rx_call *acall;             /* Rx call */
     struct AFSFid *Fid;                        /* Fid of target file */
     struct AFSFetchStatus *OutStatus;  /* Returned status for the fid */
     struct AFSCallBack *CallBack;      /* if r/w, callback promise for Fid */
-
+    struct AFSVolSync *Sync;
 {
     afs_int32 code;
-    struct rx_call *tcall = (struct rx_call *) tcon; 
+    struct rx_connection *tcon;
 #if FS_STATS_DETAILED
     struct fs_stats_opTimingData *opP;      /* Ptr to this op's timing struct */
     struct timeval opStartTime,
@@ -1215,10 +1216,10 @@ SRXAFS_FetchStatus (tcon, Fid, OutStatus, CallBack, Sync)
     TM_GetTimeOfDay(&opStartTime, 0);
 #endif /* FS_STATS_DETAILED */
 
-    if (code = CallPreamble((struct rx_call **) &tcon, ACTIVECALL))
+    if (code = CallPreamble(acall, ACTIVECALL, &tcon))
        goto Bad_FetchStatus;
 
-    code = SAFSS_FetchStatus (tcall, Fid, OutStatus, CallBack, Sync);
+    code = SAFSS_FetchStatus (acall, Fid, OutStatus, CallBack, Sync);
 
 Bad_FetchStatus:    
     CallPostamble(tcon);
@@ -1242,22 +1243,21 @@ Bad_FetchStatus:
 
 #endif /* FS_STATS_DETAILED */
 
-    osi_auditU (tcall, FetchStatusEvent, code, AUD_FID, Fid, AUD_END);
+    osi_auditU (acall, FetchStatusEvent, code, AUD_FID, Fid, AUD_END);
     return code;
 
 } /*SRXAFS_FetchStatus*/
 
 
-SRXAFS_StoreData (tcon, Fid, InStatus, Pos, Length, FileLength, OutStatus, Sync)
-    struct AFSVolSync *Sync;
-    struct rx_connection *tcon;                /* Rx connection Handle */
+SRXAFS_StoreData (acall, Fid, InStatus, Pos, Length, FileLength, OutStatus, Sync)
+    struct rx_call *acall;             /* Rx call */
     struct AFSFid *Fid;                        /* Fid of taret file */
     struct AFSStoreStatus *InStatus;   /* Input Status for Fid */
     afs_uint32 Pos;                    /* Not implemented yet */
     afs_uint32 Length;                 /* Length of data to store */
     afs_uint32 FileLength;             /* Length of file after store */
     struct AFSFetchStatus *OutStatus;  /* Returned status for target fid */
-
+    struct AFSVolSync *Sync;
 {
     Vnode * targetptr =        0;              /* pointer to input fid */
     Vnode * parentwhentargetnotdir = 0;        /* parent of Fid to get ACL */
@@ -1266,10 +1266,10 @@ SRXAFS_StoreData (tcon, Fid, InStatus, Pos, Length, FileLength, OutStatus, Sync)
     int            fileCode =  0;              /* return code from vol package */
     Volume * volptr = 0;               /* pointer to the volume header */
     struct client * client;            /* pointer to client structure */
-    struct rx_call *tcall;             /* remember the call structure for ftp */
     afs_int32 rights, anyrights;               /* rights for this and any user */
     struct client *t_client;            /* tmp ptr to client data */
     struct in_addr logHostAddr;                    /* host ip holder for inet_ntoa */
+    struct rx_connection *tcon;
 #if FS_STATS_DETAILED
     struct fs_stats_opTimingData *opP;      /* Ptr to this op's timing struct */
     struct fs_stats_xferData *xferP;       /* Ptr to this op's byte size struct */
@@ -1300,9 +1300,8 @@ SRXAFS_StoreData (tcon, Fid, InStatus, Pos, Length, FileLength, OutStatus, Sync)
     FS_LOCK
     AFSCallStats.StoreData++, AFSCallStats.TotalCalls++;
     FS_UNLOCK
-    /* CallPreamble changes tcon from a call to a conn */
-    tcall = (struct rx_call *) tcon;
-    if (errorCode = CallPreamble((struct rx_call **) &tcon, ACTIVECALL))
+
+    if (errorCode = CallPreamble(acall, ACTIVECALL, &tcon))
        goto Bad_StoreData;
 
     /* Get ptr to client data for user Id for logging */
@@ -1359,13 +1358,13 @@ SRXAFS_StoreData (tcon, Fid, InStatus, Pos, Length, FileLength, OutStatus, Sync)
 
     /* Do the actual storing of the data */
 #if FS_STATS_DETAILED
-    errorCode = StoreData_RXStyle(volptr, targetptr, Fid, client, tcall,
+    errorCode = StoreData_RXStyle(volptr, targetptr, Fid, client, acall,
                                  Pos, Length, FileLength,
                                  (InStatus->Mask & AFS_FSYNC),
                                  &bytesToXfer, &bytesXferred);
 #else
     errorCode = StoreData_RXStyle(volptr, targetptr, Fid, client,
-                                     tcall, Pos, Length, FileLength,
+                                     acall, Pos, Length, FileLength,
                                      (InStatus->Mask & AFS_FSYNC));
     if (errorCode && (!targetptr->changed_newTime))
            goto Bad_StoreData;
@@ -1477,20 +1476,20 @@ Bad_StoreData:
       }
 #endif /* FS_STATS_DETAILED */
 
-    osi_auditU (tcall, StoreDataEvent, errorCode, AUD_FID, Fid, AUD_END);
+    osi_auditU (acall, StoreDataEvent, errorCode, AUD_FID, Fid, AUD_END);
     return(errorCode);
 
 } /*SRXAFS_StoreData*/
 
-SRXAFS_StoreData64 (tcon, Fid, InStatus, Pos, Length, FileLength, OutStatus, Sync)
-    struct AFSVolSync *Sync;
-    struct rx_connection *tcon;         /* Rx connection Handle */
+SRXAFS_StoreData64 (acall, Fid, InStatus, Pos, Length, FileLength, OutStatus, Sync)
+    struct rx_call *acall;             /* Rx call */
     struct AFSFid *Fid;                 /* Fid of taret file */
     struct AFSStoreStatus *InStatus;    /* Input Status for Fid */
     afs_uint64 Pos;                     /* Not implemented yet */
     afs_uint64 Length;                  /* Length of data to store */
     afs_uint64 FileLength;              /* Length of file after store */
     struct AFSFetchStatus *OutStatus;   /* Returned status for target fid */
+    struct AFSVolSync *Sync;
 {
     int code;
     afs_int32 tPos;
@@ -1511,18 +1510,17 @@ SRXAFS_StoreData64 (tcon, Fid, InStatus, Pos, Length, FileLength, OutStatus, Syn
     tFileLength = FileLength.low;
 #endif /* AFS_64BIT_ENV */
 
-    code = SRXAFS_StoreData (tcon, Fid, InStatus, tPos, tLength, tFileLength,
-                                OutStatus, Sync);
+    code = SRXAFS_StoreData (acall, Fid, InStatus, tPos, tLength, tFileLength,
+                             OutStatus, Sync);
     return code;
 }
 
-SRXAFS_StoreACL (tcon, Fid, AccessList, OutStatus, Sync)
-    struct AFSVolSync *Sync;
-    struct rx_connection *tcon;                /* Rx connection handle */
+SRXAFS_StoreACL (acall, Fid, AccessList, OutStatus, Sync)
+    struct rx_call *acall;             /* Rx call */
     struct AFSFid *Fid;                        /* Target dir's fid */
     struct AFSOpaque *AccessList;      /* Access List's contents */
     struct AFSFetchStatus *OutStatus;  /* Returned status of fid */
-
+    struct AFSVolSync *Sync;
 {
     Vnode * targetptr =        0;              /* pointer to input fid */
     Vnode * parentwhentargetnotdir = 0;        /* parent of Fid to get ACL */
@@ -1531,7 +1529,7 @@ SRXAFS_StoreACL (tcon, Fid, AccessList, OutStatus, Sync)
     Volume * volptr = 0;               /* pointer to the volume header */
     struct client * client;            /* pointer to client structure */
     afs_int32 rights, anyrights;               /* rights for this and any user */
-    struct rx_call *tcall = (struct rx_call *) tcon; 
+    struct rx_connection *tcon;
     struct client *t_client;            /* tmp ptr to client data */
     struct in_addr logHostAddr;                    /* host ip holder for inet_ntoa */
 #if FS_STATS_DETAILED
@@ -1550,7 +1548,7 @@ SRXAFS_StoreACL (tcon, Fid, AccessList, OutStatus, Sync)
     FS_UNLOCK
     TM_GetTimeOfDay(&opStartTime, 0);
 #endif /* FS_STATS_DETAILED */
-    if (errorCode = CallPreamble((struct rx_call **) &tcon, ACTIVECALL))
+    if (errorCode = CallPreamble(acall, ACTIVECALL, &tcon))
        goto Bad_StoreACL;
 
     /* Get ptr to client data for user Id for logging */
@@ -1599,7 +1597,7 @@ SRXAFS_StoreACL (tcon, Fid, AccessList, OutStatus, Sync)
     BreakCallBack(client->host, Fid, 0);
 
     /* Get the updated dir's status back to the caller */
-    GetStatus(targetptr, OutStatus, rights, anyrights, (struct vnode *)0);
+    GetStatus(targetptr, OutStatus, rights, anyrights, 0);
 
 Bad_StoreACL: 
     /* Update and store volume/vnode and parent vnodes back */
@@ -1625,7 +1623,7 @@ Bad_StoreACL:
     }
 #endif /* FS_STATS_DETAILED */
 
-    osi_auditU (tcall, StoreACLEvent, errorCode, AUD_FID, Fid, AUD_END);
+    osi_auditU (acall, StoreACLEvent, errorCode, AUD_FID, Fid, AUD_END);
     return errorCode;
 
 } /*SRXAFS_StoreACL*/
@@ -1635,8 +1633,8 @@ Bad_StoreACL:
  * Note: This routine is called exclusively from SRXAFS_StoreStatus(), and
  * should be merged when possible.
  */
-SAFSS_StoreStatus (tcon, Fid, InStatus, OutStatus, Sync)
-    struct rx_connection *tcon;                /* Rx connection Handle */
+SAFSS_StoreStatus (acall, Fid, InStatus, OutStatus, Sync)
+    struct rx_call *acall;             /* Rx call */
     struct AFSFid *Fid;                        /* Target file's fid */
     struct AFSStoreStatus *InStatus;   /* Input status for Fid */
     struct AFSFetchStatus *OutStatus;  /* Output status for fid */
@@ -1651,6 +1649,7 @@ SAFSS_StoreStatus (tcon, Fid, InStatus, OutStatus, Sync)
     afs_int32 rights, anyrights;               /* rights for this and any user */
     struct client *t_client;            /* tmp ptr to client data */
     struct in_addr logHostAddr;                /* host ip holder for inet_ntoa */
+    struct rx_connection *tcon = rx_ConnectionOf(acall);
 
     /* Get ptr to client data for user Id for logging */
     t_client = (struct client *) rx_GetSpecific(tcon, rxcon_client_key); 
@@ -1712,16 +1711,15 @@ Bad_StoreStatus:
 } /*SAFSS_StoreStatus*/
 
 
-SRXAFS_StoreStatus (tcon, Fid, InStatus, OutStatus, Sync)
-    struct AFSVolSync *Sync;
-    struct rx_connection *tcon;                /* Rx connection Handle */
+SRXAFS_StoreStatus (acall, Fid, InStatus, OutStatus, Sync)
+    struct rx_call *acall;             /* Rx call */
     struct AFSFid *Fid;                        /* Target file's fid */
     struct AFSStoreStatus *InStatus;   /* Input status for Fid */
     struct AFSFetchStatus *OutStatus;  /* Output status for fid */
-
+    struct AFSVolSync *Sync;
 {
     afs_int32 code;
-    struct rx_call *tcall = (struct rx_call *) tcon; 
+    struct rx_connection *tcon;
 #if FS_STATS_DETAILED
     struct fs_stats_opTimingData *opP;      /* Ptr to this op's timing struct */
     struct timeval opStartTime,
@@ -1739,10 +1737,10 @@ SRXAFS_StoreStatus (tcon, Fid, InStatus, OutStatus, Sync)
     TM_GetTimeOfDay(&opStartTime, 0);
 #endif /* FS_STATS_DETAILED */
 
-    if (code = CallPreamble((struct rx_call **) &tcon, ACTIVECALL))
+    if (code = CallPreamble(acall, ACTIVECALL, &tcon))
        goto Bad_StoreStatus;
 
-    code = SAFSS_StoreStatus (tcon, Fid, InStatus, OutStatus, Sync);
+    code = SAFSS_StoreStatus (acall, Fid, InStatus, OutStatus, Sync);
 
 Bad_StoreStatus:
     CallPostamble(tcon);
@@ -1766,7 +1764,7 @@ Bad_StoreStatus:
 
 #endif /* FS_STATS_DETAILED */
 
-    osi_auditU (tcall, StoreStatusEvent, code, AUD_FID, Fid, AUD_END);
+    osi_auditU (acall, StoreStatusEvent, code, AUD_FID, Fid, AUD_END);
     return code;
 
 } /*SRXAFS_StoreStatus*/
@@ -1776,8 +1774,8 @@ Bad_StoreStatus:
  * This routine is called exclusively by SRXAFS_RemoveFile(), and should be
  * merged in when possible.
  */
-SAFSS_RemoveFile (tcon, DirFid, Name, OutDirStatus, Sync)
-    struct rx_connection *tcon;                 /* Rx connection handle */
+SAFSS_RemoveFile (acall, DirFid, Name, OutDirStatus, Sync)
+    struct rx_call *acall;              /* Rx call */
     struct AFSFid *DirFid;              /* Dir fid for file to remove */
     char *Name;                                 /* File name to remove */
     struct AFSFetchStatus *OutDirStatus; /* Output status for dir fid's */
@@ -1795,6 +1793,7 @@ SAFSS_RemoveFile (tcon, DirFid, Name, OutDirStatus, Sync)
     afs_int32 rights, anyrights;               /* rights for this and any user */
     struct client *t_client;            /* tmp ptr to client data */
     struct in_addr logHostAddr;                /* host ip holder for inet_ntoa */
+    struct rx_connection *tcon = rx_ConnectionOf(acall);
 
     /* Get ptr to client data for user Id for logging */
     t_client = (struct client *) rx_GetSpecific(tcon, rxcon_client_key); 
@@ -1838,7 +1837,7 @@ SAFSS_RemoveFile (tcon, DirFid, Name, OutDirStatus, Sync)
 #endif /* FS_STATS_DETAILED */
 
     /* Return the updated parent dir's status back to caller */
-    GetStatus(parentptr, OutDirStatus, rights, anyrights, (struct vnode *)0);
+    GetStatus(parentptr, OutDirStatus, rights, anyrights, 0);
 
     /* Handle internal callback state for the parent and the deleted file */
     if (targetptr->disk.linkCount == 0) {
@@ -1870,16 +1869,15 @@ Bad_RemoveFile:
 } /*SAFSS_RemoveFile*/
 
 
-SRXAFS_RemoveFile (tcon, DirFid, Name, OutDirStatus, Sync)
-    struct AFSVolSync *Sync;
-    struct rx_connection *tcon;                 /* Rx connection handle */
+SRXAFS_RemoveFile (acall, DirFid, Name, OutDirStatus, Sync)
+    struct rx_call *acall;              /* Rx call */
     struct AFSFid *DirFid;              /* Dir fid for file to remove */
     char *Name;                                 /* File name to remove */
     struct AFSFetchStatus *OutDirStatus; /* Output status for dir fid's */
-
+    struct AFSVolSync *Sync;
 {
     afs_int32 code;
-    struct rx_call *tcall = (struct rx_call *) tcon; 
+    struct rx_connection *tcon;
 #if FS_STATS_DETAILED
     struct fs_stats_opTimingData *opP;      /* Ptr to this op's timing struct */
     struct timeval opStartTime,
@@ -1897,10 +1895,10 @@ SRXAFS_RemoveFile (tcon, DirFid, Name, OutDirStatus, Sync)
     TM_GetTimeOfDay(&opStartTime, 0);
 #endif /* FS_STATS_DETAILED */
 
-    if (code = CallPreamble((struct rx_call **) &tcon, ACTIVECALL))
+    if (code = CallPreamble(acall, ACTIVECALL, &tcon))
        goto Bad_RemoveFile;
 
-    code = SAFSS_RemoveFile (tcon, DirFid, Name, OutDirStatus, Sync);
+    code = SAFSS_RemoveFile (acall, DirFid, Name, OutDirStatus, Sync);
 
 Bad_RemoveFile:    
     CallPostamble(tcon);
@@ -1924,7 +1922,7 @@ Bad_RemoveFile:
 
 #endif /* FS_STATS_DETAILED */
 
-    osi_auditU (tcall, RemoveFileEvent, code, AUD_FID, DirFid, AUD_STR, Name, AUD_END);
+    osi_auditU (acall, RemoveFileEvent, code, AUD_FID, DirFid, AUD_STR, Name, AUD_END);
     return code;
 
 } /*SRXAFS_RemoveFile*/
@@ -1934,9 +1932,9 @@ Bad_RemoveFile:
  * This routine is called exclusively from SRXAFS_CreateFile(), and should
  * be merged in when possible.
  */
-SAFSS_CreateFile (tcon, DirFid, Name, InStatus, OutFid, OutFidStatus,
+SAFSS_CreateFile (acall, DirFid, Name, InStatus, OutFid, OutFidStatus,
                 OutDirStatus, CallBack, Sync)
-    struct rx_connection *tcon;                 /* Rx connection handle */
+    struct rx_call *acall;              /* Rx call */
     struct AFSFid *DirFid;              /* Parent Dir fid */
     char *Name;                                 /* File name to be created */
     struct AFSStoreStatus *InStatus;    /* Input status for newly created file */
@@ -1957,6 +1955,7 @@ SAFSS_CreateFile (tcon, DirFid, Name, InStatus, OutFid, OutFidStatus,
     afs_int32 rights, anyrights;               /* rights for this and any user */
     struct client *t_client;            /* tmp ptr to client data */
     struct in_addr logHostAddr;                /* host ip holder for inet_ntoa */
+    struct rx_connection *tcon = rx_ConnectionOf(acall);
 
     /* Get ptr to client data for user Id for logging */
     t_client = (struct client *) rx_GetSpecific(tcon, rxcon_client_key); 
@@ -2010,7 +2009,7 @@ SAFSS_CreateFile (tcon, DirFid, Name, InStatus, OutFid, OutFidStatus,
 
     /* set up the return status for the parent dir and the newly created file */
     GetStatus(targetptr, OutFidStatus, rights, anyrights, parentptr);
-    GetStatus(parentptr, OutDirStatus, rights, anyrights, (struct vnode *)0);
+    GetStatus(parentptr, OutDirStatus, rights, anyrights, 0);
 
     /* convert the write lock to a read lock before breaking callbacks */
     VVnodeWriteToRead(&errorCode, parentptr);
@@ -2031,9 +2030,8 @@ Bad_CreateFile:
 } /*SAFSS_CreateFile*/
 
 
-SRXAFS_CreateFile (tcon, DirFid, Name, InStatus, OutFid, OutFidStatus, OutDirStatus, CallBack, Sync)
-    struct AFSVolSync *Sync;
-    struct rx_connection *tcon;                 /* Rx connection handle */
+SRXAFS_CreateFile (acall, DirFid, Name, InStatus, OutFid, OutFidStatus, OutDirStatus, CallBack, Sync)
+    struct rx_call *acall;              /* Rx call */
     struct AFSFid *DirFid;              /* Parent Dir fid */
     char *Name;                                 /* File name to be created */
     struct AFSStoreStatus *InStatus;    /* Input status for newly created file */
@@ -2041,10 +2039,10 @@ SRXAFS_CreateFile (tcon, DirFid, Name, InStatus, OutFid, OutFidStatus, OutDirSta
     struct AFSFetchStatus *OutFidStatus; /* Output status for new file */
     struct AFSFetchStatus *OutDirStatus; /* Ouput status for the parent dir */
     struct AFSCallBack *CallBack;       /* Return callback promise for new file */
-
+    struct AFSVolSync *Sync;
 {
     afs_int32 code;
-    struct rx_call *tcall = (struct rx_call *) tcon; 
+    struct rx_connection *tcon;
 #if FS_STATS_DETAILED
     struct fs_stats_opTimingData *opP;      /* Ptr to this op's timing struct */
     struct timeval opStartTime,
@@ -2062,10 +2060,10 @@ SRXAFS_CreateFile (tcon, DirFid, Name, InStatus, OutFid, OutFidStatus, OutDirSta
     TM_GetTimeOfDay(&opStartTime, 0);
 #endif /* FS_STATS_DETAILED */
 
-    if (code = CallPreamble((struct rx_call **) &tcon, ACTIVECALL))
+    if (code = CallPreamble(acall, ACTIVECALL, &tcon))
        goto Bad_CreateFile;
 
-    code = SAFSS_CreateFile (tcon, DirFid, Name, InStatus, OutFid,
+    code = SAFSS_CreateFile (acall, DirFid, Name, InStatus, OutFid,
                            OutFidStatus, OutDirStatus, CallBack, Sync);
 
 Bad_CreateFile:    
@@ -2089,7 +2087,7 @@ Bad_CreateFile:
     }
 #endif /* FS_STATS_DETAILED */
 
-    osi_auditU (tcall, CreateFileEvent, code, AUD_FID, DirFid, AUD_STR, Name, AUD_END);
+    osi_auditU (acall, CreateFileEvent, code, AUD_FID, DirFid, AUD_STR, Name, AUD_END);
     return code;
 
 } /*SRXAFS_CreateFile*/
@@ -2099,9 +2097,9 @@ Bad_CreateFile:
  * This routine is called exclusively from SRXAFS_Rename(), and should be
  * merged in when possible.
  */
-SAFSS_Rename (tcon, OldDirFid, OldName, NewDirFid, NewName, OutOldDirStatus,
+SAFSS_Rename (acall, OldDirFid, OldName, NewDirFid, NewName, OutOldDirStatus,
             OutNewDirStatus, Sync)
-    struct rx_connection *tcon;                    /* Rx connection handle */
+    struct rx_call *acall;                 /* Rx call */
     struct AFSFid *OldDirFid;              /* From parent dir's fid */
     char *OldName;                         /* From file name */
     struct AFSFid *NewDirFid;              /* To parent dir's fid */
@@ -2135,6 +2133,7 @@ SAFSS_Rename (tcon, OldDirFid, OldName, NewDirFid, NewName, OutOldDirStatus,
     int code;
     struct client *t_client;            /* tmp ptr to client data */
     struct in_addr logHostAddr;                /* host ip holder for inet_ntoa */
+    struct rx_connection *tcon = rx_ConnectionOf(acall);
 
     /* Get ptr to client data for user Id for logging */
     t_client = (struct client *) rx_GetSpecific(tcon, rxcon_client_key); 
@@ -2374,7 +2373,7 @@ SAFSS_Rename (tcon, OldDirFid, OldName, NewDirFid, NewName, OutOldDirStatus,
                                 V_parentId(volptr));
                IH_RELEASE(newfileptr->handle);
                if (errorCode == -1) {
-                   ViceLog(0, ("Del: inode=%d, name=%s, errno=%d\n",
+                   ViceLog(0, ("Del: inode=%s, name=%s, errno=%d\n",
                                PrintInode(NULL, VN_GET_INO(newfileptr)),
                                NewName, errno));
                    if ((errno != ENOENT) && (errno != EIO) && (errno != ENXIO))
@@ -2441,8 +2440,8 @@ SAFSS_Rename (tcon, OldDirFid, OldName, NewDirFid, NewName, OutOldDirStatus,
     }
 
     /* set up return status */
-    GetStatus(oldvptr, OutOldDirStatus, rights, anyrights, (struct vnode *)0);
-    GetStatus(newvptr, OutNewDirStatus, newrights, newanyrights, (struct vnode *)0);
+    GetStatus(oldvptr, OutOldDirStatus, rights, anyrights, 0);
+    GetStatus(newvptr, OutNewDirStatus, newrights, newanyrights, 0);
     if (newfileptr && doDelete) {
        DeleteFileCallBacks(&newFileFid);       /* no other references */
     }
@@ -2491,19 +2490,18 @@ Bad_Rename:
 } /*SAFSS_Rename*/
 
 
-SRXAFS_Rename (tcon, OldDirFid, OldName, NewDirFid, NewName, OutOldDirStatus, OutNewDirStatus, Sync)
-    struct AFSVolSync *Sync;
-    struct rx_connection *tcon;                     /* Rx connection handle */
+SRXAFS_Rename (acall, OldDirFid, OldName, NewDirFid, NewName, OutOldDirStatus, OutNewDirStatus, Sync)
+    struct rx_call *acall;                  /* Rx call */
     struct AFSFid *OldDirFid;               /* From parent dir's fid */
     char *OldName;                          /* From file name */
     struct AFSFid *NewDirFid;               /* To parent dir's fid */
     char *NewName;                          /* To new file name */
     struct AFSFetchStatus *OutOldDirStatus;  /* Output status for From parent dir */
     struct AFSFetchStatus *OutNewDirStatus;  /* Output status for To parent dir */
-
+    struct AFSVolSync *Sync;
 {
     afs_int32 code;
-    struct rx_call *tcall = (struct rx_call *) tcon; 
+    struct rx_connection *tcon;
 #if FS_STATS_DETAILED
     struct fs_stats_opTimingData *opP;      /* Ptr to this op's timing struct */
     struct timeval opStartTime,
@@ -2521,10 +2519,10 @@ SRXAFS_Rename (tcon, OldDirFid, OldName, NewDirFid, NewName, OutOldDirStatus, Ou
     TM_GetTimeOfDay(&opStartTime, 0);
 #endif /* FS_STATS_DETAILED */
 
-    if (code = CallPreamble((struct rx_call **) &tcon, ACTIVECALL))
+    if (code = CallPreamble(acall, ACTIVECALL, &tcon))
        goto Bad_Rename;
 
-    code = SAFSS_Rename (tcon, OldDirFid, OldName, NewDirFid, NewName,
+    code = SAFSS_Rename (acall, OldDirFid, OldName, NewDirFid, NewName,
                         OutOldDirStatus, OutNewDirStatus, Sync);
 
 Bad_Rename:    
@@ -2549,7 +2547,7 @@ Bad_Rename:
 
 #endif /* FS_STATS_DETAILED */
 
-    osi_auditU (tcall, RenameFileEvent, code, AUD_FID, OldDirFid, AUD_STR, OldName, AUD_FID, NewDirFid, AUD_STR, NewName, AUD_END);
+    osi_auditU (acall, RenameFileEvent, code, AUD_FID, OldDirFid, AUD_STR, OldName, AUD_FID, NewDirFid, AUD_STR, NewName, AUD_END);
     return code;
 
 } /*SRXAFS_Rename*/
@@ -2559,8 +2557,8 @@ Bad_Rename:
  * This routine is called exclusively by SRXAFS_Symlink(), and should be
  * merged into it when possible.
  */
-SAFSS_Symlink (tcon, DirFid, Name, LinkContents, InStatus, OutFid, OutFidStatus, OutDirStatus, Sync)
-    struct rx_connection *tcon;                 /* Rx connection handle */
+SAFSS_Symlink (acall, DirFid, Name, LinkContents, InStatus, OutFid, OutFidStatus, OutDirStatus, Sync)
+    struct rx_call *acall;              /* Rx call */
     struct AFSFid *DirFid;              /* Parent dir's fid */
     char *Name;                                 /* File name to create */
     char *LinkContents;                         /* Contents of the new created file */
@@ -2583,6 +2581,7 @@ SAFSS_Symlink (tcon, DirFid, Name, LinkContents, InStatus, OutFid, OutFidStatus,
     struct client *t_client;            /* tmp ptr to client data */
     struct in_addr logHostAddr;                /* host ip holder for inet_ntoa */
     FdHandle_t *fdP;
+    struct rx_connection *tcon = rx_ConnectionOf(acall);
 
     /* Get ptr to client data for user Id for logging */
     t_client = (struct client *) rx_GetSpecific(tcon, rxcon_client_key); 
@@ -2663,7 +2662,7 @@ SAFSS_Symlink (tcon, DirFid, Name, LinkContents, InStatus, OutFid, OutFidStatus,
      * to caller.
      */
     GetStatus(targetptr, OutFidStatus, rights, anyrights, parentptr);
-    GetStatus(parentptr, OutDirStatus, rights, anyrights, (struct vnode *)0);
+    GetStatus(parentptr, OutDirStatus, rights, anyrights, 0);
 
     /* convert the write lock to a read lock before breaking callbacks */
     VVnodeWriteToRead(&errorCode, parentptr);
@@ -2681,9 +2680,9 @@ Bad_SymLink:
 } /*SAFSS_Symlink*/
 
 
-SRXAFS_Symlink (tcon, DirFid, Name, LinkContents, InStatus, OutFid, OutFidStatus, OutDirStatus, Sync)
+SRXAFS_Symlink (acall, DirFid, Name, LinkContents, InStatus, OutFid, OutFidStatus, OutDirStatus, Sync)
     struct AFSVolSync *Sync;
-    struct rx_connection *tcon;                 /* Rx connection handle */
+    struct rx_call *acall;              /* Rx call */
     struct AFSFid *DirFid;              /* Parent dir's fid */
     char *Name;                                 /* File name to create */
     char *LinkContents;                         /* Contents of the new created file */
@@ -2694,7 +2693,7 @@ SRXAFS_Symlink (tcon, DirFid, Name, LinkContents, InStatus, OutFid, OutFidStatus
 
 {
     afs_int32 code;
-    struct rx_call *tcall = (struct rx_call *) tcon; 
+    struct rx_connection *tcon;
 #if FS_STATS_DETAILED
     struct fs_stats_opTimingData *opP;      /* Ptr to this op's timing struct */
     struct timeval opStartTime,
@@ -2712,10 +2711,10 @@ SRXAFS_Symlink (tcon, DirFid, Name, LinkContents, InStatus, OutFid, OutFidStatus
     TM_GetTimeOfDay(&opStartTime, 0);
 #endif /* FS_STATS_DETAILED */
 
-    if (code = CallPreamble((struct rx_call **) &tcon, ACTIVECALL))
+    if (code = CallPreamble(acall, ACTIVECALL, &tcon))
        goto Bad_Symlink;
 
-    code = SAFSS_Symlink (tcon, DirFid, Name, LinkContents, InStatus, OutFid,
+    code = SAFSS_Symlink (acall, DirFid, Name, LinkContents, InStatus, OutFid,
                         OutFidStatus, OutDirStatus, Sync);
 
 Bad_Symlink:    
@@ -2740,7 +2739,7 @@ Bad_Symlink:
 
 #endif /* FS_STATS_DETAILED */
 
-    osi_auditU (tcall, SymlinkEvent, code, AUD_FID, DirFid, AUD_STR, Name, AUD_END);
+    osi_auditU (acall, SymlinkEvent, code, AUD_FID, DirFid, AUD_STR, Name, AUD_END);
     return code;
 
 } /*SRXAFS_Symlink*/
@@ -2750,8 +2749,8 @@ Bad_Symlink:
  * This routine is called exclusively by SRXAFS_Link(), and should be
  * merged into it when possible.
  */
-SAFSS_Link (tcon, DirFid, Name, ExistingFid, OutFidStatus, OutDirStatus, Sync)
-    struct rx_connection *tcon;                 /* Rx connection handle */
+SAFSS_Link (acall, DirFid, Name, ExistingFid, OutFidStatus, OutDirStatus, Sync)
+    struct rx_call *acall;              /* Rx call */
     struct AFSFid *DirFid;              /* Parent dir's fid */
     char *Name;                                 /* File name to create */
     struct AFSFid *ExistingFid;                 /* Fid of existing fid we'll make link to */
@@ -2770,6 +2769,7 @@ SAFSS_Link (tcon, DirFid, Name, ExistingFid, OutFidStatus, OutDirStatus, Sync)
     afs_int32 rights, anyrights;               /* rights for this and any user */
     struct client *t_client;            /* tmp ptr to client data */
     struct in_addr logHostAddr;                /* host ip holder for inet_ntoa */
+    struct rx_connection *tcon = rx_ConnectionOf(acall);
 
     /* Get ptr to client data for user Id for logging */
     t_client = (struct client *) rx_GetSpecific(tcon, rxcon_client_key); 
@@ -2856,7 +2856,7 @@ SAFSS_Link (tcon, DirFid, Name, ExistingFid, OutFidStatus, OutDirStatus, Sync)
 
     /* set up return status */
     GetStatus(targetptr, OutFidStatus, rights, anyrights, parentptr);
-    GetStatus(parentptr, OutDirStatus, rights, anyrights, (struct vnode *)0);
+    GetStatus(parentptr, OutDirStatus, rights, anyrights, 0);
 
     /* convert the write locks to read locks before breaking callbacks */
     VVnodeWriteToRead(&errorCode, targetptr);
@@ -2881,18 +2881,17 @@ Bad_Link:
 } /*SAFSS_Link*/
 
 
-SRXAFS_Link (tcon, DirFid, Name, ExistingFid, OutFidStatus, OutDirStatus, Sync)
-    struct AFSVolSync *Sync;
-    struct rx_connection *tcon;                 /* Rx connection handle */
+SRXAFS_Link (acall, DirFid, Name, ExistingFid, OutFidStatus, OutDirStatus, Sync)
+    struct rx_call *acall;              /* Rx call */
     struct AFSFid *DirFid;              /* Parent dir's fid */
     char *Name;                                 /* File name to create */
     struct AFSFid *ExistingFid;                 /* Fid of existing fid we'll make link to */
     struct AFSFetchStatus *OutFidStatus; /* Output status for newly created file */
     struct AFSFetchStatus *OutDirStatus; /* Outpout status for parent dir */
-
+    struct AFSVolSync *Sync;
 {
     afs_int32 code;
-    struct rx_call *tcall = (struct rx_call *) tcon; 
+    struct rx_connection *tcon;
 #if FS_STATS_DETAILED
     struct fs_stats_opTimingData *opP;      /* Ptr to this op's timing struct */
     struct timeval opStartTime,
@@ -2910,10 +2909,10 @@ SRXAFS_Link (tcon, DirFid, Name, ExistingFid, OutFidStatus, OutDirStatus, Sync)
     TM_GetTimeOfDay(&opStartTime, 0);
 #endif /* FS_STATS_DETAILED */
 
-    if (code = CallPreamble((struct rx_call **) &tcon, ACTIVECALL))
+    if (code = CallPreamble(acall, ACTIVECALL, &tcon))
        goto Bad_Link;
 
-    code = SAFSS_Link (tcon, DirFid, Name, ExistingFid, OutFidStatus,
+    code = SAFSS_Link (acall, DirFid, Name, ExistingFid, OutFidStatus,
                      OutDirStatus, Sync);
     
 Bad_Link:
@@ -2938,7 +2937,7 @@ Bad_Link:
 
 #endif /* FS_STATS_DETAILED */
 
-    osi_auditU (tcall, LinkEvent, code, AUD_FID, DirFid, AUD_STR, Name, AUD_FID, ExistingFid, AUD_END);
+    osi_auditU (acall, LinkEvent, code, AUD_FID, DirFid, AUD_STR, Name, AUD_FID, ExistingFid, AUD_END);
     return code;
 
 } /*SRXAFS_Link*/
@@ -2948,9 +2947,9 @@ Bad_Link:
  * This routine is called exclusively by SRXAFS_MakeDir(), and should be
  * merged into it when possible.
  */
-SAFSS_MakeDir (tcon, DirFid, Name, InStatus, OutFid, OutFidStatus,
+SAFSS_MakeDir (acall, DirFid, Name, InStatus, OutFid, OutFidStatus,
              OutDirStatus, CallBack, Sync)
-    struct rx_connection *tcon;                 /* Rx connection handle */
+    struct rx_call *acall;              /* Rx call */
     struct AFSFid *DirFid;              /* Parent dir's fid */
     char *Name;                                 /* Name of dir to be created */
     struct AFSStoreStatus *InStatus;    /* Input status for new dir */
@@ -2974,6 +2973,7 @@ SAFSS_MakeDir (tcon, DirFid, Name, InStatus, OutFid, OutFidStatus,
     afs_int32 rights, anyrights;               /* rights for this and any user */
     struct client *t_client;            /* tmp ptr to client data */
     struct in_addr logHostAddr;                /* host ip holder for inet_ntoa */
+    struct rx_connection *tcon = rx_ConnectionOf(acall);
 
     /* Get ptr to client data for user Id for logging */
     t_client = (struct client *) rx_GetSpecific(tcon, rxcon_client_key); 
@@ -3074,9 +3074,8 @@ Bad_MakeDir:
 } /*SAFSS_MakeDir*/
 
 
-SRXAFS_MakeDir (tcon, DirFid, Name, InStatus, OutFid, OutFidStatus, OutDirStatus, CallBack, Sync)
-    struct AFSVolSync *Sync;
-    struct rx_connection *tcon;                 /* Rx connection handle */
+SRXAFS_MakeDir (acall, DirFid, Name, InStatus, OutFid, OutFidStatus, OutDirStatus, CallBack, Sync)
+    struct rx_call *acall;              /* Rx call */
     struct AFSFid *DirFid;              /* Parent dir's fid */
     char *Name;                                 /* Name of dir to be created */
     struct AFSStoreStatus *InStatus;    /* Input status for new dir */
@@ -3084,10 +3083,10 @@ SRXAFS_MakeDir (tcon, DirFid, Name, InStatus, OutFid, OutFidStatus, OutDirStatus
     struct AFSFetchStatus *OutFidStatus; /* Output status for new directory */
     struct AFSFetchStatus *OutDirStatus; /* Output status for parent dir */
     struct AFSCallBack *CallBack;       /* Returned callback promise for new dir */
-
+    struct AFSVolSync *Sync;
 {
     afs_int32 code;
-    struct rx_call *tcall = (struct rx_call *) tcon; 
+    struct rx_connection *tcon;
 #if FS_STATS_DETAILED
     struct fs_stats_opTimingData *opP;      /* Ptr to this op's timing struct */
     struct timeval opStartTime,
@@ -3104,7 +3103,7 @@ SRXAFS_MakeDir (tcon, DirFid, Name, InStatus, OutFid, OutFidStatus, OutDirStatus
     FS_UNLOCK
     TM_GetTimeOfDay(&opStartTime, 0);
 #endif /* FS_STATS_DETAILED */
-    if (code = CallPreamble((struct rx_call **) &tcon, ACTIVECALL))
+    if (code = CallPreamble(acall, ACTIVECALL, &tcon))
        goto Bad_MakeDir;
 
     code = SAFSS_MakeDir (tcon, DirFid, Name, InStatus, OutFid,
@@ -3132,7 +3131,7 @@ Bad_MakeDir:
 
 #endif /* FS_STATS_DETAILED */
 
-    osi_auditU (tcall, MakeDirEvent, code, AUD_FID, DirFid, AUD_STR, Name, AUD_END);
+    osi_auditU (acall, MakeDirEvent, code, AUD_FID, DirFid, AUD_STR, Name, AUD_END);
     return code;
 
 } /*SRXAFS_MakeDir*/
@@ -3142,8 +3141,8 @@ Bad_MakeDir:
  * This routine is called exclusively by SRXAFS_RemoveDir(), and should be
  * merged into it when possible.
  */
-SAFSS_RemoveDir (tcon, DirFid, Name, OutDirStatus, Sync)
-    struct rx_connection *tcon;                 /* Rx connection handle */
+SAFSS_RemoveDir (acall, DirFid, Name, OutDirStatus, Sync)
+    struct rx_call *acall;              /* Rx call */
     struct AFSFid *DirFid;              /* Parent dir's fid */
     char *Name;                                 /* (Empty) dir's name to be removed */
     struct AFSFetchStatus *OutDirStatus; /* Output status for the parent dir */
@@ -3162,6 +3161,7 @@ SAFSS_RemoveDir (tcon, DirFid, Name, OutDirStatus, Sync)
     Vnode debugvnode1, debugvnode2;
     struct client *t_client;            /* tmp ptr to client data */
     struct in_addr logHostAddr;                /* host ip holder for inet_ntoa */
+    struct rx_connection *tcon = rx_ConnectionOf(acall);
 
     /* Get ptr to client data for user Id for logging */
     t_client = (struct client *) rx_GetSpecific(tcon, rxcon_client_key); 
@@ -3233,16 +3233,15 @@ Bad_RemoveDir:
 } /*SAFSS_RemoveDir*/
 
 
-SRXAFS_RemoveDir (tcon, DirFid, Name, OutDirStatus, Sync)
-    struct AFSVolSync *Sync;
-    struct rx_connection *tcon;                 /* Rx connection handle */
+SRXAFS_RemoveDir (acall, DirFid, Name, OutDirStatus, Sync)
+    struct rx_call *acall;              /* Rx call */
     struct AFSFid *DirFid;              /* Parent dir's fid */
     char *Name;                                 /* (Empty) dir's name to be removed */
     struct AFSFetchStatus *OutDirStatus; /* Output status for the parent dir */
-
+    struct AFSVolSync *Sync;
 {
     afs_int32 code;
-    struct rx_call *tcall = (struct rx_call *) tcon; 
+    struct rx_connection *tcon;
 #if FS_STATS_DETAILED
     struct fs_stats_opTimingData *opP;      /* Ptr to this op's timing struct */
     struct timeval opStartTime,
@@ -3260,7 +3259,7 @@ SRXAFS_RemoveDir (tcon, DirFid, Name, OutDirStatus, Sync)
     TM_GetTimeOfDay(&opStartTime, 0);
 #endif /* FS_STATS_DETAILED */
 
-    if (code = CallPreamble((struct rx_call **) &tcon, ACTIVECALL))
+    if (code = CallPreamble(acall, ACTIVECALL, &tcon))
        goto Bad_RemoveDir;
 
     code = SAFSS_RemoveDir (tcon, DirFid, Name, OutDirStatus, Sync);
@@ -3287,7 +3286,7 @@ Bad_RemoveDir:
 
 #endif /* FS_STATS_DETAILED */
 
-    osi_auditU (tcall, RemoveDirEvent, code, AUD_FID, DirFid, AUD_STR, Name, AUD_END);
+    osi_auditU (acall, RemoveDirEvent, code, AUD_FID, DirFid, AUD_STR, Name, AUD_END);
     return code;
 
 } /*SRXAFS_RemoveDir*/
@@ -3297,8 +3296,8 @@ Bad_RemoveDir:
  * This routine is called exclusively by SRXAFS_SetLock(), and should be
  * merged into it when possible.
  */
-SAFSS_SetLock (tcon, Fid, type, Sync)
-    struct rx_connection *tcon; /* Rx connection handle */
+SAFSS_SetLock (acall, Fid, type, Sync)
+    struct rx_call *acall; /* Rx call */
     struct AFSFid *Fid;                /* Fid of file to lock */
     ViceLockType type;         /* Type of lock (Read or write) */
     struct AFSVolSync *Sync;
@@ -3313,6 +3312,7 @@ SAFSS_SetLock (tcon, Fid, type, Sync)
     struct client *t_client;            /* tmp ptr to client data */
     struct in_addr logHostAddr;                /* host ip holder for inet_ntoa */
     static char        * locktype[2] = {"LockRead","LockWrite"};
+    struct rx_connection *tcon = rx_ConnectionOf(acall);
 
     if (type != LockRead && type != LockWrite) {
         errorCode = EINVAL;
@@ -3357,27 +3357,25 @@ Bad_SetLock:
 }  /*SAFSS_SetLock*/
 
 
-SRXAFS_OldSetLock(tcon, Fid, type, Sync)
-    struct AFSVolSync *Sync;
-    struct rx_connection *tcon;        /* Rx connection handle */
+SRXAFS_OldSetLock(acall, Fid, type, Sync)
+    struct rx_call *acall;     /* Rx call */
     struct AFSFid *Fid;                /* Fid of file to lock */
     ViceLockType type;         /* Type of lock (Read or write) */
-
+    struct AFSVolSync *Sync;
 {
-    return SRXAFS_SetLock(tcon, Fid, type, Sync);
+    return SRXAFS_SetLock(acall, Fid, type, Sync);
 
 } /*SRXAFS_OldSetLock*/
 
 
-SRXAFS_SetLock (tcon, Fid, type, Sync)
-    struct AFSVolSync *Sync;
-    struct rx_connection *tcon;        /* Rx connection handle */
+SRXAFS_SetLock (acall, Fid, type, Sync)
+    struct rx_call *acall;     /* Rx call */
     struct AFSFid *Fid;                /* Fid of file to lock */
     ViceLockType type;         /* Type of lock (Read or write) */
-
+    struct AFSVolSync *Sync;
 {
     afs_int32 code;
-    struct rx_call *tcall = (struct rx_call *) tcon; 
+    struct rx_connection *tcon;
 #if FS_STATS_DETAILED
     struct fs_stats_opTimingData *opP;      /* Ptr to this op's timing struct */
     struct timeval opStartTime,
@@ -3395,7 +3393,7 @@ SRXAFS_SetLock (tcon, Fid, type, Sync)
     TM_GetTimeOfDay(&opStartTime, 0);
 #endif /* FS_STATS_DETAILED */
 
-    if (code = CallPreamble((struct rx_call **) &tcon, ACTIVECALL))
+    if (code = CallPreamble(acall, ACTIVECALL, &tcon))
        goto Bad_SetLock;
 
     code = SAFSS_SetLock (tcon, Fid, type, Sync);
@@ -3421,7 +3419,7 @@ Bad_SetLock:
     }
 #endif /* FS_STATS_DETAILED */
 
-    osi_auditU (tcall, SetLockEvent, code, AUD_FID, Fid, AUD_LONG, type, AUD_END);
+    osi_auditU (acall, SetLockEvent, code, AUD_FID, Fid, AUD_LONG, type, AUD_END);
     return code;
 
 } /*SRXAFS_SetLock*/
@@ -3431,8 +3429,8 @@ Bad_SetLock:
  * This routine is called exclusively by SRXAFS_ExtendLock(), and should be
  * merged into it when possible.
  */
-SAFSS_ExtendLock (tcon, Fid, Sync)
-    struct rx_connection *tcon;        /* Rx connection handle */
+SAFSS_ExtendLock (acall, Fid, Sync)
+    struct rx_call *acall;     /* Rx call */
     struct AFSFid *Fid;                /* Fid of file whose lock we extend */
     struct AFSVolSync *Sync;
 
@@ -3445,6 +3443,7 @@ SAFSS_ExtendLock (tcon, Fid, Sync)
     afs_int32 rights, anyrights;               /* rights for this and any user */
     struct client *t_client;            /* tmp ptr to client data */
     struct in_addr logHostAddr;                /* host ip holder for inet_ntoa */
+    struct rx_connection *tcon = rx_ConnectionOf(acall);
 
     /* Get ptr to client data for user Id for logging */
     t_client = (struct client *) rx_GetSpecific(tcon, rxcon_client_key); 
@@ -3484,25 +3483,23 @@ Bad_ExtendLock:
 } /*SAFSS_ExtendLock*/
 
 
-SRXAFS_OldExtendLock (tcon, Fid, Sync)
-    struct AFSVolSync *Sync;
-    struct rx_connection *tcon;        /* Rx connection handle */
+SRXAFS_OldExtendLock (acall, Fid, Sync)
+    struct rx_call *acall;     /* Rx call */
     struct AFSFid *Fid;                /* Fid of file whose lock we extend */
-
+    struct AFSVolSync *Sync;
 {
-    return SRXAFS_ExtendLock(tcon, Fid, Sync);
+    return SRXAFS_ExtendLock(acall, Fid, Sync);
 
 } /*SRXAFS_OldExtendLock*/
 
 
-SRXAFS_ExtendLock (tcon, Fid, Sync)
-    struct AFSVolSync *Sync;
-    struct rx_connection *tcon;        /* Rx connection handle */
+SRXAFS_ExtendLock (acall, Fid, Sync)
+    struct rx_call *acall;     /* Rx call */
     struct AFSFid *Fid;                /* Fid of file whose lock we extend */
-
+    struct AFSVolSync *Sync;
 {
     afs_int32 code;
-    struct rx_call *tcall = (struct rx_call *) tcon; 
+    struct rx_connection *tcon;
 #if FS_STATS_DETAILED
     struct fs_stats_opTimingData *opP;      /* Ptr to this op's timing struct */
     struct timeval opStartTime,
@@ -3520,7 +3517,7 @@ SRXAFS_ExtendLock (tcon, Fid, Sync)
     TM_GetTimeOfDay(&opStartTime, 0);
 #endif /* FS_STATS_DETAILED */
 
-    if (code = CallPreamble((struct rx_call **) &tcon, ACTIVECALL))
+    if (code = CallPreamble(acall, ACTIVECALL, &tcon))
        goto Bad_ExtendLock;
 
     code = SAFSS_ExtendLock (tcon, Fid, Sync);
@@ -3547,7 +3544,7 @@ Bad_ExtendLock:
 
 #endif /* FS_STATS_DETAILED */
 
-    osi_auditU (tcall, ExtendLockEvent, code, AUD_FID, Fid , AUD_END);
+    osi_auditU (acall, ExtendLockEvent, code, AUD_FID, Fid , AUD_END);
     return code;
 
 } /*SRXAFS_ExtendLock*/
@@ -3557,8 +3554,8 @@ Bad_ExtendLock:
  * This routine is called exclusively by SRXAFS_ReleaseLock(), and should be
  * merged into it when possible.
  */
-SAFSS_ReleaseLock (tcon, Fid, Sync)
-    struct rx_connection *tcon;        /* Rx connection handle */
+SAFSS_ReleaseLock (acall, Fid, Sync)
+    struct rx_call *acall;     /* Rx call */
     struct AFSFid *Fid;                /* Fid of file to release lock */
     struct AFSVolSync *Sync;
 
@@ -3571,6 +3568,7 @@ SAFSS_ReleaseLock (tcon, Fid, Sync)
     afs_int32 rights, anyrights;               /* rights for this and any user */
     struct client *t_client;            /* tmp ptr to client data */
     struct in_addr logHostAddr;                /* host ip holder for inet_ntoa */
+    struct rx_connection *tcon = rx_ConnectionOf(acall);
 
     /* Get ptr to client data for user Id for logging */
     t_client = (struct client *) rx_GetSpecific(tcon, rxcon_client_key); 
@@ -3619,25 +3617,23 @@ Bad_ReleaseLock:
 } /*SAFSS_ReleaseLock*/
 
 
-SRXAFS_OldReleaseLock (tcon, Fid, Sync)
-    struct AFSVolSync *Sync;
-    struct rx_connection *tcon;        /* Rx connection handle */
+SRXAFS_OldReleaseLock (acall, Fid, Sync)
+    struct rx_call *acall;     /* Rx call */
     struct AFSFid *Fid;                /* Fid of file to release lock */
-
+    struct AFSVolSync *Sync;
 {
-    return SRXAFS_ReleaseLock(tcon, Fid, Sync);
+    return SRXAFS_ReleaseLock(acall, Fid, Sync);
 
 } /*SRXAFS_OldReleaseLock*/
 
 
-SRXAFS_ReleaseLock (tcon, Fid, Sync)
-    struct AFSVolSync *Sync;
-    struct rx_connection *tcon;        /* Rx connection handle */
+SRXAFS_ReleaseLock (acall, Fid, Sync)
+    struct rx_call *acall;     /* Rx call */
     struct AFSFid *Fid;                /* Fid of file to release lock */
-
+    struct AFSVolSync *Sync;
 {
     afs_int32 code;
-    struct rx_call *tcall = (struct rx_call *) tcon; 
+    struct rx_connection *tcon;
 #if FS_STATS_DETAILED
     struct fs_stats_opTimingData *opP;      /* Ptr to this op's timing struct */
     struct timeval opStartTime,
@@ -3655,7 +3651,7 @@ SRXAFS_ReleaseLock (tcon, Fid, Sync)
     TM_GetTimeOfDay(&opStartTime, 0);
 #endif /* FS_STATS_DETAILED */
 
-    if (code = CallPreamble((struct rx_call **) &tcon, ACTIVECALL))
+    if (code = CallPreamble(acall, ACTIVECALL, &tcon))
        goto Bad_ReleaseLock;
 
     code = SAFSS_ReleaseLock (tcon, Fid, Sync);
@@ -3682,7 +3678,7 @@ Bad_ReleaseLock:
 
 #endif /* FS_STATS_DETAILED */
 
-    osi_auditU (tcall, ReleaseLockEvent, code, AUD_FID, Fid , AUD_END);
+    osi_auditU (acall, ReleaseLockEvent, code, AUD_FID, Fid , AUD_END);
     return code;
 
 } /*SRXAFS_ReleaseLock*/
@@ -3692,8 +3688,8 @@ Bad_ReleaseLock:
  * This routine is called exclusively by SRXAFS_GetStatistics(), and should be
  * merged into it when possible.
  */
-static GetStatistics (tcon, Statistics)
-    struct rx_connection *tcon;              /* Rx connection handle */
+static GetStatistics (acall, Statistics)
+    struct rx_call *acall;           /* Rx call */
     struct AFSStatistics *Statistics; /* Placeholder for returned AFS statistics */
 {
     ViceLog(1, ("SAFS_GetStatistics Received\n"));
@@ -3710,12 +3706,13 @@ static GetStatistics (tcon, Statistics)
 } /*GetStatistics*/
 
 
-SRXAFS_GetStatistics (tcon, Statistics)
-    struct rx_connection *tcon;              /* Rx connection handle */
-    struct AFSStatistics *Statistics; /* Placeholder for returned AFS statistics */
+SRXAFS_GetStatistics (acall, Statistics)
+    struct rx_call *acall;           /* Rx call */
+    struct ViceStatistics *Statistics; /* Placeholder for returned AFS statistics */
 
 {
     afs_int32 code;
+    struct rx_connection *tcon;
 #if FS_STATS_DETAILED
     struct fs_stats_opTimingData *opP;      /* Ptr to this op's timing struct */
     struct timeval opStartTime,
@@ -3733,7 +3730,7 @@ SRXAFS_GetStatistics (tcon, Statistics)
     TM_GetTimeOfDay(&opStartTime, 0);
 #endif /* FS_STATS_DETAILED */
 
-    if (code = CallPreamble((struct rx_call **) &tcon, NOTACTIVECALL))
+    if (code = CallPreamble(acall, NOTACTIVECALL, &tcon))
        goto Bad_GetStatistics;
 
     code = GetStatistics (tcon, Statistics);
@@ -4172,8 +4169,8 @@ int SRXAFS_GetXStats(a_call, a_clientVersionNum, a_collectionNumber, a_srvVersio
 } /*SRXAFS_GetXStats*/
 
 
-SRXAFS_GiveUpCallBacks (tcon, FidArray, CallBackArray)
-    struct rx_connection *tcon;                /* Rx connection handle */
+SRXAFS_GiveUpCallBacks (acall, FidArray, CallBackArray)
+    struct rx_call *acall;             /* Rx call */
     struct AFSCBFids *FidArray;                /* Array of Fids entries */
     struct AFSCBs *CallBackArray;      /* array of callbacks */
 
@@ -4181,6 +4178,7 @@ SRXAFS_GiveUpCallBacks (tcon, FidArray, CallBackArray)
     afs_int32 errorCode;
     register int i;
     struct client *client;
+    struct rx_connection *tcon;
 #if FS_STATS_DETAILED
     struct fs_stats_opTimingData *opP;      /* Ptr to this op's timing struct */
     struct timeval opStartTime,
@@ -4202,7 +4200,7 @@ SRXAFS_GiveUpCallBacks (tcon, FidArray, CallBackArray)
     FS_LOCK
     AFSCallStats.GiveUpCallBacks++, AFSCallStats.TotalCalls++;
     FS_UNLOCK
-    if (errorCode = CallPreamble((struct rx_call **) &tcon, ACTIVECALL))
+    if (errorCode = CallPreamble(acall, ACTIVECALL, &tcon))
        goto Bad_GiveUpCallBacks;
 
     if (FidArray->AFSCBFids_len < CallBackArray->AFSCBs_len) {
@@ -4247,8 +4245,8 @@ out:
 } /*SRXAFS_GiveUpCallBacks*/
 
 
-SRXAFS_NGetVolumeInfo (tcon, avolid, avolinfo)
-    struct rx_connection *tcon;                /* Rx connection handle */
+SRXAFS_NGetVolumeInfo (acall, avolid, avolinfo)
+    struct rx_call *acall;             /* Rx call */
     char *avolid;                      /* Volume name/id */
     struct AFSVolumeInfo *avolinfo;    /* Returned volume's specific info */
 
@@ -4278,8 +4276,8 @@ SRXAFS_Lookup(call_p, afs_dfid_p, afs_name_p, afs_fid_p,
 }
 
 
-SRXAFS_FlushCPS(tcon, vids, addrs, spare1, spare2, spare3)
-    struct rx_connection *tcon;
+SRXAFS_FlushCPS(acall, vids, addrs, spare1, spare2, spare3)
+    struct rx_call *acall;
     struct ViceIds *vids;
     struct IPAddrs *addrs;
     afs_int32 spare1, *spare2, *spare3;
@@ -4289,7 +4287,7 @@ SRXAFS_FlushCPS(tcon, vids, addrs, spare1, spare2, spare3)
     afs_int32 *vd, *addr;
     int            errorCode = 0;              /* return code to caller */
     struct client *client;
-    struct rx_call *tcall = (struct rx_call *) tcon; 
+    struct rx_connection *tcon = rx_ConnectionOf(acall);
 
     ViceLog(1, ("SRXAFS_FlushCPS\n"));
     FS_LOCK
@@ -4337,8 +4335,8 @@ Bad_FlushCPS:
 
 
 
-static GetVolumeInfo (tcon, avolid, avolinfo)
-    struct rx_connection *tcon;                /* Rx Connection handle */
+static GetVolumeInfo (acall, avolid, avolinfo)
+    struct rx_call *acall;             /* Rx call */
     char *avolid;                      /* Volume name/id */
     struct VolumeInfo *avolinfo;       /* Returned volume's specific info */
 
@@ -4476,13 +4474,14 @@ static TryLocalVLServer(avolid, avolinfo)
 }
 
 
-SRXAFS_GetVolumeInfo (tcon, avolid, avolinfo)
-    struct rx_connection *tcon;                /* Rx connection handle */
+SRXAFS_GetVolumeInfo (acall, avolid, avolinfo)
+    struct rx_call *acall;             /* Rx call */
     char *avolid;                      /* Volume name/id */
     struct VolumeInfo *avolinfo;       /* Returned volume's specific info */
 
 {
     afs_int32 code;
+    struct rx_connection *tcon;
 #if FS_STATS_DETAILED
     struct fs_stats_opTimingData *opP;      /* Ptr to this op's timing struct */
     struct timeval opStartTime,
@@ -4499,7 +4498,7 @@ SRXAFS_GetVolumeInfo (tcon, avolid, avolinfo)
     FS_UNLOCK
     TM_GetTimeOfDay(&opStartTime, 0);
 #endif /* FS_STATS_DETAILED */
-    if (code = CallPreamble((struct rx_call **) &tcon, ACTIVECALL))
+    if (code = CallPreamble(acall, ACTIVECALL, &tcon))
        goto Bad_GetVolumeInfo;
 
     code = GetVolumeInfo (tcon, avolid, avolinfo);
@@ -4532,8 +4531,8 @@ Bad_GetVolumeInfo:
 } /*SRXAFS_GetVolumeInfo*/
 
 
-SRXAFS_GetVolumeStatus (tcon, avolid, FetchVolStatus, Name, OfflineMsg, Motd)
-    struct rx_connection *tcon;                  /* Rx connection handle */
+SRXAFS_GetVolumeStatus (acall, avolid, FetchVolStatus, Name, OfflineMsg, Motd)
+    struct rx_call *acall;               /* Rx call */
     afs_int32 avolid;                    /* Volume's id */
     AFSFetchVolumeStatus *FetchVolStatus; /* Place to hold volume's status info */
     char **Name;                         /* Returned volume's name */
@@ -4548,6 +4547,7 @@ SRXAFS_GetVolumeStatus (tcon, avolid, FetchVolStatus, Name, OfflineMsg, Motd)
     struct client * client;            /* pointer to client entry */
     afs_int32 rights, anyrights;               /* rights for this and any user */
     AFSFid  dummyFid;
+    struct rx_connection *tcon;
 #if FS_STATS_DETAILED
     struct fs_stats_opTimingData *opP;      /* Ptr to this op's timing struct */
     struct timeval opStartTime,
@@ -4566,7 +4566,7 @@ SRXAFS_GetVolumeStatus (tcon, avolid, FetchVolStatus, Name, OfflineMsg, Motd)
 #endif /* FS_STATS_DETAILED */
 
     ViceLog(1,("SAFS_GetVolumeStatus for volume %u\n", avolid));
-    if (errorCode = CallPreamble((struct rx_call **) &tcon, ACTIVECALL))
+    if (errorCode = CallPreamble(acall, ACTIVECALL, &tcon))
        goto Bad_GetVolumeStatus;
 
     FS_LOCK
@@ -4622,8 +4622,8 @@ Bad_GetVolumeStatus:
 } /*SRXAFS_GetVolumeStatus*/
 
 
-SRXAFS_SetVolumeStatus (tcon, avolid, StoreVolStatus, Name, OfflineMsg, Motd)
-    struct rx_connection *tcon;                  /* Rx connection handle */
+SRXAFS_SetVolumeStatus (acall, avolid, StoreVolStatus, Name, OfflineMsg, Motd)
+    struct rx_call *acall;               /* Rx call */
     afs_int32 avolid;                    /* Volume's id */
     AFSStoreVolumeStatus *StoreVolStatus; /* Adjusted output volume's status */
     char *Name;                                  /* Set new volume's name, if applicable */
@@ -4638,7 +4638,7 @@ SRXAFS_SetVolumeStatus (tcon, avolid, StoreVolStatus, Name, OfflineMsg, Motd)
     struct client * client;            /* pointer to client entry */
     afs_int32 rights, anyrights;               /* rights for this and any user */
     AFSFid  dummyFid;
-    struct rx_call *tcall = (struct rx_call *) tcon; 
+    struct rx_connection *tcon = rx_ConnectionOf(acall);
 #if FS_STATS_DETAILED
     struct fs_stats_opTimingData *opP;      /* Ptr to this op's timing struct */
     struct timeval opStartTime,
@@ -4657,7 +4657,7 @@ SRXAFS_SetVolumeStatus (tcon, avolid, StoreVolStatus, Name, OfflineMsg, Motd)
 #endif /* FS_STATS_DETAILED */
 
     ViceLog(1,("SAFS_SetVolumeStatus for volume %u\n", avolid));
-    if (errorCode = CallPreamble((struct rx_call **) &tcon, ACTIVECALL))
+    if (errorCode = CallPreamble(acall, ACTIVECALL, &tcon))
        goto Bad_SetVolumeStatus;
 
     FS_LOCK
@@ -4707,7 +4707,7 @@ SRXAFS_SetVolumeStatus (tcon, avolid, StoreVolStatus, Name, OfflineMsg, Motd)
 
 #endif /* FS_STATS_DETAILED */
 
-    osi_auditU (tcall, SetVolumeStatusEvent, errorCode, AUD_LONG, avolid, AUD_STR, Name, AUD_END);
+    osi_auditU (acall, SetVolumeStatusEvent, errorCode, AUD_LONG, avolid, AUD_STR, Name, AUD_END);
     return(errorCode);
 
 } /*SRXAFS_SetVolumeStatus*/
@@ -4715,8 +4715,8 @@ SRXAFS_SetVolumeStatus (tcon, avolid, StoreVolStatus, Name, OfflineMsg, Motd)
 #define        DEFAULTVOLUME   "root.afs"
 
 
-SRXAFS_GetRootVolume (tcon, VolumeName)
-    struct rx_connection * tcon; /* R-Connection handle */
+SRXAFS_GetRootVolume (acall, VolumeName)
+    struct rx_call *acall; /* Rx call */
     char **VolumeName;          /* Returned AFS's root volume name */
 
 {
@@ -4724,6 +4724,7 @@ SRXAFS_GetRootVolume (tcon, VolumeName)
     int len;
     char *temp;
     int errorCode = 0;         /* error code */
+    struct rx_connection *tcon;
 #if FS_STATS_DETAILED
     struct fs_stats_opTimingData *opP;      /* Ptr to this op's timing struct */
     struct timeval opStartTime,
@@ -4744,7 +4745,7 @@ SRXAFS_GetRootVolume (tcon, VolumeName)
     return FSERR_EOPNOTSUPP;
 
 #ifdef notdef
-    if (errorCode = CallPreamble((struct rx_call **) &tcon, ACTIVECALL))
+    if (errorCode = CallPreamble(acall, ACTIVECALL, &tcon))
        goto Bad_GetRootVolume;
     FS_LOCK
     AFSCallStats.GetRootVolume++, AFSCallStats.TotalCalls++;
@@ -4800,13 +4801,14 @@ Bad_GetRootVolume:
 
 
 /* still works because a struct CBS is the same as a struct AFSOpaque */
-SRXAFS_CheckToken (tcon, AfsId, Token)
-    struct rx_connection *tcon; /* Rx connection handle */
+SRXAFS_CheckToken (acall, AfsId, Token)
+    struct rx_call *acall; /* Rx call */
     afs_int32 AfsId;                   /* AFS id whose token we verify */
-    struct CBS *Token;         /* Token value for used Afsid */
+    struct AFSOpaque *Token;           /* Token value for used Afsid */
 
 {
     afs_int32 code;
+    struct rx_connection *tcon;
 #if FS_STATS_DETAILED
     struct fs_stats_opTimingData *opP;      /* Ptr to this op's timing struct */
     struct timeval opStartTime,
@@ -4824,7 +4826,7 @@ SRXAFS_CheckToken (tcon, AfsId, Token)
     TM_GetTimeOfDay(&opStartTime, 0);
 #endif /* FS_STATS_DETAILED */
 
-    if (code = CallPreamble((struct rx_call **) &tcon, ACTIVECALL))
+    if (code = CallPreamble(acall, ACTIVECALL, &tcon))
        goto Bad_CheckToken;
 
     code = FSERR_ECONNREFUSED;
@@ -4856,8 +4858,8 @@ Bad_CheckToken:
 } /*SRXAFS_CheckToken*/
 
 
-static GetTime (tcon, Seconds, USeconds)
-    struct rx_connection *tcon;            /* R-Connection handle */
+static GetTime (acall, Seconds, USeconds)
+    struct rx_call *acall;         /* Rx call */
     afs_uint32 *Seconds;           /* Returned time in seconds */
     afs_uint32 *USeconds;          /* Returned leftovers in useconds */
 
@@ -4878,12 +4880,13 @@ static GetTime (tcon, Seconds, USeconds)
 } /*GetTime*/
 
 
-SRXAFS_GetTime (tcon, Seconds, USeconds)
-    struct rx_connection *tcon;            /* Rx connection handle */
+SRXAFS_GetTime (acall, Seconds, USeconds)
+    struct rx_call *acall;         /* Rx call */
     afs_uint32 *Seconds;           /* Returned time in seconds */
     afs_uint32 *USeconds;          /* Returned leftovers in useconds */
 {
     afs_int32 code;
+    struct rx_connection *tcon;
 #if FS_STATS_DETAILED
     struct fs_stats_opTimingData *opP;      /* Ptr to this op's timing struct */
     struct timeval opStartTime,
@@ -4901,7 +4904,7 @@ SRXAFS_GetTime (tcon, Seconds, USeconds)
     TM_GetTimeOfDay(&opStartTime, 0);
 #endif /* FS_STATS_DETAILED */
 
-    if (code = CallPreamble((struct rx_call **) &tcon, NOTACTIVECALL))
+    if (code = CallPreamble(acall, NOTACTIVECALL, &tcon))
        goto Bad_GetTime;
 
     code = GetTime (tcon, Seconds, USeconds);
@@ -7144,8 +7147,8 @@ PrintVolumeStatus(status)
  * and is not supported by the AFS fileserver. We just return EINVAL.
  * The cache manager should not generate this call to an AFS cache manager.
  */
-SRXAFS_DFSSymlink (tcon, DirFid, Name, LinkContents, InStatus, OutFid, OutFidStatus, OutDirStatus, CallBack, Sync)
-    struct rx_connection *tcon;                 /* Rx connection handle */
+SRXAFS_DFSSymlink (acall, DirFid, Name, LinkContents, InStatus, OutFid, OutFidStatus, OutDirStatus, CallBack, Sync)
+    struct rx_call *acall;              /* Rx call */
     struct AFSFid *DirFid;              /* Parent dir's fid */
     char *Name;                                 /* File name to create */
     char *LinkContents;                         /* Contents of the new created file */
@@ -7159,8 +7162,8 @@ SRXAFS_DFSSymlink (tcon, DirFid, Name, LinkContents, InStatus, OutFid, OutFidSta
     return EINVAL;
 }
 
-SRXAFS_ResidencyCmd (tcon, Fid, Inputs, Outputs)
-    struct rx_connection *tcon;
+SRXAFS_ResidencyCmd (acall, Fid, Inputs, Outputs)
+    struct rx_call *acall;
     struct AFSFid *Fid;
     struct ResidencyCmdInputs *Inputs;
     struct ResidencyCmdOutputs *Outputs;