*/
static int
CallPreamble(register struct rx_call *acall, int activecall,
- struct rx_connection **tconn)
+ struct rx_connection **tconn, struct host **ahostp)
{
struct host *thost;
struct client *tclient;
h_ReleaseClient_r(tclient);
h_Unlock_r(thost);
H_UNLOCK;
+ *ahostp = thost;
return code;
} /*CallPreamble */
static afs_int32
-CallPostamble(register struct rx_connection *aconn, afs_int32 ret)
+CallPostamble(register struct rx_connection *aconn, afs_int32 ret,
+ struct host *ahost)
{
struct host *thost;
struct client *tclient;
int translate = 0;
+ int held;
H_LOCK;
tclient = h_FindClient_r(aconn);
if (thost->hostFlags & HERRORTRANS)
translate = 1;
h_ReleaseClient_r(tclient);
- h_Release_r(thost);
+ held = h_Held_r(thost);
+ if (held)
+ h_Release_r(thost);
+ if (ahost != thost) {
+ char hoststr[16], hoststr2[16];
+ ViceLog(0, ("CallPostamble: ahost %s:%d (%x) != thost %s:%d (%x)\n",
+ afs_inet_ntoa_r(thost->host, hoststr), ntohs(thost->port),
+ ahost,
+ afs_inet_ntoa_r(thost->host, hoststr2), ntohs(thost->port),
+ thost));
+ h_Release_r(ahost);
+ }
H_UNLOCK;
return (translate ? sys_error_to_et(ret) : ret);
} /*CallPostamble */
switch (LockingType) {
case LockRead:
case LockWrite:
+ case LockUpgrade:
+ case LockDowngrade:
if (Time > targetptr->disk.lock.lockTime)
targetptr->disk.lock.lockTime = targetptr->disk.lock.lockCount =
0;
targetptr->disk.lock.lockTime = Time;
} else
return (EAGAIN);
- } else {
+ } else if (LockingType == LockWrite) {
if (targetptr->disk.lock.lockCount == 0) {
targetptr->disk.lock.lockCount = -1;
targetptr->disk.lock.lockTime = Time;
} else
return (EAGAIN);
+ } else if (LockingType == LockUpgrade) {
+ if (targetptr->disk.lock.lockCount == 1) {
+ targetptr->disk.lock.lockCount = -1;
+ targetptr->disk.lock.lockTime = Time;
+ } else
+ return (EAGAIN);
+ } else if (LockingType == LockDowngrade) {
+ if (targetptr->disk.lock.lockCount == -1) {
+ targetptr->disk.lock.lockCount = 1;
+ targetptr->disk.lock.lockTime = Time;
+ } else
+ return (EAGAIN);
}
break;
case LockExtend:
Volume *volptr = 0; /* pointer to the volume */
struct client *client = 0; /* pointer to the client data */
struct rx_connection *tcon; /* the connection we're part of */
+ struct host *thost;
afs_int32 rights, anyrights; /* rights for this and any user */
struct client *t_client = NULL; /* tmp ptr to client data */
struct in_addr logHostAddr; /* host ip holder for inet_ntoa */
FS_LOCK;
AFSCallStats.FetchData++, AFSCallStats.TotalCalls++;
FS_UNLOCK;
- if ((errorCode = CallPreamble(acall, ACTIVECALL, &tcon)))
+ if ((errorCode = CallPreamble(acall, ACTIVECALL, &tcon, &thost)))
goto Bad_FetchData;
/* Get ptr to client data for user Id for logging */
(void)PutVolumePackage(parentwhentargetnotdir, targetptr, (Vnode *) 0,
volptr, &client);
ViceLog(2, ("SRXAFS_FetchData returns %d\n", errorCode));
- errorCode = CallPostamble(tcon, errorCode);
+ errorCode = CallPostamble(tcon, errorCode, thost);
#if FS_STATS_DETAILED
TM_GetTimeOfDay(&opStopTime, 0);
struct client *client = 0; /* pointer to the client data */
afs_int32 rights, anyrights; /* rights for this and any user */
struct rx_connection *tcon = rx_ConnectionOf(acall);
+ struct host *thost;
struct client *t_client = NULL; /* tmp ptr to client data */
struct in_addr logHostAddr; /* host ip holder for inet_ntoa */
#if FS_STATS_DETAILED
FS_LOCK;
AFSCallStats.FetchACL++, AFSCallStats.TotalCalls++;
FS_UNLOCK;
- if ((errorCode = CallPreamble(acall, ACTIVECALL, &tcon)))
+ if ((errorCode = CallPreamble(acall, ACTIVECALL, &tcon, &thost)))
goto Bad_FetchACL;
/* Get ptr to client data for user Id for logging */
ViceLog(2,
("SAFS_FetchACL returns %d (ACL=%s)\n", errorCode,
AccessList->AFSOpaque_val));
- errorCode = CallPostamble(tcon, errorCode);
+ errorCode = CallPostamble(tcon, errorCode, thost);
#if FS_STATS_DETAILED
TM_GetTimeOfDay(&opStopTime, 0);
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 = rx_ConnectionOf(acall);
+ struct host *thost;
struct client *t_client = NULL; /* tmp pointer to the client data */
#if FS_STATS_DETAILED
struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */
}
CallBacks->AFSCBs_len = nfiles;
- if ((errorCode = CallPreamble(acall, ACTIVECALL, &tcon)))
+ if ((errorCode = CallPreamble(acall, ACTIVECALL, &tcon, &thost)))
goto Bad_BulkStatus;
tfid = Fids->AFSCBFids_val;
/* Update and store volume/vnode and parent vnodes back */
(void)PutVolumePackage(parentwhentargetnotdir, targetptr, (Vnode *) 0,
volptr, &client);
- errorCode = CallPostamble(tcon, errorCode);
+ errorCode = CallPostamble(tcon, errorCode, thost);
t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
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;
+ struct host *thost;
struct client *t_client = NULL; /* tmp ptr to client data */
AFSFetchStatus *tstatus;
#if FS_STATS_DETAILED
}
CallBacks->AFSCBs_len = nfiles;
- if ((errorCode = CallPreamble(acall, ACTIVECALL, &tcon))) {
+ if ((errorCode = CallPreamble(acall, ACTIVECALL, &tcon, &thost))) {
goto Bad_InlineBulkStatus;
}
/* Update and store volume/vnode and parent vnodes back */
(void)PutVolumePackage(parentwhentargetnotdir, targetptr, (Vnode *) 0,
volptr, &client);
- errorCode = CallPostamble(tcon, errorCode);
+ errorCode = CallPostamble(tcon, errorCode, thost);
t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
{
afs_int32 code;
struct rx_connection *tcon;
+ struct host *thost;
struct client *t_client = NULL; /* tmp ptr to client data */
#if FS_STATS_DETAILED
struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */
TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
- if ((code = CallPreamble(acall, ACTIVECALL, &tcon)))
+ if ((code = CallPreamble(acall, ACTIVECALL, &tcon, &thost)))
goto Bad_FetchStatus;
code = SAFSS_FetchStatus(acall, Fid, OutStatus, CallBack, Sync);
Bad_FetchStatus:
- code = CallPostamble(tcon, code);
+ code = CallPostamble(tcon, code, thost);
t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
struct client *t_client = NULL; /* tmp ptr to client data */
struct in_addr logHostAddr; /* host ip holder for inet_ntoa */
struct rx_connection *tcon;
+ struct host *thost;
#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 */
FS_LOCK;
AFSCallStats.StoreData++, AFSCallStats.TotalCalls++;
FS_UNLOCK;
- if ((errorCode = CallPreamble(acall, ACTIVECALL, &tcon)))
+ if ((errorCode = CallPreamble(acall, ACTIVECALL, &tcon, &thost)))
goto Bad_StoreData;
/* Get ptr to client data for user Id for logging */
volptr, &client);
ViceLog(2, ("SAFS_StoreData returns %d\n", errorCode));
- errorCode = CallPostamble(tcon, errorCode);
+ errorCode = CallPostamble(tcon, errorCode, thost);
#if FS_STATS_DETAILED
TM_GetTimeOfDay(&opStopTime, 0);
struct client *client = 0; /* pointer to client structure */
afs_int32 rights, anyrights; /* rights for this and any user */
struct rx_connection *tcon;
+ struct host *thost;
struct client *t_client = NULL; /* tmp ptr to client data */
struct in_addr logHostAddr; /* host ip holder for inet_ntoa */
#if FS_STATS_DETAILED
FS_UNLOCK;
TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
- if ((errorCode = CallPreamble(acall, ACTIVECALL, &tcon)))
+ if ((errorCode = CallPreamble(acall, ACTIVECALL, &tcon, &thost)))
goto Bad_StoreACL;
/* Get ptr to client data for user Id for logging */
PutVolumePackage(parentwhentargetnotdir, targetptr, (Vnode *) 0,
volptr, &client);
ViceLog(2, ("SAFS_StoreACL returns %d\n", errorCode));
- errorCode = CallPostamble(tcon, errorCode);
+ errorCode = CallPostamble(tcon, errorCode, thost);
#if FS_STATS_DETAILED
TM_GetTimeOfDay(&opStopTime, 0);
{
afs_int32 code;
struct rx_connection *tcon;
+ struct host *thost;
struct client *t_client = NULL; /* tmp ptr to client data */
#if FS_STATS_DETAILED
struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */
TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
- if ((code = CallPreamble(acall, ACTIVECALL, &tcon)))
+ if ((code = CallPreamble(acall, ACTIVECALL, &tcon, &thost)))
goto Bad_StoreStatus;
code = SAFSS_StoreStatus(acall, Fid, InStatus, OutStatus, Sync);
Bad_StoreStatus:
- code = CallPostamble(tcon, code);
+ code = CallPostamble(tcon, code, thost);
t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
{
afs_int32 code;
struct rx_connection *tcon;
+ struct host *thost;
struct client *t_client = NULL; /* tmp ptr to client data */
#if FS_STATS_DETAILED
struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */
TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
- if ((code = CallPreamble(acall, ACTIVECALL, &tcon)))
+ if ((code = CallPreamble(acall, ACTIVECALL, &tcon, &thost)))
goto Bad_RemoveFile;
code = SAFSS_RemoveFile(acall, DirFid, Name, OutDirStatus, Sync);
Bad_RemoveFile:
- code = CallPostamble(tcon, code);
+ code = CallPostamble(tcon, code, thost);
t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
{
afs_int32 code;
struct rx_connection *tcon;
+ struct host *thost;
struct client *t_client = NULL; /* tmp ptr to client data */
#if FS_STATS_DETAILED
struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */
memset(OutFid, 0, sizeof(struct AFSFid));
- if ((code = CallPreamble(acall, ACTIVECALL, &tcon)))
+ if ((code = CallPreamble(acall, ACTIVECALL, &tcon, &thost)))
goto Bad_CreateFile;
code =
OutDirStatus, CallBack, Sync);
Bad_CreateFile:
- code = CallPostamble(tcon, code);
+ code = CallPostamble(tcon, code, thost);
t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
{
afs_int32 code;
struct rx_connection *tcon;
+ struct host *thost;
struct client *t_client = NULL; /* tmp ptr to client data */
#if FS_STATS_DETAILED
struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */
TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
- if ((code = CallPreamble(acall, ACTIVECALL, &tcon)))
+ if ((code = CallPreamble(acall, ACTIVECALL, &tcon, &thost)))
goto Bad_Rename;
code =
OutOldDirStatus, OutNewDirStatus, Sync);
Bad_Rename:
- code = CallPostamble(tcon, code);
+ code = CallPostamble(tcon, code, thost);
t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
{
afs_int32 code;
struct rx_connection *tcon;
+ struct host *thost;
struct client *t_client = NULL; /* tmp ptr to client data */
#if FS_STATS_DETAILED
struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */
TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
- if ((code = CallPreamble(acall, ACTIVECALL, &tcon)))
+ if ((code = CallPreamble(acall, ACTIVECALL, &tcon, &thost)))
goto Bad_Symlink;
code =
OutFidStatus, OutDirStatus, Sync);
Bad_Symlink:
- code = CallPostamble(tcon, code);
+ code = CallPostamble(tcon, code, thost);
t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
{
afs_int32 code;
struct rx_connection *tcon;
+ struct host *thost;
struct client *t_client = NULL; /* tmp ptr to client data */
#if FS_STATS_DETAILED
struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */
TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
- if ((code = CallPreamble(acall, ACTIVECALL, &tcon)))
+ if ((code = CallPreamble(acall, ACTIVECALL, &tcon, &thost)))
goto Bad_Link;
code =
OutDirStatus, Sync);
Bad_Link:
- code = CallPostamble(tcon, code);
+ code = CallPostamble(tcon, code, thost);
t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
{
afs_int32 code;
struct rx_connection *tcon;
+ struct host *thost;
struct client *t_client = NULL; /* tmp ptr to client data */
#if FS_STATS_DETAILED
struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */
FS_UNLOCK;
TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
- if ((code = CallPreamble(acall, ACTIVECALL, &tcon)))
+ if ((code = CallPreamble(acall, ACTIVECALL, &tcon, &thost)))
goto Bad_MakeDir;
code =
OutDirStatus, CallBack, Sync);
Bad_MakeDir:
- code = CallPostamble(tcon, code);
+ code = CallPostamble(tcon, code, thost);
t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
{
afs_int32 code;
struct rx_connection *tcon;
+ struct host *thost;
struct client *t_client = NULL; /* tmp ptr to client data */
#if FS_STATS_DETAILED
struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */
TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
- if ((code = CallPreamble(acall, ACTIVECALL, &tcon)))
+ if ((code = CallPreamble(acall, ACTIVECALL, &tcon, &thost)))
goto Bad_RemoveDir;
code = SAFSS_RemoveDir(acall, DirFid, Name, OutDirStatus, Sync);
Bad_RemoveDir:
- code = CallPostamble(tcon, code);
+ code = CallPostamble(tcon, code, thost);
t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
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 */
- static char *locktype[2] = { "LockRead", "LockWrite" };
+ static char *locktype[5] = { "LockRead", "LockWrite", "LockExtend", "LockUpgrade", "LockDowngrade" };
struct rx_connection *tcon = rx_ConnectionOf(acall);
- if (type != LockRead && type != LockWrite) {
+ if (type != LockRead && type != LockWrite &&
+ type != LockUpgrade && type != LockDowngrade) {
errorCode = EINVAL;
goto Bad_SetLock;
}
{
afs_int32 code;
struct rx_connection *tcon;
+ struct host *thost;
struct client *t_client = NULL; /* tmp ptr to client data */
#if FS_STATS_DETAILED
struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */
TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
- if ((code = CallPreamble(acall, ACTIVECALL, &tcon)))
+ if ((code = CallPreamble(acall, ACTIVECALL, &tcon, &thost)))
goto Bad_SetLock;
code = SAFSS_SetLock(acall, Fid, type, Sync);
Bad_SetLock:
- code = CallPostamble(tcon, code);
+ code = CallPostamble(tcon, code, thost);
t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
{
afs_int32 code;
struct rx_connection *tcon;
+ struct host *thost;
struct client *t_client = NULL; /* tmp ptr to client data */
#if FS_STATS_DETAILED
struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */
TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
- if ((code = CallPreamble(acall, ACTIVECALL, &tcon)))
+ if ((code = CallPreamble(acall, ACTIVECALL, &tcon, &thost)))
goto Bad_ExtendLock;
code = SAFSS_ExtendLock(acall, Fid, Sync);
Bad_ExtendLock:
- code = CallPostamble(tcon, code);
+ code = CallPostamble(tcon, code, thost);
t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
{
afs_int32 code;
struct rx_connection *tcon;
+ struct host *thost;
struct client *t_client = NULL; /* tmp ptr to client data */
#if FS_STATS_DETAILED
struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */
TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
- if ((code = CallPreamble(acall, ACTIVECALL, &tcon)))
+ if ((code = CallPreamble(acall, ACTIVECALL, &tcon, &thost)))
goto Bad_ReleaseLock;
code = SAFSS_ReleaseLock(acall, Fid, Sync);
Bad_ReleaseLock:
- code = CallPostamble(tcon, code);
+ code = CallPostamble(tcon, code, thost);
t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
{
afs_int32 code;
struct rx_connection *tcon = rx_ConnectionOf(acall);
+ struct host *thost;
struct client *t_client = NULL; /* tmp ptr to client data */
#if FS_STATS_DETAILED
struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */
TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
- if ((code = CallPreamble(acall, NOTACTIVECALL, &tcon)))
+ if ((code = CallPreamble(acall, NOTACTIVECALL, &tcon, &thost)))
goto Bad_GetStatistics;
ViceLog(1, ("SAFS_GetStatistics Received\n"));
SetSystemStats((struct AFSStatistics *)Statistics);
Bad_GetStatistics:
- code = CallPostamble(tcon, code);
+ code = CallPostamble(tcon, code, thost);
t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
register int i;
struct client *client = 0;
struct rx_connection *tcon;
+ struct host *thost;
#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 */
FS_LOCK;
AFSCallStats.GiveUpCallBacks++, AFSCallStats.TotalCalls++;
FS_UNLOCK;
- if ((errorCode = CallPreamble(acall, ACTIVECALL, &tcon)))
+ if ((errorCode = CallPreamble(acall, ACTIVECALL, &tcon, &thost)))
goto Bad_GiveUpCallBacks;
if (!FidArray && !CallBackArray) {
}
Bad_GiveUpCallBacks:
- errorCode = CallPostamble(tcon, errorCode);
+ errorCode = CallPostamble(tcon, errorCode, thost);
#if FS_STATS_DETAILED
TM_GetTimeOfDay(&opStopTime, 0);
{
afs_int32 code;
struct rx_connection *tcon;
+ struct host *thost;
afs_int32 *dataBuffP;
afs_int32 dataBytes;
#if FS_STATS_DETAILED
TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
- if ((code = CallPreamble(acall, NOTACTIVECALL, &tcon)))
+ if ((code = CallPreamble(acall, NOTACTIVECALL, &tcon, &thost)))
goto Bad_GetCaps;
FS_LOCK;
ViceLog(2, ("SAFS_GetCapabilties\n"));
Bad_GetCaps:
- code = CallPostamble(tcon, code);
+ code = CallPostamble(tcon, code, thost);
#if FS_STATS_DETAILED
TM_GetTimeOfDay(&opStopTime, 0);
{
afs_int32 code;
struct rx_connection *tcon;
+ struct host *thost;
#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 */
FS_UNLOCK;
TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
- if ((code = CallPreamble(acall, ACTIVECALL, &tcon)))
+ if ((code = CallPreamble(acall, ACTIVECALL, &tcon, &thost)))
goto Bad_GetVolumeInfo;
FS_LOCK;
avolinfo->Type4 = 0xabcd9999; /* tell us to try new vldb */
Bad_GetVolumeInfo:
- code = CallPostamble(tcon, code);
+ code = CallPostamble(tcon, code, thost);
#if FS_STATS_DETAILED
TM_GetTimeOfDay(&opStopTime, 0);
afs_int32 rights, anyrights; /* rights for this and any user */
AFSFid dummyFid;
struct rx_connection *tcon;
+ struct host *thost;
struct client *t_client = NULL; /* tmp ptr to client data */
#if FS_STATS_DETAILED
struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */
#endif /* FS_STATS_DETAILED */
ViceLog(1, ("SAFS_GetVolumeStatus for volume %u\n", avolid));
- if ((errorCode = CallPreamble(acall, ACTIVECALL, &tcon)))
+ if ((errorCode = CallPreamble(acall, ACTIVECALL, &tcon, &thost)))
goto Bad_GetVolumeStatus;
FS_LOCK;
*OfflineMsg = (char *)malloc(1);
**OfflineMsg = 0;
}
- errorCode = CallPostamble(tcon, errorCode);
+ errorCode = CallPostamble(tcon, errorCode, thost);
t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
afs_int32 rights, anyrights; /* rights for this and any user */
AFSFid dummyFid;
struct rx_connection *tcon = rx_ConnectionOf(acall);
+ struct host *thost;
struct client *t_client = NULL; /* tmp ptr to client data */
#if FS_STATS_DETAILED
struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */
#endif /* FS_STATS_DETAILED */
ViceLog(1, ("SAFS_SetVolumeStatus for volume %u\n", avolid));
- if ((errorCode = CallPreamble(acall, ACTIVECALL, &tcon)))
+ if ((errorCode = CallPreamble(acall, ACTIVECALL, &tcon, &thost)))
goto Bad_SetVolumeStatus;
FS_LOCK;
PutVolumePackage(parentwhentargetnotdir, targetptr, (Vnode *) 0,
volptr, &client);
ViceLog(2, ("SAFS_SetVolumeStatus returns %d\n", errorCode));
- errorCode = CallPostamble(tcon, errorCode);
+ errorCode = CallPostamble(tcon, errorCode, thost);
t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
int len;
char *temp;
struct rx_connection *tcon;
+ struct host *thost;
#endif
int errorCode = 0;
#if FS_STATS_DETAILED
return FSERR_EOPNOTSUPP;
#ifdef notdef
- if (errorCode = CallPreamble(acall, ACTIVECALL, &tcon))
+ if (errorCode = CallPreamble(acall, ACTIVECALL, &tcon, &thost))
goto Bad_GetRootVolume;
FS_LOCK;
AFSCallStats.GetRootVolume++, AFSCallStats.TotalCalls++;
*VolumeName = temp; /* freed by rx server-side stub */
Bad_GetRootVolume:
- errorCode = CallPostamble(tcon, errorCode);
+ errorCode = CallPostamble(tcon, errorCode, thost);
#if FS_STATS_DETAILED
TM_GetTimeOfDay(&opStopTime, 0);
{
afs_int32 code;
struct rx_connection *tcon;
+ struct host *thost;
#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 */
TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
- if ((code = CallPreamble(acall, ACTIVECALL, &tcon)))
+ if ((code = CallPreamble(acall, ACTIVECALL, &tcon, &thost)))
goto Bad_CheckToken;
code = FSERR_ECONNREFUSED;
Bad_CheckToken:
- code = CallPostamble(tcon, code);
+ code = CallPostamble(tcon, code, thost);
#if FS_STATS_DETAILED
TM_GetTimeOfDay(&opStopTime, 0);
{
afs_int32 code;
struct rx_connection *tcon;
+ struct host *thost;
struct timeval tpl;
#if FS_STATS_DETAILED
struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */
TM_GetTimeOfDay(&opStartTime, 0);
#endif /* FS_STATS_DETAILED */
- if ((code = CallPreamble(acall, NOTACTIVECALL, &tcon)))
+ if ((code = CallPreamble(acall, NOTACTIVECALL, &tcon, &thost)))
goto Bad_GetTime;
FS_LOCK;
ViceLog(2, ("SAFS_GetTime returns %u, %u\n", *Seconds, *USeconds));
Bad_GetTime:
- code = CallPostamble(tcon, code);
+ code = CallPostamble(tcon, code, thost);
#if FS_STATS_DETAILED
TM_GetTimeOfDay(&opStopTime, 0);
sys2et[EMEDIUMTYPE] = UAEMEDIUMTYPE;
}
+/* NOTE: 2006-03-01
+ * SRXAFS_CallBackRxConnAddr should be re-written as follows:
+ * - pass back the connection, client, and host from CallPreamble
+ * - keep a ref on the client, which we don't now
+ * - keep a hold on the host, which we already do
+ * - pass the connection, client, and host down into SAFSS_*, and use
+ * them instead of independently discovering them via rx_ConnectionOf
+ * (safe) and rx_GetSpecific (not so safe)
+ * The idea being that we decide what client and host we're going to use
+ * when CallPreamble is called, and stay consistent throughout the call.
+ * This change is too invasive for 1.4.1 but should be made in 1.5.x.
+ */
+
afs_int32
SRXAFS_CallBackRxConnAddr (struct rx_call * acall, afs_int32 *addr)
{
#ifdef __EXPERIMENTAL_CALLBACK_CONN_MOVING
struct host *thost;
struct client *tclient;
+ struct client *tcallhost;
static struct rx_securityClass *sc = 0;
int i,j;
struct rx_connection *conn;
#endif
- if (errorCode = CallPreamble(acall, ACTIVECALL, &tcon))
+ if (errorCode = CallPreamble(acall, ACTIVECALL, &tcon, &tcallhost))
goto Bad_CallBackRxConnAddr1;
#ifndef __EXPERIMENTAL_CALLBACK_CONN_MOVING
h_ReleaseClient_r(tclient);
/* The hold on thost will be released by CallPostamble */
H_UNLOCK;
- errorCode = CallPostamble(tcon, errorCode);
+ errorCode = CallPostamble(tcon, errorCode, tcallhost);
return errorCode;
} else {
rx_DestroyConnection(conn);
H_UNLOCK;
#endif
- errorCode = CallPostamble(tcon, errorCode);
+ errorCode = CallPostamble(tcon, errorCode, tcallhost);
Bad_CallBackRxConnAddr1:
return errorCode; /* failure */
}