Really apply improve-type-safety-and-prototype-matching-20020226.
[openafs.git] / src / viced / afsfileprocs.c
index 9bfb395..dfa2e07 100644 (file)
  * privilege"? 
  */
 
+#include <afsconfig.h>
 #include <afs/param.h>
+
+RCSID("$Header$");
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <errno.h>
@@ -74,7 +78,7 @@
 #include <rx/rx.h>
 #include <rx/rx_globals.h>
 #include <sys/stat.h>
-#if ! defined(AFS_SGI_ENV) && ! defined(AFS_AIX32_ENV) && ! defined(AFS_NT40_ENV) && ! defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
+#if ! defined(AFS_SGI_ENV) && ! defined(AFS_AIX32_ENV) && ! defined(AFS_NT40_ENV) && ! defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_XBSD_ENV)
 #include <sys/map.h>
 #endif
 #if !defined(AFS_NT40_ENV)
@@ -85,7 +89,7 @@
 #include <sys/statfs.h>
 #include <sys/lockf.h>
 #else
-#if !defined(AFS_SUN5_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
+#if !defined(AFS_SUN5_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_XBSD_ENV)
 #include <sys/dk.h>
 #endif
 #endif
@@ -165,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 */
 
 
@@ -179,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.
  */
@@ -255,26 +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;
-    tconn = rx_ConnectionOf(*acall);
-    *acall = (struct rx_call *)tconn;      /* change it! */
+    char hoststr[16];
+    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);
@@ -308,21 +318,23 @@ retry:
 
     h_Lock_r(thost);
     if (thost->hostFlags & HOSTDELETED) {
-      ViceLog(3,("Discarded a packet for deleted host %08x\n",thost->host));
+      ViceLog(3,("Discarded a packet for deleted host %s\n",afs_inet_ntoa_r(thost->host,hoststr)));
       code = VBUSY; /* raced, so retry */
     }
     else if (thost->hostFlags & VENUSDOWN) {
       if (BreakDelayedCallBacks_r(thost)) {
-       ViceLog(0,("BreakDelayedCallbacks FAILED for host %08x which IS UP.  Possible network or routing failure.\n",thost->host));
+       ViceLog(0,("BreakDelayedCallbacks FAILED for host %s which IS UP.  Possible network or routing failure.\n",
+               afs_inet_ntoa_r(thost->host, hoststr)));
        if ( MultiProbeAlternateAddress_r (thost) ) {
-           ViceLog(0, ("MultiProbe failed to find new address for host %x.%d\n",
-                       thost->host, thost->port));
+           ViceLog(0, ("MultiProbe failed to find new address for host %s:%d\n",
+                       afs_inet_ntoa_r(thost->host, hoststr), thost->port));
            code = -1;
        } else {
-           ViceLog(0, ("MultiProbe found new address for host %x.%d\n",
-                       thost->host, thost->port));
+           ViceLog(0, ("MultiProbe found new address for host %s:%d\n",
+                       afs_inet_ntoa_r(thost->host, hoststr), thost->port));
            if (BreakDelayedCallBacks_r(thost)) {
-               ViceLog(0,("BreakDelayedCallbacks FAILED AGAIN for host %08x which IS UP.  Possible network or routing failure.\n",thost->host));
+               ViceLog(0,("BreakDelayedCallbacks FAILED AGAIN for host %s which IS UP.  Possible network or routing failure.\n",
+                       afs_inet_ntoa_r(thost->host, hoststr)));
                code = -1;
            }
        }
@@ -428,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 */
@@ -437,6 +449,51 @@ SRXAFS_FetchData (tcon, Fid, Pos, Len, OutStatus, CallBack, Sync)
     struct AFSVolSync *Sync;           /* synchronization info */
 
 {
+    int code;
+
+    code = common_FetchData (acall, Fid, Pos, Len, OutStatus,
+                            CallBack, Sync, 0);
+    return code;
+}
+
+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 */
+    struct AFSCallBack *CallBack;       /* If r/w return CB for Fid */
+    struct AFSVolSync *Sync;            /* synchronization info */
+{
+    int code;
+    afs_int32 tPos, tLen;
+
+#ifdef AFS_64BIT_ENV
+    if (Pos + Len > 0x7fffffff)
+        return E2BIG;
+    tPos = Pos;
+    tLen = Len;
+#else /* AFS_64BIT_ENV */
+    if (Pos.high || Len.high)
+        return E2BIG;
+    tPos = Pos.low;
+    tLen = Len.low;
+#endif /* AFS_64BIT_ENV */
+
+    code = common_FetchData (acall, Fid, tPos, tLen, OutStatus,
+                            CallBack, Sync, 1);
+    return code;
+}
+
+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 */
+    struct AFSCallBack *CallBack;       /* If r/w return CB for Fid */
+    struct AFSVolSync *Sync;            /* synchronization info */
+    int type;                           /* 32 bit or 64 bit call */
+
+{ 
     Vnode * targetptr =        0;                  /* pointer to vnode to fetch */
     Vnode * parentwhentargetnotdir = 0;            /* parent vnode if vptr is a file */
     Vnode   tparentwhentargetnotdir;       /* parent vnode for GetStatus */
@@ -444,7 +501,7 @@ SRXAFS_FetchData (tcon, Fid, Pos, Len, OutStatus, CallBack, Sync)
     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 */
@@ -479,9 +536,7 @@ SRXAFS_FetchData (tcon, Fid, Pos, Len, OutStatus, CallBack, Sync)
     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 */
@@ -519,7 +574,7 @@ SRXAFS_FetchData (tcon, Fid, Pos, Len, OutStatus, CallBack, Sync)
 
     /* Check whether the caller has permission access to fetch the data */
     if (errorCode = Check_PermissionRights(targetptr, client, rights,
-                                          CHK_FETCHDATA, 0))
+                                          CHK_FETCHDATA, 0)) 
        goto Bad_FetchData;
 
     /*
@@ -542,10 +597,10 @@ SRXAFS_FetchData (tcon, Fid, Pos, Len, OutStatus, CallBack, Sync)
 
     /* actually do the data transfer */
 #if FS_STATS_DETAILED
-    errorCode = FetchData_RXStyle(volptr, targetptr, tcall, Pos, Len,
+    errorCode = FetchData_RXStyle(volptr, targetptr, acall, Pos, Len, type,
                                  &bytesToXfer, &bytesXferred);
 #else
-    if (errorCode = FetchData_RXStyle(volptr, targetptr, tcall, Pos, Len))
+    if (errorCode = FetchData_RXStyle(volptr, targetptr, acall, Pos, Len, type))
        goto Bad_FetchData;
 #endif /* FS_STATS_DETAILED */
 
@@ -631,7 +686,7 @@ SRXAFS_FetchData (tcon, Fid, Pos, Len, OutStatus, CallBack, Sync)
        SetCallBackStruct(AddCallBack(client->host, Fid), CallBack);
     else {
       struct AFSFid myFid;             
-      bzero(&myFid, sizeof(struct AFSFid));
+      memset(&myFid, 0, sizeof(struct AFSFid));
       myFid.Volume = Fid->Volume;
       SetCallBackStruct(AddVolCallBack(client->host, &myFid), CallBack);
       }
@@ -661,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 */
@@ -681,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
@@ -706,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 */
@@ -769,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*/
@@ -779,8 +833,8 @@ Bad_FetchACL:
  * This routine is called exclusively by SRXAFS_FetchStatus(), and should be
  * merged into it when possible.
  */
-SAFSS_FetchStatus (tcon, Fid, OutStatus, CallBack, Sync)
-    struct rx_connection *tcon;                /* Rx connection handle */
+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 */
@@ -795,6 +849,7 @@ SAFSS_FetchStatus (tcon, 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(acall);
 
     /* Get ptr to client data for user Id for logging */
     t_client = (struct client *)  rx_GetSpecific(tcon, rxcon_client_key);
@@ -820,8 +875,11 @@ SAFSS_FetchStatus (tcon, Fid, OutStatus, CallBack, Sync)
     /* Are we allowed to fetch Fid's status? */
     if (targetptr->disk.type != vDirectory) {
       if (errorCode = Check_PermissionRights(targetptr, client, rights,
-                                            CHK_FETCHSTATUS, 0))
-       goto Bad_FetchStatus;
+                                            CHK_FETCHSTATUS, 0)) {
+         if (rx_GetCallAbortCode(acall) == errorCode) 
+             rx_SetCallAbortCode(acall, 0);
+         goto Bad_FetchStatus;
+      }
     }
 
     /* set OutStatus From the Fid  */
@@ -832,7 +890,7 @@ SAFSS_FetchStatus (tcon, Fid, OutStatus, CallBack, Sync)
        SetCallBackStruct(AddCallBack(client->host, Fid), CallBack);
     else {
       struct AFSFid myFid;             
-      bzero(&myFid, sizeof(struct AFSFid));
+      memset(&myFid, 0, sizeof(struct AFSFid));
       myFid.Volume = Fid->Volume;
       SetCallBackStruct(AddVolCallBack(client->host, &myFid), CallBack);
       }
@@ -846,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;
@@ -863,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,
@@ -900,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;
@@ -920,9 +978,12 @@ SRXAFS_BulkStatus(tcon, Fids, OutStats, CallBacks, Sync)
 
        /* Are we allowed to fetch Fid's status? */
        if (targetptr->disk.type != vDirectory) {
-         if (errorCode = Check_PermissionRights(targetptr, client, rights,
-                                              CHK_FETCHSTATUS, 0))
-               goto Bad_BulkStatus;
+           if (errorCode = Check_PermissionRights(targetptr, client, rights,
+                                                  CHK_FETCHSTATUS, 0)) {
+               if (rx_GetCallAbortCode(acall) == errorCode) 
+                   rx_SetCallAbortCode(acall, 0);
+               goto Bad_BulkStatus;
+           }
        }
 
        /* set OutStatus From the Fid  */
@@ -935,7 +996,7 @@ SRXAFS_BulkStatus(tcon, Fids, OutStats, CallBacks, Sync)
                              &CallBacks->AFSCBs_val[i]);
        else {
          struct AFSFid myFid;          
-         bzero(&myFid, sizeof(struct AFSFid));
+         memset(&myFid, 0, sizeof(struct AFSFid));
          myFid.Volume = tfid->Volume;
          SetCallBackStruct(AddVolCallBack(client->host, &myFid),
                              &CallBacks->AFSCBs_val[i]);
@@ -974,22 +1035,170 @@ 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_FetchStatus (tcon, Fid, OutStatus, CallBack, Sync)
+SRXAFS_InlineBulkStatus(acall, Fids, OutStats, CallBacks, Sync)
+    struct rx_call *acall;
+    struct AFSCBFids *Fids;
+    struct AFSBulkStats *OutStats;
+    struct AFSCBs *CallBacks;
     struct AFSVolSync *Sync;
-    struct rx_connection *tcon;                /* Rx connection handle */
+{
+    register int i;
+    afs_int32 nfiles;
+    Vnode * targetptr =        0;              /* pointer to vnode to fetch */
+    Vnode * parentwhentargetnotdir = 0;        /* parent vnode if targetptr is a file */
+    int            errorCode = 0;              /* return code to caller */
+    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 */
+    register struct AFSFid *tfid;      /* file id we're dealing with now */
+    struct rx_connection *tcon;
+    AFSFetchStatus *tstatus;
+#if FS_STATS_DETAILED
+    struct fs_stats_opTimingData *opP;      /* Ptr to this op's timing struct */
+    struct timeval opStartTime,
+                   opStopTime;             /* Start/stop times for RPC op*/
+    struct timeval elapsedTime;                    /* Transfer time */
+
+    /*
+     * Set our stats pointer, remember when the RPC operation started, and
+     * tally the operation.
+     */
+    opP = &(afs_FullPerfStats.det.rpcOpTimes[FS_STATS_RPCIDX_BULKSTATUS]);
+    FS_LOCK
+    (opP->numOps)++;
+    FS_UNLOCK
+    TM_GetTimeOfDay(&opStartTime, 0);
+#endif /* FS_STATS_DETAILED */
+
+    ViceLog(1, ("SAFS_InlineBulkStatus\n"));
+    FS_LOCK
+    AFSCallStats.TotalCalls++;
+    FS_UNLOCK
+
+    nfiles = Fids->AFSCBFids_len;      /* # of files in here */
+    if (nfiles <= 0) {                  /* Sanity check */
+       errorCode = EINVAL;
+       goto Audit_and_Return;
+    }
+
+    /* allocate space for return output parameters */
+    OutStats->AFSBulkStats_val = (struct AFSFetchStatus *)
+       malloc(nfiles * sizeof(struct AFSFetchStatus));
+    OutStats->AFSBulkStats_len = nfiles;
+    CallBacks->AFSCBs_val = (struct AFSCallBack *)
+       malloc(nfiles * sizeof(struct AFSCallBack));
+    CallBacks->AFSCBs_len = nfiles;
+
+    if (errorCode = CallPreamble(acall, ACTIVECALL, &tcon)) {
+       goto Bad_InlineBulkStatus;
+    }
+
+    tfid = Fids->AFSCBFids_val;
+    for (i=0; i<nfiles; i++, tfid++) {
+       /*
+        * Get volume/vnode for the fetched file; caller's rights to it
+        * are also returned
+        */
+       if (errorCode =
+           GetVolumePackage(tcon, tfid, &volptr, &targetptr,
+                            DONTCHECK, &parentwhentargetnotdir, &client,
+                            READ_LOCK, &rights, &anyrights)) {
+           tstatus = &OutStats->AFSBulkStats_val[i];
+           tstatus->errorCode = errorCode;
+           parentwhentargetnotdir = (Vnode *) 0;
+           targetptr = (Vnode *) 0;
+           volptr = (Volume *) 0;
+           continue;
+       }
+
+       /* set volume synchronization information, but only once per call */
+       if (i == nfiles)
+           SetVolumeSync(Sync, volptr);
+
+       /* Are we allowed to fetch Fid's status? */
+       if (targetptr->disk.type != vDirectory) {
+           if (errorCode = Check_PermissionRights(targetptr, client, rights,
+                                                  CHK_FETCHSTATUS, 0)) {
+               tstatus = &OutStats->AFSBulkStats_val[i];
+               tstatus->errorCode = errorCode;
+               PutVolumePackage(parentwhentargetnotdir, targetptr, (Vnode *) 0, volptr);
+               parentwhentargetnotdir = (Vnode *) 0;
+               targetptr = (Vnode *) 0;
+               volptr = (Volume *) 0;
+               continue;
+           }
+       }
+
+       /* set OutStatus From the Fid  */
+       GetStatus(targetptr, (struct AFSFetchStatus *) &OutStats->AFSBulkStats_val[i], 
+         rights, anyrights, parentwhentargetnotdir);
+
+       /* If a r/w volume, also set the CallBack state */
+       if (VolumeWriteable(volptr))
+           SetCallBackStruct(AddBulkCallBack(client->host, tfid),
+                             &CallBacks->AFSCBs_val[i]);
+       else {
+         struct AFSFid myFid;          
+         memset(&myFid, 0, sizeof(struct AFSFid));
+         myFid.Volume = tfid->Volume;
+         SetCallBackStruct(AddVolCallBack(client->host, &myFid),
+                             &CallBacks->AFSCBs_val[i]);
+       }
+
+       /* put back the file ID and volume */
+       PutVolumePackage(parentwhentargetnotdir, targetptr, (Vnode *) 0, volptr);
+       parentwhentargetnotdir = (Vnode *) 0;
+       targetptr = (Vnode *) 0;
+       volptr = (Volume *) 0;
+    }
+
+Bad_InlineBulkStatus: 
+    /* Update and store volume/vnode and parent vnodes back */
+    PutVolumePackage(parentwhentargetnotdir, targetptr, (Vnode *)0, volptr);
+    CallPostamble(tcon);
+
+#if FS_STATS_DETAILED
+    TM_GetTimeOfDay(&opStopTime, 0);
+    if (errorCode == 0) {
+       FS_LOCK
+        (opP->numSuccesses)++;
+        fs_stats_GetDiff(elapsedTime, opStartTime, opStopTime);
+        fs_stats_AddTo((opP->sumTime), elapsedTime);
+        fs_stats_SquareAddTo((opP->sqrTime), elapsedTime);
+        if (fs_stats_TimeLessThan(elapsedTime, (opP->minTime))) {
+           fs_stats_TimeAssign((opP->minTime), elapsedTime);
+        }
+        if (fs_stats_TimeGreaterThan(elapsedTime, (opP->maxTime))) {
+           fs_stats_TimeAssign((opP->maxTime), elapsedTime);
+        }
+       FS_UNLOCK
+    }  
+
+#endif /* FS_STATS_DETAILED */
+
+Audit_and_Return:
+    ViceLog(2, ("SAFS_InlineBulkStatus returns %d\n", errorCode)); 
+    osi_auditU (acall, InlineBulkFetchStatusEvent, errorCode, AUD_FIDS, Fids, AUD_END);
+    return 0;
+
+} /*SRXAFS_InlineBulkStatus*/
+
+
+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,
@@ -1007,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 (tcon, Fid, OutStatus, CallBack, Sync);
+    code = SAFSS_FetchStatus (acall, Fid, OutStatus, CallBack, Sync);
 
 Bad_FetchStatus:    
     CallPostamble(tcon);
@@ -1034,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_int32 Pos;                             /* Not implemented yet */
-    afs_int32 Length;                  /* Length of data to store */
-    afs_int32 FileLength;                      /* Length of file after store */
+    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 */
@@ -1058,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 */
@@ -1092,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 */
@@ -1151,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;
@@ -1269,19 +1476,51 @@ 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_StoreACL (tcon, Fid, AccessList, OutStatus, Sync)
+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;
-    struct rx_connection *tcon;                /* Rx connection handle */
+{
+    int code;
+    afs_int32 tPos;
+    afs_int32 tLength;
+    afs_int32 tFileLength;
+
+#ifdef AFS_64BIT_ENV
+    if (FileLength > 0x7fffffff)
+        return E2BIG;
+    tPos = Pos;
+    tLength = Length;
+    tFileLength = FileLength;
+#else /* AFS_64BIT_ENV */
+    if (FileLength.high)
+        return E2BIG;
+    tPos = Pos.low;
+    tLength = Length.low;
+    tFileLength = FileLength.low;
+#endif /* AFS_64BIT_ENV */
+
+    code = SRXAFS_StoreData (acall, Fid, InStatus, tPos, tLength, tFileLength,
+                             OutStatus, Sync);
+    return code;
+}
+
+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 */
@@ -1290,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
@@ -1309,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 */
@@ -1358,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 */
@@ -1384,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*/
@@ -1394,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 */
@@ -1410,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); 
@@ -1471,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,
@@ -1498,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);
@@ -1525,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*/
@@ -1535,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 */
@@ -1554,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); 
@@ -1597,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) {
@@ -1629,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,
@@ -1656,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);
@@ -1683,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*/
@@ -1693,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 */
@@ -1716,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); 
@@ -1769,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);
@@ -1790,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 */
@@ -1800,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,
@@ -1821,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:    
@@ -1848,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*/
@@ -1858,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 */
@@ -1894,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); 
@@ -2133,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))
@@ -2200,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 */
     }
@@ -2250,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,
@@ -2280,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:    
@@ -2308,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*/
@@ -2318,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 */
@@ -2342,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); 
@@ -2376,15 +2616,15 @@ SAFSS_Symlink (tcon, DirFid, Name, LinkContents, InStatus, OutFid, OutFidStatus,
     }
 
     /*
-     * If we're creating a mount point (owner mode bits sans x bit), we must
-     * have administer access to the directory, too.  Always allow sysadmins
+     * If we're creating a mount point (any x bits clear), we must have
+     * administer access to the directory, too.  Always allow sysadmins
      * to do this.
      */
-    if ((InStatus->Mask & AFS_SETMODE) && !(InStatus->UnixModeBits & 0100)) {
+    if ((InStatus->Mask & AFS_SETMODE) && !(InStatus->UnixModeBits & 0111)) {
        /*
-        * We have a symlink, 'cause we're trying to set the Unix mode bits
-        * to something without the owner x bits (default mode bits if
-        * AFS_SETMODE is false is 0777)
+        * We have a mountpoint, 'cause we're trying to set the Unix mode
+        * bits to something with some x bits missing (default mode bits
+        * if AFS_SETMODE is false is 0777)
         */
        if (VanillaUser(client) && !(rights & PRSFS_ADMINISTER)) {
            errorCode = EACCES;
@@ -2422,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);
@@ -2440,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 */
@@ -2453,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,
@@ -2471,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:    
@@ -2499,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*/
@@ -2509,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 */
@@ -2529,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); 
@@ -2615,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);
@@ -2640,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,
@@ -2669,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:
@@ -2697,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*/
@@ -2707,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 */
@@ -2733,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); 
@@ -2798,7 +3039,7 @@ SAFSS_MakeDir (tcon, DirFid, Name, InStatus, OutFid, OutFidStatus,
     assert((SetAccessList(&targetptr, &volptr, &newACL, &newACLSize,
                          &parentwhentargetnotdir, (AFSFid *)0, 0)) == 0);
     assert(parentwhentargetnotdir == 0);
-    bcopy((char *)VVnodeACL(parentptr), (char *)newACL, VAclSize(parentptr));
+    memcpy((char *)newACL, (char *)VVnodeACL(parentptr), VAclSize(parentptr));
 
     /* update the status for the target vnode */
     Update_TargetVnodeStatus(targetptr, TVS_MKDIR, client, InStatus,
@@ -2833,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 */
@@ -2843,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,
@@ -2863,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,
@@ -2891,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*/
@@ -2901,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 */
@@ -2921,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); 
@@ -2992,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,
@@ -3019,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);
@@ -3046,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*/
@@ -3056,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;
@@ -3072,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;
@@ -3116,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,
@@ -3154,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);
@@ -3180,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*/
@@ -3190,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;
 
@@ -3204,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); 
@@ -3243,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,
@@ -3279,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);
@@ -3306,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*/
@@ -3316,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;
 
@@ -3330,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); 
@@ -3378,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,
@@ -3414,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);
@@ -3441,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*/
@@ -3451,15 +3688,15 @@ 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"));
     FS_LOCK
     AFSCallStats.GetStatistics++, AFSCallStats.TotalCalls++;
     FS_UNLOCK
-    bzero(Statistics, sizeof(*Statistics));
+    memset(Statistics, 0, sizeof(*Statistics));
     SetAFSStats(Statistics);
     SetVolumeStats(Statistics);
     SetSystemStats(Statistics);
@@ -3469,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,
@@ -3492,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);
@@ -3838,7 +4076,7 @@ int SRXAFS_GetXStats(a_call, a_clientVersionNum, a_collectionNumber, a_srvVersio
         */
        dataBytes = sizeof(struct afs_Stats);
        dataBuffP = (afs_int32 *)malloc(dataBytes);
-       bcopy(&afs_cmstats, dataBuffP, dataBytes);
+       memcpy(dataBuffP, &afs_cmstats, dataBytes);
        a_dataP->AFS_CollData_len = dataBytes>>2;
        a_dataP->AFS_CollData_val = dataBuffP;
 #else
@@ -3865,7 +4103,7 @@ int SRXAFS_GetXStats(a_call, a_clientVersionNum, a_collectionNumber, a_srvVersio
 
        dataBytes = sizeof(struct afs_PerfStats);
        dataBuffP = (afs_int32 *)osi_Alloc(dataBytes);
-       bcopy(&afs_perfstats, dataBuffP, dataBytes);
+       memcpy(dataBuffP, &afs_perfstats, dataBytes);
        a_dataP->AFS_CollData_len = dataBytes>>2;
        a_dataP->AFS_CollData_val = dataBuffP;
        break;
@@ -3892,7 +4130,7 @@ int SRXAFS_GetXStats(a_call, a_clientVersionNum, a_collectionNumber, a_srvVersio
 
        dataBytes = sizeof(struct fs_stats_FullPerfStats);
        dataBuffP = (afs_int32 *)osi_Alloc(dataBytes);
-       bcopy(&afs_FullPerfStats, dataBuffP, dataBytes);
+       memcpy(dataBuffP, &afs_FullPerfStats, dataBytes);
        a_dataP->AFS_CollData_len = dataBytes>>2;
        a_dataP->AFS_CollData_val = dataBuffP;
 #endif
@@ -3931,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 */
 
@@ -3940,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,
@@ -3961,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) {
@@ -4006,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 */
 
@@ -4037,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;
@@ -4048,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
@@ -4096,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 */
 
@@ -4235,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,
@@ -4258,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);
@@ -4291,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 */
@@ -4307,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,
@@ -4325,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
@@ -4381,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 */
@@ -4397,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,
@@ -4416,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
@@ -4466,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*/
@@ -4474,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 */
 
 {
@@ -4483,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,
@@ -4503,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++;
@@ -4559,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,
@@ -4583,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;
@@ -4615,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 */
 
@@ -4637,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,
@@ -4660,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);
@@ -4801,15 +5045,16 @@ PutVolumePackage(parentwhentargetnotdir, targetptr, parentptr, volptr)
  #                       the File Server.
  */
 
-FetchData_RXStyle(volptr, targetptr, Call, Pos, Len, a_bytesToFetchP, a_bytesFetchedP)
+FetchData_RXStyle(volptr, targetptr, Call, Pos, Len, Int64Mode, a_bytesToFetchP, a_bytesFetchedP)
 #else
-FetchData_RXStyle(volptr, targetptr, Call, Pos, Len)
+FetchData_RXStyle(volptr, targetptr, Call, Pos, Len, Int64Mode)
 #endif /* FS_STATS_DETAILED */
 Volume                 * volptr;
 Vnode                  * targetptr;
 register struct rx_call                * Call;
 afs_int32                      Pos;
 afs_int32                      Len;
+afs_int32                      Int64Mode;
 #if FS_STATS_DETAILED
 afs_int32 *a_bytesToFetchP;
 afs_int32 *a_bytesFetchedP;
@@ -4847,6 +5092,8 @@ afs_int32 *a_bytesFetchedP;
         * back to make the cache manager happy...
         */
        tlen = htonl(0);
+        if (Int64Mode)
+            rx_Write(Call, &tlen, sizeof(afs_int32));   /* send 0-length  */
        rx_Write(Call, &tlen, sizeof(afs_int32));       /* send 0-length  */
        return (0);
     }
@@ -4864,6 +5111,10 @@ afs_int32 *a_bytesFetchedP;
     if (Pos + Len > tlen) Len =        tlen - Pos;     /* get length we should send */
     FDH_SEEK(fdP, Pos, 0);
     tlen = htonl(Len);
+    if (Int64Mode) {
+        afs_int32 zero = 0;
+        rx_Write(Call, &zero, sizeof(afs_int32)); /* High order bits */
+    }
     rx_Write(Call, &tlen, sizeof(afs_int32));  /* send length on fetch */
 #if FS_STATS_DETAILED
     (*a_bytesToFetchP) = Len;
@@ -5000,9 +5251,9 @@ StoreData_RXStyle(volptr, targetptr, Fid, client, Call, Pos, Length,
     struct AFSFid *Fid;
     struct client *client;
     register struct rx_call *Call;
-    afs_int32 Pos;
-    afs_int32 Length;
-    afs_int32 FileLength;
+    afs_uint32 Pos;
+    afs_uint32 Length;
+    afs_uint32 FileLength;
     int sync;
 #if FS_STATS_DETAILED
     afs_int32 *a_bytesToStoreP;
@@ -5453,7 +5704,7 @@ RXStore_AccessList(targetptr, AccessList)
        return(EINVAL);
     if ((newACL->size + 4) > VAclSize(targetptr))
        return(E2BIG);
-    bcopy((char *) newACL,(char *) VVnodeACL(targetptr),(int)(newACL->size));
+    memcpy((char *) VVnodeACL(targetptr), (char *) newACL, (int)(newACL->size));
     acl_FreeACL(&newACL);
     return(0);
 
@@ -5500,7 +5751,7 @@ Store_AccessList(targetptr, AccessList)
        return(EINVAL);
     if ((newACL->size + 4) > VAclSize(targetptr))
        return(E2BIG);
-    bcopy((char *) newACL,(char *) VVnodeACL(targetptr),(int)(newACL->size));
+    memcpy((char *) VVnodeACL(targetptr), (char *) newACL, (int)(newACL->size));
     acl_FreeACL(&newACL);
     return(0);
 
@@ -6209,8 +6460,9 @@ void GetStatus(targetptr, status, rights, anyrights, parentptr)
 {
     /* initialize return status from a vnode  */
     status->InterfaceVersion = 1;
-    status->SyncCounter = status->dataVersionHigh = status->spare2 =
-    status->spare3 = status->spare4 = 0;
+    status->SyncCounter = status->dataVersionHigh = status->lockCount =
+    status->errorCode = 0;
+    status->ResidencyMask = 1; /* means for MR-AFS: file in /vicepr-partition */
     if (targetptr->disk.type == vFile)
        status->FileType = File;
     else if (targetptr->disk.type == vDirectory)
@@ -6220,6 +6472,7 @@ void GetStatus(targetptr, status, rights, anyrights, parentptr)
     else
        status->FileType = Invalid;                     /*invalid type field */
     status->LinkCount = targetptr->disk.linkCount;
+    status->Length_hi = 0;
     status->Length = targetptr->disk.length;
     status->DataVersion = targetptr->disk.dataVersion;
     status->Author = targetptr->disk.author;
@@ -6230,10 +6483,10 @@ void GetStatus(targetptr, status, rights, anyrights, parentptr)
     status->ClientModTime = targetptr->disk.unixModifyTime;    /* This might need rework */
     status->ParentVnode = (status->FileType == Directory ? targetptr->vnodeNumber : parentptr->vnodeNumber);
     status->ParentUnique = (status->FileType == Directory ? targetptr->disk.uniquifier : parentptr->disk.uniquifier);
-    status->SegSize = 0;
     status->ServerModTime = targetptr->disk.serverModifyTime;                  
     status->Group = targetptr->disk.group;
-    status->spare2 = targetptr->disk.lock.lockCount;
+    status->lockCount = targetptr->disk.lock.lockCount;
+    status->errorCode = 0;
 
 } /*GetStatus*/
 
@@ -6399,17 +6652,19 @@ int CopyOnWrite(targetptr, volptr)
                        rc = IH_DEC(V_linkHandle(volptr), ino,
                                  V_parentId(volptr));
                        if (!rc ) {
-                           ViceLog(0,("CopyOnWrite failed: volume %u in partition %s needs salvage\n",
-                                   V_id(volptr), volptr->partition->name));
+                           ViceLog(0,("CopyOnWrite failed: error %u after i_dec on disk full, volume %u in partition %s needs salvage\n",
+                                      rc, V_id(volptr), 
+                                      volptr->partition->name));
                            VTakeOffline (volptr);
                        }
                        free(buff);
                        return ENOSPC;
                }
                else {
-                   ViceLog(0,("CopyOnWrite failed: volume %u in partition %s needs salvage\n",
-                           V_id(volptr), volptr->partition->name));
-                   /* Decrement this inode so salvager doesn't find it. */
+                   ViceLog(0,("CopyOnWrite failed: volume %u in partition %s  (tried reading %u, read %u, wrote %u, errno %u) volume needs salvage\n",
+                              V_id(volptr), volptr->partition->name, length,
+                              rdlen, wrlen, errno));
+                    /* Decrement this inode so salvager doesn't find it. */
                    FDH_REALLYCLOSE(newFdP);
                    IH_RELEASE(newH);
                    FDH_REALLYCLOSE(targFdP);
@@ -6712,7 +6967,7 @@ void SetVolumeStats(stats)
     for (part = DiskPartitionList; part && i < AFS_MSTATDISKS; part = part->next) {
        stats->Disks[i].TotalBlocks = part->totalUsable;
        stats->Disks[i].BlocksAvailable = part->free;
-       bzero(stats->Disks[i].Name, AFS_DISKNAMESIZE);
+       memset(stats->Disks[i].Name, 0, AFS_DISKNAMESIZE);
        strncpy(stats->Disks[i].Name, part->name, AFS_DISKNAMESIZE);
        i++;
     }
@@ -6892,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 */
@@ -6907,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;