LogClientError("CallPreamble: Couldn't get client", *tconn, viceid, Fid);
return VBUSY;
}
- thost = tclient->host;
- if (tclient->prfail == 1) { /* couldn't get the CPS */
+ thost = tclient->z.host;
+ if (tclient->z.prfail == 1) { /* couldn't get the CPS */
if (!retry_flag) {
h_ReleaseClient_r(tclient);
h_Release_r(thost);
return -1001;
}
- tclient->prfail = 2; /* Means re-eval client's cps */
+ tclient->z.prfail = 2; /* Means re-eval client's cps */
h_ReleaseClient_r(tclient);
h_Release_r(thost);
goto retry;
}
- tclient->LastCall = thost->z.LastCall = time(NULL);
+ tclient->z.LastCall = thost->z.LastCall = time(NULL);
if (activecall) /* For all but "GetTime", "GetStats", and "GetCaps" calls */
thost->z.ActiveCall = thost->z.LastCall;
tclient = h_FindClient_r(aconn, NULL);
if (!tclient)
goto busyout;
- thost = tclient->host;
+ thost = tclient->z.host;
if (thost->z.hostFlags & HERRORTRANS)
translate = 1;
h_ReleaseClient_r(tclient);
}
/* return the reference taken in local h_FindClient_r--h_ReleaseClient_r
- * does not decrement refcount on client->host */
+ * does not decrement refcount on client->z.host */
h_Release_r(thost);
busyout:
{
*rights = 0;
ObtainReadLock(&client->lock);
- if (client->CPS.prlist_len > 0 && !client->deleted &&
- client->host && !(client->host->z.hostFlags & HOSTDELETED))
- acl_CheckRights(ACL, &client->CPS, rights);
+ if (client->z.CPS.prlist_len > 0 && !client->z.deleted &&
+ client->z.host && !(client->z.host->z.hostFlags & HOSTDELETED))
+ acl_CheckRights(ACL, &client->z.CPS, rights);
ReleaseReadLock(&client->lock);
}
afs_int32 code = 0;
ObtainReadLock(&client->lock);
- if (client->CPS.prlist_len > 0 && !client->deleted &&
- client->host && !(client->host->z.hostFlags & HOSTDELETED))
- code = acl_IsAMember(id, &client->CPS);
+ if (client->z.CPS.prlist_len > 0 && !client->z.deleted &&
+ client->z.host && !(client->z.host->z.hostFlags & HOSTDELETED))
+ code = acl_IsAMember(id, &client->z.CPS);
ReleaseReadLock(&client->lock);
return code;
}
/* wait if somebody else is already doing the getCPS call */
H_LOCK;
- while (client->host->z.hostFlags & HCPS_INPROGRESS) {
- client->host->z.hostFlags |= HCPS_WAITING; /* I am waiting */
- opr_cv_wait(&client->host->cond, &host_glock_mutex);
+ while (client->z.host->z.hostFlags & HCPS_INPROGRESS) {
+ client->z.host->z.hostFlags |= HCPS_WAITING; /* I am waiting */
+ opr_cv_wait(&client->z.host->cond, &host_glock_mutex);
}
- if (!client->host->z.hcps.prlist_len || !client->host->z.hcps.prlist_val) {
+ if (!client->z.host->z.hcps.prlist_len || !client->z.host->z.hcps.prlist_val) {
char hoststr[16];
ViceLog(5,
("CheckRights: len=%u, for host=%s:%d\n",
- client->host->z.hcps.prlist_len,
- afs_inet_ntoa_r(client->host->z.host, hoststr),
- ntohs(client->host->z.port)));
+ client->z.host->z.hcps.prlist_len,
+ afs_inet_ntoa_r(client->z.host->z.host, hoststr),
+ ntohs(client->z.host->z.port)));
} else
- acl_CheckRights(ACL, &client->host->z.hcps, &hrights);
+ acl_CheckRights(ACL, &client->z.host->z.hcps, &hrights);
H_UNLOCK;
/* Allow system:admin the rights given with the -implicit option */
if (client_HasAsMember(client, SystemId))
/* ok, if this is not a dir, set the PRSFS_ADMINISTER bit iff we're the owner */
if ((*targetptr)->disk.type != vDirectory) {
/* anyuser can't be owner, so only have to worry about rights, not anyrights */
- if ((*targetptr)->disk.owner == (*client)->ViceId)
+ if ((*targetptr)->disk.owner == (*client)->z.ViceId)
(*rights) |= PRSFS_ADMINISTER;
else
(*rights) &= ~PRSFS_ADMINISTER;
afs_int32 owner = V_owner(targetptr->volumePtr); /* get volume owner */
if (owner >= 0)
- return (client->ViceId == owner);
+ return (client->z.ViceId == owner);
else {
/*
* We don't have to check for host's cps since only regular
AFSStoreStatus * InStatus)
{
Error errorCode = 0;
-#define OWNSp(client, target) ((client)->ViceId == (target)->disk.owner)
+#define OWNSp(client, target) ((client)->z.ViceId == (target)->disk.owner)
#define CHOWN(i,t) (((i)->Mask & AFS_SETOWNER) &&((i)->Owner != (t)->disk.owner))
#define CHGRP(i,t) (((i)->Mask & AFS_SETGROUP) &&((i)->Group != (t)->disk.group))
/* must have read access, or be owner and have insert access */
if (!(rights & PRSFS_READ)
&& !((OWNSp(client, targetptr) && (rights & PRSFS_INSERT)
- && (client->ViceId != AnonymousID))))
+ && (client->z.ViceId != AnonymousID))))
return (EACCES);
}
if (CallingRoutine == CHK_FETCHDATA
* reading of files created with no read permission. The owner
* of the file is always allowed to read it.
*/
- if ((client->ViceId != targetptr->disk.owner)
+ if ((client->z.ViceId != targetptr->disk.owner)
&& VanillaUser(client))
errorCode =
(((OWNERREAD | OWNEREXEC) & targetptr->disk.
} else { /* !VanillaUser(client) && !FetchData */
osi_audit(PrivilegeEvent, 0, AUD_ID,
- (client ? client->ViceId : 0), AUD_INT, CallingRoutine,
+ (client ? client->z.ViceId : 0), AUD_INT, CallingRoutine,
AUD_END);
}
} else { /* a store operation */
return (EPERM); /* Was EACCES */
else
osi_audit(PrivilegeEvent, 0, AUD_ID,
- (client ? client->ViceId : 0), AUD_INT,
+ (client ? client->z.ViceId : 0), AUD_INT,
CallingRoutine, AUD_END);
}
} else {
if (CallingRoutine != CHK_STOREDATA && !VanillaUser(client)) {
osi_audit(PrivilegeEvent, 0, AUD_ID,
- (client ? client->ViceId : 0), AUD_INT,
+ (client ? client->z.ViceId : 0), AUD_INT,
CallingRoutine, AUD_END);
} else {
if (readonlyServer) {
return (EPERM); /* Was EACCES */
else
osi_audit(PrivilegeEvent, 0, AUD_ID,
- (client ? client->ViceId : 0), AUD_INT,
+ (client ? client->z.ViceId : 0), AUD_INT,
CallingRoutine, AUD_END);
}
/* must be sysadmin to set suid/sgid bits */
return (EACCES);
else
osi_audit(PrivSetID, 0, AUD_ID,
- (client ? client->ViceId : 0), AUD_INT,
+ (client ? client->z.ViceId : 0), AUD_INT,
CallingRoutine, AUD_END);
}
if (CallingRoutine == CHK_STOREDATA) {
return (EACCES);
else
osi_audit(PrivilegeEvent, 0, AUD_ID,
- (client ? client->ViceId : 0),
+ (client ? client->z.ViceId : 0),
AUD_INT, CallingRoutine, AUD_END);
}
} else { /* a status store */
VN_SET_LEN(targetptr, length);
/* targetptr->disk.group = 0; save some cycles */
targetptr->disk.modeBits = 0777;
- targetptr->disk.owner = client->ViceId;
+ targetptr->disk.owner = client->z.ViceId;
targetptr->disk.dataVersion = 0; /* consistent with the client */
targetptr->disk.linkCount = (Caller & TVS_MKDIR ? 2 : 1);
/* the inode was created in Alloc_NewVnode() */
* counter is located immediately after its associated ``distance''
* counter.
*/
- if (client->InSameNetwork)
+ if (client->z.InSameNetwork)
writeIdx = VOL_STATS_SAME_NET;
else
writeIdx = VOL_STATS_DIFF_NET;
V_stat_writes(volptr, writeIdx)++;
- if (client->ViceId != AnonymousID) {
+ if (client->z.ViceId != AnonymousID) {
V_stat_writes(volptr, writeIdx + 1)++;
}
VOL_STATS_TIME_CAP_3 ? VOL_STATS_TIME_IDX_3 : currDate <
VOL_STATS_TIME_CAP_4 ? VOL_STATS_TIME_IDX_4 :
VOL_STATS_TIME_IDX_5);
- if (targetptr->disk.author == client->ViceId) {
+ if (targetptr->disk.author == client->z.ViceId) {
V_stat_fileSameAuthor(volptr, timeIdx)++;
} else {
V_stat_fileDiffAuthor(volptr, timeIdx)++;
}
if (!(Caller & TVS_SSTATUS))
- targetptr->disk.author = client->ViceId;
+ targetptr->disk.author = client->z.ViceId;
if (Caller & TVS_SDATA) {
targetptr->disk.dataVersion++;
if (!remote && VanillaUser(client)) {
targetptr->disk.modeBits = modebits;
switch (Caller) {
case TVS_SDATA:
- osi_audit(PrivSetID, 0, AUD_ID, client->ViceId, AUD_INT,
+ osi_audit(PrivSetID, 0, AUD_ID, client->z.ViceId, AUD_INT,
CHK_STOREDATA, AUD_END);
break;
case TVS_CFILE:
case TVS_SSTATUS:
- osi_audit(PrivSetID, 0, AUD_ID, client->ViceId, AUD_INT,
+ osi_audit(PrivSetID, 0, AUD_ID, client->z.ViceId, AUD_INT,
CHK_STORESTATUS, AUD_END);
break;
default:
ViceLog(5,
("SRXAFS_FetchData, Fid = %u.%u.%u, Host %s:%d, Id %d\n",
Fid->Volume, Fid->Vnode, Fid->Unique, inet_ntoa(logHostAddr),
- ntohs(rxr_PortOf(tcon)), t_client->ViceId));
+ ntohs(rxr_PortOf(tcon)), t_client->z.ViceId));
queue_NodeInit(&tcbv);
tcbv.call = acall;
* Remember that another read operation was performed.
*/
FS_LOCK;
- if (client->InSameNetwork)
+ if (client->z.InSameNetwork)
readIdx = VOL_STATS_SAME_NET;
else
readIdx = VOL_STATS_DIFF_NET;
V_stat_reads(volptr, readIdx)++;
- if (client->ViceId != AnonymousID) {
+ if (client->z.ViceId != AnonymousID) {
V_stat_reads(volptr, readIdx + 1)++;
}
FS_UNLOCK;
/* if a r/w volume, promise a callback to the caller */
if (VolumeWriteable(volptr))
- SetCallBackStruct(AddCallBack(client->host, Fid), CallBack);
+ SetCallBackStruct(AddCallBack(client->z.host, Fid), CallBack);
else {
struct AFSFid myFid;
memset(&myFid, 0, sizeof(struct AFSFid));
myFid.Volume = Fid->Volume;
- SetCallBackStruct(AddVolCallBack(client->host, &myFid), CallBack);
+ SetCallBackStruct(AddVolCallBack(client->z.host, &myFid), CallBack);
}
Bad_FetchData:
fsstats_FinishOp(&fsstats, errorCode);
osi_auditU(acall, FetchDataEvent, errorCode,
- AUD_ID, t_client ? t_client->ViceId : 0,
- AUD_FID, Fid, AUD_END);
+ AUD_ID, t_client ? t_client->z.ViceId : 0,
+ AUD_FID, Fid, AUD_END);
return (errorCode);
} /*SRXAFS_FetchData */
ViceLog(5,
("SAFS_FetchACL, Fid = %u.%u.%u, Host %s:%d, Id %d\n", Fid->Volume,
Fid->Vnode, Fid->Unique, inet_ntoa(logHostAddr),
- ntohs(rxr_PortOf(tcon)), t_client->ViceId));
+ ntohs(rxr_PortOf(tcon)), t_client->z.ViceId));
AccessList->AFSOpaque_len = 0;
AccessList->AFSOpaque_val = malloc(AFSOPAQUEMAX);
fsstats_FinishOp(&fsstats, errorCode);
osi_auditU(acall, FetchACLEvent, errorCode,
- AUD_ID, t_client ? t_client->ViceId : 0,
- AUD_FID, Fid,
- AUD_ACL, AccessList->AFSOpaque_val, AUD_END);
+ AUD_ID, t_client ? t_client->z.ViceId : 0,
+ AUD_FID, Fid,
+ AUD_ACL, AccessList->AFSOpaque_val, AUD_END);
return errorCode;
} /*SRXAFS_FetchACL */
ViceLog(1,
("SAFS_FetchStatus, Fid = %u.%u.%u, Host %s:%d, Id %d\n",
Fid->Volume, Fid->Vnode, Fid->Unique, inet_ntoa(logHostAddr),
- ntohs(rxr_PortOf(tcon)), t_client->ViceId));
+ ntohs(rxr_PortOf(tcon)), t_client->z.ViceId));
FS_LOCK;
AFSCallStats.FetchStatus++, AFSCallStats.TotalCalls++;
FS_UNLOCK;
/* If a r/w volume, also set the CallBack state */
if (VolumeWriteable(volptr))
- SetCallBackStruct(AddCallBack(client->host, Fid), CallBack);
+ SetCallBackStruct(AddCallBack(client->z.host, Fid), CallBack);
else {
struct AFSFid myFid;
memset(&myFid, 0, sizeof(struct AFSFid));
myFid.Volume = Fid->Volume;
- SetCallBackStruct(AddVolCallBack(client->host, &myFid), CallBack);
+ SetCallBackStruct(AddVolCallBack(client->z.host, &myFid), CallBack);
}
Bad_FetchStatus:
/* If a r/w volume, also set the CallBack state */
if (VolumeWriteable(volptr))
- SetCallBackStruct(AddBulkCallBack(client->host, tfid),
+ SetCallBackStruct(AddBulkCallBack(client->z.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),
+ SetCallBackStruct(AddVolCallBack(client->z.host, &myFid),
&CallBacks->AFSCBs_val[i]);
}
Audit_and_Return:
ViceLog(2, ("SAFS_BulkStatus returns %d\n", errorCode));
osi_auditU(acall, BulkFetchStatusEvent, errorCode,
- AUD_ID, t_client ? t_client->ViceId : 0,
- AUD_FIDS, Fids, AUD_END);
+ AUD_ID, t_client ? t_client->z.ViceId : 0,
+ AUD_FIDS, Fids, AUD_END);
return errorCode;
} /*SRXAFS_BulkStatus */
/* If a r/w volume, also set the CallBack state */
if (VolumeWriteable(volptr))
- SetCallBackStruct(AddBulkCallBack(client->host, tfid),
+ SetCallBackStruct(AddBulkCallBack(client->z.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),
+ SetCallBackStruct(AddVolCallBack(client->z.host, &myFid),
&CallBacks->AFSCBs_val[i]);
}
Audit_and_Return:
ViceLog(2, ("SAFS_InlineBulkStatus returns %d\n", errorCode));
osi_auditU(acall, InlineBulkFetchStatusEvent, errorCode,
- AUD_ID, t_client ? t_client->ViceId : 0,
- AUD_FIDS, Fids, AUD_END);
+ AUD_ID, t_client ? t_client->z.ViceId : 0,
+ AUD_FIDS, Fids, AUD_END);
return errorCode;
} /*SRXAFS_InlineBulkStatus */
fsstats_FinishOp(&fsstats, code);
osi_auditU(acall, FetchStatusEvent, code,
- AUD_ID, t_client ? t_client->ViceId : 0,
- AUD_FID, Fid, AUD_END);
+ AUD_ID, t_client ? t_client->z.ViceId : 0,
+ AUD_FID, Fid, AUD_END);
return code;
} /*SRXAFS_FetchStatus */
ViceLog(5,
("StoreData: Fid = %u.%u.%u, Host %s:%d, Id %d\n", Fid->Volume,
Fid->Vnode, Fid->Unique, inet_ntoa(logHostAddr),
- ntohs(rxr_PortOf(tcon)), t_client->ViceId));
+ ntohs(rxr_PortOf(tcon)), t_client->z.ViceId));
/*
* Get associated volume/vnode for the stored file; caller's rights
fsstats_FinishOp(&fsstats, errorCode);
osi_auditU(acall, StoreDataEvent, errorCode,
- AUD_ID, t_client ? t_client->ViceId : 0,
- AUD_FID, Fid, AUD_END);
+ AUD_ID, t_client ? t_client->z.ViceId : 0,
+ AUD_FID, Fid, AUD_END);
return (errorCode);
} /*common_StoreData64 */
ViceLog(1,
("SAFS_StoreACL, Fid = %u.%u.%u, ACL=%s, Host %s:%d, Id %d\n",
Fid->Volume, Fid->Vnode, Fid->Unique, AccessList->AFSOpaque_val,
- inet_ntoa(logHostAddr), ntohs(rxr_PortOf(tcon)), t_client->ViceId));
+ inet_ntoa(logHostAddr), ntohs(rxr_PortOf(tcon)), t_client->z.ViceId));
FS_LOCK;
AFSCallStats.StoreACL++, AFSCallStats.TotalCalls++;
FS_UNLOCK;
rx_KeepAliveOn(acall);
/* break call backs on the directory */
- BreakCallBack(client->host, Fid, 0);
+ BreakCallBack(client->z.host, Fid, 0);
/* Get the updated dir's status back to the caller */
GetStatus(targetptr, OutStatus, rights, anyrights, 0);
fsstats_FinishOp(&fsstats, errorCode);
osi_auditU(acall, StoreACLEvent, errorCode,
- AUD_ID, t_client ? t_client->ViceId : 0,
- AUD_FID, Fid, AUD_ACL, AccessList->AFSOpaque_val, AUD_END);
+ AUD_ID, t_client ? t_client->z.ViceId : 0,
+ AUD_FID, Fid, AUD_ACL, AccessList->AFSOpaque_val, AUD_END);
return errorCode;
} /*SRXAFS_StoreACL */
ViceLog(1,
("SAFS_StoreStatus, Fid = %u.%u.%u, Host %s:%d, Id %d\n",
Fid->Volume, Fid->Vnode, Fid->Unique, inet_ntoa(logHostAddr),
- ntohs(rxr_PortOf(tcon)), t_client->ViceId));
+ ntohs(rxr_PortOf(tcon)), t_client->z.ViceId));
FS_LOCK;
AFSCallStats.StoreStatus++, AFSCallStats.TotalCalls++;
FS_UNLOCK;
opr_Assert(!errorCode || errorCode == VSALVAGE);
/* Break call backs on Fid */
- BreakCallBack(client->host, Fid, 0);
+ BreakCallBack(client->z.host, Fid, 0);
/* Return the updated status back to caller */
GetStatus(targetptr, OutStatus, rights, anyrights,
fsstats_FinishOp(&fsstats, code);
osi_auditU(acall, StoreStatusEvent, code,
- AUD_ID, t_client ? t_client->ViceId : 0,
- AUD_FID, Fid, AUD_END);
+ AUD_ID, t_client ? t_client->z.ViceId : 0,
+ AUD_FID, Fid, AUD_END);
return code;
} /*SRXAFS_StoreStatus */
ViceLog(1,
("SAFS_RemoveFile %s, Did = %u.%u.%u, Host %s:%d, Id %d\n", Name,
DirFid->Volume, DirFid->Vnode, DirFid->Unique,
- inet_ntoa(logHostAddr), ntohs(rxr_PortOf(tcon)), t_client->ViceId));
+ inet_ntoa(logHostAddr), ntohs(rxr_PortOf(tcon)), t_client->z.ViceId));
FS_LOCK;
AFSCallStats.RemoveFile++, AFSCallStats.TotalCalls++;
FS_UNLOCK;
}
/* Update the vnode status of the parent dir */
- Update_ParentVnodeStatus(parentptr, volptr, &dir, client->ViceId,
+ Update_ParentVnodeStatus(parentptr, volptr, &dir, client->z.ViceId,
parentptr->disk.linkCount,
- client->InSameNetwork);
+ client->z.InSameNetwork);
rx_KeepAliveOn(acall);
VVnodeWriteToRead(&errorCode, targetptr);
opr_Assert(!errorCode || errorCode == VSALVAGE);
/* tell all the file has changed */
- BreakCallBack(client->host, &fileFid, 1);
+ BreakCallBack(client->z.host, &fileFid, 1);
}
/* break call back on the directory */
- BreakCallBack(client->host, DirFid, 0);
+ BreakCallBack(client->z.host, DirFid, 0);
Bad_RemoveFile:
/* Update and store volume/vnode and parent vnodes back */
fsstats_FinishOp(&fsstats, code);
osi_auditU(acall, RemoveFileEvent, code,
- AUD_ID, t_client ? t_client->ViceId : 0,
- AUD_FID, DirFid, AUD_STR, Name, AUD_END);
+ AUD_ID, t_client ? t_client->z.ViceId : 0,
+ AUD_FID, DirFid, AUD_STR, Name, AUD_END);
return code;
} /*SRXAFS_RemoveFile */
ViceLog(1,
("SAFS_CreateFile %s, Did = %u.%u.%u, Host %s:%d, Id %d\n", Name,
DirFid->Volume, DirFid->Vnode, DirFid->Unique,
- inet_ntoa(logHostAddr), ntohs(rxr_PortOf(tcon)), t_client->ViceId));
+ inet_ntoa(logHostAddr), ntohs(rxr_PortOf(tcon)), t_client->z.ViceId));
FS_LOCK;
AFSCallStats.CreateFile++, AFSCallStats.TotalCalls++;
FS_UNLOCK;
goto Bad_CreateFile;
/* update the status of the parent vnode */
- Update_ParentVnodeStatus(parentptr, volptr, &dir, client->ViceId,
+ Update_ParentVnodeStatus(parentptr, volptr, &dir, client->z.ViceId,
parentptr->disk.linkCount,
- client->InSameNetwork);
+ client->z.InSameNetwork);
/* update the status of the new file's vnode */
Update_TargetVnodeStatus(targetptr, TVS_CFILE, client, InStatus,
opr_Assert(!errorCode || errorCode == VSALVAGE);
/* break call back on parent dir */
- BreakCallBack(client->host, DirFid, 0);
+ BreakCallBack(client->z.host, DirFid, 0);
/* Return a callback promise for the newly created file to the caller */
- SetCallBackStruct(AddCallBack(client->host, OutFid), CallBack);
+ SetCallBackStruct(AddCallBack(client->z.host, OutFid), CallBack);
Bad_CreateFile:
/* Update and store volume/vnode and parent vnodes back */
fsstats_FinishOp(&fsstats, code);
osi_auditU(acall, CreateFileEvent, code,
- AUD_ID, t_client ? t_client->ViceId : 0,
- AUD_FID, DirFid, AUD_STR, Name, AUD_FID, OutFid, AUD_END);
+ AUD_ID, t_client ? t_client->z.ViceId : 0,
+ AUD_FID, DirFid, AUD_STR, Name, AUD_FID, OutFid, AUD_END);
return code;
} /*SRXAFS_CreateFile */
("SAFS_Rename %s to %s, Fid = %u.%u.%u to %u.%u.%u, Host %s:%d, Id %d\n",
OldName, NewName, OldDirFid->Volume, OldDirFid->Vnode,
OldDirFid->Unique, NewDirFid->Volume, NewDirFid->Vnode,
- NewDirFid->Unique, inet_ntoa(logHostAddr), ntohs(rxr_PortOf(tcon)), t_client->ViceId));
+ NewDirFid->Unique, inet_ntoa(logHostAddr), ntohs(rxr_PortOf(tcon)), t_client->z.ViceId));
FS_LOCK;
AFSCallStats.Rename++, AFSCallStats.TotalCalls++;
FS_UNLOCK;
opr_Assert(afs_dir_Delete(&olddir, OldName) == 0);
/* if the directory length changes, reflect it in the statistics */
- Update_ParentVnodeStatus(oldvptr, volptr, &olddir, client->ViceId,
- oldvptr->disk.linkCount, client->InSameNetwork);
- Update_ParentVnodeStatus(newvptr, volptr, &newdir, client->ViceId,
- newvptr->disk.linkCount, client->InSameNetwork);
+ Update_ParentVnodeStatus(oldvptr, volptr, &olddir, client->z.ViceId,
+ oldvptr->disk.linkCount, client->z.InSameNetwork);
+ Update_ParentVnodeStatus(newvptr, volptr, &newdir, client->z.ViceId,
+ newvptr->disk.linkCount, client->z.InSameNetwork);
if (oldvptr == newvptr)
oldvptr->disk.dataVersion--; /* Since it was bumped by 2! */
rx_KeepAliveOn(acall);
/* break call back on NewDirFid, OldDirFid, NewDirFid and newFileFid */
- BreakCallBack(client->host, NewDirFid, 0);
+ BreakCallBack(client->z.host, NewDirFid, 0);
if (oldvptr != newvptr) {
- BreakCallBack(client->host, OldDirFid, 0);
+ BreakCallBack(client->z.host, OldDirFid, 0);
}
if (updatefile) {
/* if a dir moved, .. changed */
* enough to know that the callback could be broken implicitly,
* but that may not be clear, and some client implementations
* may not know to. */
- BreakCallBack(client->host, &fileFid, 1);
+ BreakCallBack(client->z.host, &fileFid, 1);
}
if (newfileptr) {
/* Note: it is not necessary to break the callback */
DeleteFileCallBacks(&newFileFid); /* no other references */
else
/* other's still exist (with wrong link count) */
- BreakCallBack(client->host, &newFileFid, 1);
+ BreakCallBack(client->z.host, &newFileFid, 1);
}
Bad_Rename:
fsstats_FinishOp(&fsstats, code);
osi_auditU(acall, RenameFileEvent, code,
- AUD_ID, t_client ? t_client->ViceId : 0,
- AUD_FID, OldDirFid, AUD_STR, OldName,
- AUD_FID, NewDirFid, AUD_STR, NewName, AUD_END);
+ AUD_ID, t_client ? t_client->z.ViceId : 0,
+ AUD_FID, OldDirFid, AUD_STR, OldName,
+ AUD_FID, NewDirFid, AUD_STR, NewName, AUD_END);
return code;
} /*SRXAFS_Rename */
ViceLog(1,
("SAFS_Symlink %s to %s, Did = %u.%u.%u, Host %s:%d, Id %d\n", Name,
LinkContents, DirFid->Volume, DirFid->Vnode, DirFid->Unique,
- inet_ntoa(logHostAddr), ntohs(rxr_PortOf(tcon)), t_client->ViceId));
+ inet_ntoa(logHostAddr), ntohs(rxr_PortOf(tcon)), t_client->z.ViceId));
FS_LOCK;
AFSCallStats.Symlink++, AFSCallStats.TotalCalls++;
FS_UNLOCK;
}
/* update the status of the parent vnode */
- Update_ParentVnodeStatus(parentptr, volptr, &dir, client->ViceId,
+ Update_ParentVnodeStatus(parentptr, volptr, &dir, client->z.ViceId,
parentptr->disk.linkCount,
- client->InSameNetwork);
+ client->z.InSameNetwork);
/* update the status of the new symbolic link file vnode */
Update_TargetVnodeStatus(targetptr, TVS_SLINK, client, InStatus,
rx_KeepAliveOn(acall);
/* break call back on the parent dir */
- BreakCallBack(client->host, DirFid, 0);
+ BreakCallBack(client->z.host, DirFid, 0);
Bad_SymLink:
/* Write the all modified vnodes (parent, new files) and volume back */
fsstats_FinishOp(&fsstats, code);
osi_auditU(acall, SymlinkEvent, code,
- AUD_ID, t_client ? t_client->ViceId : 0,
- AUD_FID, DirFid, AUD_STR, Name,
+ AUD_ID, t_client ? t_client->z.ViceId : 0,
+ AUD_FID, DirFid, AUD_STR, Name,
AUD_FID, OutFid, AUD_STR, LinkContents, AUD_END);
return code;
("SAFS_Link %s, Did = %u.%u.%u, Fid = %u.%u.%u, Host %s:%d, Id %d\n",
Name, DirFid->Volume, DirFid->Vnode, DirFid->Unique,
ExistingFid->Volume, ExistingFid->Vnode, ExistingFid->Unique,
- inet_ntoa(logHostAddr), ntohs(rxr_PortOf(tcon)), t_client->ViceId));
+ inet_ntoa(logHostAddr), ntohs(rxr_PortOf(tcon)), t_client->z.ViceId));
FS_LOCK;
AFSCallStats.Link++, AFSCallStats.TotalCalls++;
FS_UNLOCK;
/* update the status in the parent vnode */
/**WARNING** --> disk.author SHOULDN'T be modified???? */
- Update_ParentVnodeStatus(parentptr, volptr, &dir, client->ViceId,
+ Update_ParentVnodeStatus(parentptr, volptr, &dir, client->z.ViceId,
parentptr->disk.linkCount,
- client->InSameNetwork);
+ client->z.InSameNetwork);
targetptr->disk.linkCount++;
- targetptr->disk.author = client->ViceId;
+ targetptr->disk.author = client->z.ViceId;
targetptr->changed_newTime = 1; /* Status change of linked-to file */
/* set up return status */
rx_KeepAliveOn(acall);
/* break call back on DirFid */
- BreakCallBack(client->host, DirFid, 0);
+ BreakCallBack(client->z.host, DirFid, 0);
/*
* We also need to break the callback for the file that is hard-linked since part
* of its status (like linkcount) is changed
*/
- BreakCallBack(client->host, ExistingFid, 0);
+ BreakCallBack(client->z.host, ExistingFid, 0);
Bad_Link:
/* Write the all modified vnodes (parent, new files) and volume back */
fsstats_FinishOp(&fsstats, code);
osi_auditU(acall, LinkEvent, code,
- AUD_ID, t_client ? t_client->ViceId : 0,
- AUD_FID, DirFid, AUD_STR, Name,
+ AUD_ID, t_client ? t_client->z.ViceId : 0,
+ AUD_FID, DirFid, AUD_STR, Name,
AUD_FID, ExistingFid, AUD_END);
return code;
ViceLog(1,
("SAFS_MakeDir %s, Did = %u.%u.%u, Host %s:%d, Id %d\n", Name,
DirFid->Volume, DirFid->Vnode, DirFid->Unique,
- inet_ntoa(logHostAddr), ntohs(rxr_PortOf(tcon)), t_client->ViceId));
+ inet_ntoa(logHostAddr), ntohs(rxr_PortOf(tcon)), t_client->z.ViceId));
FS_LOCK;
AFSCallStats.MakeDir++, AFSCallStats.TotalCalls++;
FS_UNLOCK;
}
/* Update the status for the parent dir */
- Update_ParentVnodeStatus(parentptr, volptr, &parentdir, client->ViceId,
+ Update_ParentVnodeStatus(parentptr, volptr, &parentdir, client->z.ViceId,
parentptr->disk.linkCount + 1,
- client->InSameNetwork);
+ client->z.InSameNetwork);
/* Point to target's ACL buffer and copy the parent's ACL contents to it */
opr_Verify((SetAccessList(&targetptr, &volptr, &newACL, &newACLSize,
rx_KeepAliveOn(acall);
/* break call back on DirFid */
- BreakCallBack(client->host, DirFid, 0);
+ BreakCallBack(client->z.host, DirFid, 0);
/* Return a callback promise to caller */
- SetCallBackStruct(AddCallBack(client->host, OutFid), CallBack);
+ SetCallBackStruct(AddCallBack(client->z.host, OutFid), CallBack);
Bad_MakeDir:
/* Write the all modified vnodes (parent, new files) and volume back */
fsstats_FinishOp(&fsstats, code);
osi_auditU(acall, MakeDirEvent, code,
- AUD_ID, t_client ? t_client->ViceId : 0,
- AUD_FID, DirFid, AUD_STR, Name,
+ AUD_ID, t_client ? t_client->z.ViceId : 0,
+ AUD_FID, DirFid, AUD_STR, Name,
AUD_FID, OutFid, AUD_END);
return code;
ViceLog(1,
("SAFS_RemoveDir %s, Did = %u.%u.%u, Host %s:%d, Id %d\n", Name,
DirFid->Volume, DirFid->Vnode, DirFid->Unique,
- inet_ntoa(logHostAddr), ntohs(rxr_PortOf(tcon)), t_client->ViceId));
+ inet_ntoa(logHostAddr), ntohs(rxr_PortOf(tcon)), t_client->z.ViceId));
FS_LOCK;
AFSCallStats.RemoveDir++, AFSCallStats.TotalCalls++;
FS_UNLOCK;
}
/* Update the status for the parent dir; link count is also adjusted */
- Update_ParentVnodeStatus(parentptr, volptr, &dir, client->ViceId,
+ Update_ParentVnodeStatus(parentptr, volptr, &dir, client->z.ViceId,
parentptr->disk.linkCount - 1,
- client->InSameNetwork);
+ client->z.InSameNetwork);
/* Return to the caller the updated parent dir status */
GetStatus(parentptr, OutDirStatus, rights, anyrights, NULL);
rx_KeepAliveOn(acall);
/* break call back on DirFid and fileFid */
- BreakCallBack(client->host, DirFid, 0);
+ BreakCallBack(client->z.host, DirFid, 0);
Bad_RemoveDir:
/* Write the all modified vnodes (parent, new files) and volume back */
fsstats_FinishOp(&fsstats, code);
osi_auditU(acall, RemoveDirEvent, code,
- AUD_ID, t_client ? t_client->ViceId : 0,
- AUD_FID, DirFid, AUD_STR, Name, AUD_END);
+ AUD_ID, t_client ? t_client->z.ViceId : 0,
+ AUD_FID, DirFid, AUD_STR, Name, AUD_END);
return code;
} /*SRXAFS_RemoveDir */
ViceLog(1,
("SAFS_SetLock type = %s Fid = %u.%u.%u, Host %s:%d, Id %d\n",
locktype[(int)type], Fid->Volume, Fid->Vnode, Fid->Unique,
- inet_ntoa(logHostAddr), ntohs(rxr_PortOf(tcon)), t_client->ViceId));
+ inet_ntoa(logHostAddr), ntohs(rxr_PortOf(tcon)), t_client->z.ViceId));
FS_LOCK;
AFSCallStats.SetLock++, AFSCallStats.TotalCalls++;
FS_UNLOCK;
fsstats_FinishOp(&fsstats, code);
osi_auditU(acall, SetLockEvent, code,
- AUD_ID, t_client ? t_client->ViceId : 0,
- AUD_FID, Fid, AUD_LONG, type, AUD_END);
+ AUD_ID, t_client ? t_client->z.ViceId : 0,
+ AUD_FID, Fid, AUD_LONG, type, AUD_END);
return code;
} /*SRXAFS_SetLock */
ViceLog(1,
("SAFS_ExtendLock Fid = %u.%u.%u, Host %s:%d, Id %d\n", Fid->Volume,
Fid->Vnode, Fid->Unique, inet_ntoa(logHostAddr),
- ntohs(rxr_PortOf(tcon)), t_client->ViceId));
+ ntohs(rxr_PortOf(tcon)), t_client->z.ViceId));
FS_LOCK;
AFSCallStats.ExtendLock++, AFSCallStats.TotalCalls++;
FS_UNLOCK;
fsstats_FinishOp(&fsstats, code);
osi_auditU(acall, ExtendLockEvent, code,
- AUD_ID, t_client ? t_client->ViceId : 0,
- AUD_FID, Fid, AUD_END);
+ AUD_ID, t_client ? t_client->z.ViceId : 0,
+ AUD_FID, Fid, AUD_END);
return code;
} /*SRXAFS_ExtendLock */
ViceLog(1,
("SAFS_ReleaseLock Fid = %u.%u.%u, Host %s:%d, Id %d\n", Fid->Volume,
Fid->Vnode, Fid->Unique, inet_ntoa(logHostAddr),
- ntohs(rxr_PortOf(tcon)), t_client->ViceId));
+ ntohs(rxr_PortOf(tcon)), t_client->z.ViceId));
FS_LOCK;
AFSCallStats.ReleaseLock++, AFSCallStats.TotalCalls++;
FS_UNLOCK;
/* convert the write lock to a read lock before breaking callbacks */
VVnodeWriteToRead(&errorCode, targetptr);
opr_Assert(!errorCode || errorCode == VSALVAGE);
- BreakCallBack(client->host, Fid, 0);
+ BreakCallBack(client->z.host, Fid, 0);
}
Bad_ReleaseLock:
fsstats_FinishOp(&fsstats, code);
osi_auditU(acall, ReleaseLockEvent, code,
- AUD_ID, t_client ? t_client->ViceId : 0,
- AUD_FID, Fid, AUD_END);
+ AUD_ID, t_client ? t_client->z.ViceId : 0,
+ AUD_FID, Fid, AUD_END);
return code;
} /*SRXAFS_ReleaseLock */
fsstats_FinishOp(&fsstats, code);
osi_auditU(acall, GetStatisticsEvent, code,
- AUD_ID, t_client ? t_client->ViceId : 0, AUD_END);
+ AUD_ID, t_client ? t_client->z.ViceId : 0, AUD_END);
return code;
} /*SRXAFS_GetStatistics */
fsstats_FinishOp(&fsstats, code);
osi_auditU(acall, GetStatisticsEvent, code,
- AUD_ID, t_client ? t_client->ViceId : 0, AUD_END);
+ AUD_ID, t_client ? t_client->z.ViceId : 0, AUD_END);
return code;
} /*SRXAFS_GetStatistics */
fsstats_FinishOp(&fsstats, 0);
osi_auditU(a_call, XStatsVersionEvent, 0,
- AUD_ID, t_client ? t_client->ViceId : 0, AUD_END);
+ AUD_ID, t_client ? t_client->z.ViceId : 0, AUD_END);
return (0);
} /*SRXAFS_XStatsVersion */
errorCode = GetClient(tcon, &client);
if (!errorCode) {
H_LOCK;
- DeleteAllCallBacks_r(client->host, 1);
+ DeleteAllCallBacks_r(client->z.host, 1);
H_UNLOCK;
PutClient(&client);
}
if (!errorCode) {
for (i = 0; i < FidArray->AFSCBFids_len; i++) {
struct AFSFid *fid = &(FidArray->AFSCBFids_val[i]);
- DeleteCallBack(client->host, fid);
+ DeleteCallBack(client->z.host, fid);
}
PutClient(&client);
}
{
ObtainWriteLock(&client->lock);
- client->prfail = 2; /* Means re-eval client's cps */
+ client->z.prfail = 2; /* Means re-eval client's cps */
- if ((client->ViceId != ANONYMOUSID) && client->CPS.prlist_val) {
- free(client->CPS.prlist_val);
- client->CPS.prlist_val = NULL;
- client->CPS.prlist_len = 0;
+ if ((client->z.ViceId != ANONYMOUSID) && client->z.CPS.prlist_val) {
+ free(client->z.CPS.prlist_val);
+ client->z.CPS.prlist_val = NULL;
+ client->z.CPS.prlist_len = 0;
}
ReleaseWriteLock(&client->lock);
fsstats_FinishOp(&fsstats, errorCode);
osi_auditU(acall, GetVolumeStatusEvent, errorCode,
- AUD_ID, t_client ? t_client->ViceId : 0,
- AUD_LONG, avolid, AUD_STR, *Name, AUD_END);
+ AUD_ID, t_client ? t_client->z.ViceId : 0,
+ AUD_LONG, avolid, AUD_STR, *Name, AUD_END);
return (errorCode);
} /*SRXAFS_GetVolumeStatus */
fsstats_FinishOp(&fsstats, errorCode);
osi_auditU(acall, SetVolumeStatusEvent, errorCode,
- AUD_ID, t_client ? t_client->ViceId : 0,
- AUD_LONG, avolid, AUD_STR, Name, AUD_END);
+ AUD_ID, t_client ? t_client->z.ViceId : 0,
+ AUD_LONG, avolid, AUD_STR, Name, AUD_END);
return (errorCode);
} /*SRXAFS_SetVolumeStatus */
* We break the callbacks here so that the following signal will not
* leave a window.
*/
- BreakCallBack(client->host, Fid, 0);
+ BreakCallBack(client->z.host, Fid, 0);
if (Pos == -1 || VN_GET_INO(targetptr) == 0) {
/* the inode should have been created in Alloc_NewVnode */
LogClientError("Client host too busy (CallBackRxConnAddr)", tcon, viceid, NULL);
goto Bad_CallBackRxConnAddr;
}
- thost = tclient->host;
+ thost = tclient->z.host;
/* nothing more can be done */
if ( !thost->z.interface )
for (i = 0; i < (CESPERBLOCK - 1); i++) {
Lock_Init(&block->entry[i].lock);
- block->entry[i].next = &(block->entry[i + 1]);
+ block->entry[i].z.next = &(block->entry[i + 1]);
}
- block->entry[CESPERBLOCK - 1].next = 0;
+ block->entry[CESPERBLOCK - 1].z.next = 0;
Lock_Init(&block->entry[CESPERBLOCK - 1].lock);
CEFree = (struct client *)block;
CEBlocks++;
}
entry = CEFree;
- CEFree = entry->next;
+ CEFree = entry->z.next;
CEs++;
- memset(entry, 0, CLIENT_TO_ZERO(entry));
+ memset(&entry->z, 0, sizeof(struct client_to_zero));
return (entry);
} /*GetCE */
static void
FreeCE(struct client *entry)
{
- entry->VenusEpoch = 0;
- entry->sid = 0;
- entry->next = CEFree;
+ entry->z.VenusEpoch = 0;
+ entry->z.sid = 0;
+ entry->z.next = CEFree;
CEFree = entry;
CEs--;
/* h_TossStuff_r: Toss anything in the host structure (the host or
* clients marked for deletion. Called from h_Release_r ONLY.
- * To be called, there must be no holds, and either host->deleted
+ * To be called, there must be no holds, and either host->z.deleted
* or host->clientDeleted must be set.
*/
void
/* ASSUMPTION: rxi_FreeConnection() does not yield */
for (cp = &host->z.FirstClient; (client = *cp);) {
- if ((host->z.hostFlags & HOSTDELETED) || client->deleted) {
+ if ((host->z.hostFlags & HOSTDELETED) || client->z.deleted) {
int code;
ObtainWriteLockNoBlock(&client->lock, code);
if (code < 0) {
return;
}
- if (client->refCount) {
+ if (client->z.refCount) {
char hoststr[16];
ViceLog(0,
("Warning: h_TossStuff_r failed: Host %p (%s:%d) "
"client %p refcount %d.\n",
host, afs_inet_ntoa_r(host->z.host, hoststr),
- ntohs(host->z.port), client, client->refCount));
+ ntohs(host->z.port), client, client->z.refCount));
/* This is the same thing we do if the host is locked */
ReleaseWriteLock(&client->lock);
return;
}
- client->CPS.prlist_len = 0;
- if ((client->ViceId != ANONYMOUSID) && client->CPS.prlist_val)
- free(client->CPS.prlist_val);
- client->CPS.prlist_val = NULL;
+ client->z.CPS.prlist_len = 0;
+ if ((client->z.ViceId != ANONYMOUSID) && client->z.CPS.prlist_val)
+ free(client->z.CPS.prlist_val);
+ client->z.CPS.prlist_val = NULL;
CurrentConnections--;
- *cp = client->next;
+ *cp = client->z.next;
ReleaseWriteLock(&client->lock);
FreeCE(client);
} else
- cp = &client->next;
+ cp = &client->z.next;
}
/* We've just cleaned out all the deleted clients; clear the flag */
struct client *client;
int code;
- for (client = host->z.FirstClient; client; client = client->next) {
- if (!client->deleted && client->ViceId == args->vid) {
+ for (client = host->z.FirstClient; client; client = client->z.next) {
+ if (!client->z.deleted && client->z.ViceId == args->vid) {
- client->refCount++;
+ client->z.refCount++;
H_UNLOCK;
code = (*args->proc)(client, args->rock);
* by one. The caller must call h_ReleaseClient_r when finished with
* the client.
*
- * The refCount on client->host is returned incremented. h_ReleaseClient_r
- * does not decrement the refCount on client->host.
+ * The refCount on client->z.host is returned incremented. h_ReleaseClient_r
+ * does not decrement the refCount on client->z.host.
*
* *a_viceid is set to the user's ViceId, even if we don't return a client
* struct.
int created = 0;
client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
- if (client && client->sid == rx_GetConnectionId(tcon)
- && client->VenusEpoch == rx_GetConnectionEpoch(tcon)
- && !(client->host->z.hostFlags & HOSTDELETED)
- && !client->deleted) {
+ if (client && client->z.sid == rx_GetConnectionId(tcon)
+ && client->z.VenusEpoch == rx_GetConnectionEpoch(tcon)
+ && !(client->z.host->z.hostFlags & HOSTDELETED)
+ && !client->z.deleted) {
if (a_viceid) {
- *a_viceid = client->ViceId;
+ *a_viceid = client->z.ViceId;
}
- client->refCount++;
- h_Hold_r(client->host);
- if (client->prfail != 2) {
+ client->z.refCount++;
+ h_Hold_r(client->z.host);
+ if (client->z.prfail != 2) {
/* Could add shared lock on client here */
/* note that we don't have to lock entry in this path to
* ensure CPS is initialized, since we don't call rx_SetSpecific
retryfirstclient:
/* First try to find the client structure */
- for (client = host->z.FirstClient; client; client = client->next) {
- if (!client->deleted && (client->sid == rx_GetConnectionId(tcon))
- && (client->VenusEpoch == rx_GetConnectionEpoch(tcon))) {
- client->refCount++;
+ for (client = host->z.FirstClient; client; client = client->z.next) {
+ if (!client->z.deleted && (client->z.sid == rx_GetConnectionId(tcon))
+ && (client->z.VenusEpoch == rx_GetConnectionEpoch(tcon))) {
+ client->z.refCount++;
H_UNLOCK;
ObtainWriteLock(&client->lock);
H_LOCK;
return NULL;
}
/* Retry to find the client structure */
- for (client = host->z.FirstClient; client; client = client->next) {
- if (!client->deleted && (client->sid == rx_GetConnectionId(tcon))
- && (client->VenusEpoch == rx_GetConnectionEpoch(tcon))) {
+ for (client = host->z.FirstClient; client; client = client->z.next) {
+ if (!client->z.deleted && (client->z.sid == rx_GetConnectionId(tcon))
+ && (client->z.VenusEpoch == rx_GetConnectionEpoch(tcon))) {
h_Unlock_r(host);
goto retryfirstclient;
}
created = 1;
client = GetCE();
ObtainWriteLock(&client->lock);
- client->refCount = 1;
- client->host = host;
- client->InSameNetwork = host->z.InSameNetwork;
- client->ViceId = viceid;
- client->expTime = expTime; /* rx only */
- client->authClass = authClass; /* rx only */
- client->sid = rx_GetConnectionId(tcon);
- client->VenusEpoch = rx_GetConnectionEpoch(tcon);
- client->CPS.prlist_val = NULL;
- client->CPS.prlist_len = 0;
+ client->z.refCount = 1;
+ client->z.host = host;
+ client->z.InSameNetwork = host->z.InSameNetwork;
+ client->z.ViceId = viceid;
+ client->z.expTime = expTime; /* rx only */
+ client->z.authClass = authClass; /* rx only */
+ client->z.sid = rx_GetConnectionId(tcon);
+ client->z.VenusEpoch = rx_GetConnectionEpoch(tcon);
+ client->z.CPS.prlist_val = NULL;
+ client->z.CPS.prlist_len = 0;
h_Unlock_r(host);
}
}
- client->prfail = fail;
+ client->z.prfail = fail;
- if (!(client->CPS.prlist_val) || (viceid != client->ViceId)) {
- client->CPS.prlist_len = 0;
- if (client->CPS.prlist_val && (client->ViceId != ANONYMOUSID))
- free(client->CPS.prlist_val);
- client->CPS.prlist_val = NULL;
- client->ViceId = viceid;
- client->expTime = expTime;
+ if (!(client->z.CPS.prlist_val) || (viceid != client->z.ViceId)) {
+ client->z.CPS.prlist_len = 0;
+ if (client->z.CPS.prlist_val && (client->z.ViceId != ANONYMOUSID))
+ free(client->z.CPS.prlist_val);
+ client->z.CPS.prlist_val = NULL;
+ client->z.ViceId = viceid;
+ client->z.expTime = expTime;
if (viceid == ANONYMOUSID) {
- client->CPS.prlist_len = AnonCPS.prlist_len;
- client->CPS.prlist_val = AnonCPS.prlist_val;
+ client->z.CPS.prlist_len = AnonCPS.prlist_len;
+ client->z.CPS.prlist_val = AnonCPS.prlist_val;
} else {
H_UNLOCK;
- code = hpr_GetCPS(viceid, &client->CPS);
+ code = hpr_GetCPS(viceid, &client->z.CPS);
H_LOCK;
if (code) {
char hoststr[16];
ViceLog(0,
("pr_GetCPS failed(%d) for user %d, host %" AFS_PTR_FMT " (%s:%d)\n",
- code, viceid, client->host,
- afs_inet_ntoa_r(client->host->z.host,hoststr),
- ntohs(client->host->z.port)));
+ code, viceid, client->z.host,
+ afs_inet_ntoa_r(client->z.host->z.host,hoststr),
+ ntohs(client->z.host->z.port)));
/* Although ubik_Call (called by pr_GetCPS) traverses thru
* all protection servers and reevaluates things if no
* want to retry and we don't know the whole code list!
*/
if (code < 0 || code == UNOQUORUM || code == UNOTSYNC)
- client->prfail = 1;
+ client->z.prfail = 1;
}
}
/* the disabling of system:administrators is so iffy and has so many
* possible failure modes that we will disable it again */
/* Turn off System:Administrator for safety
- * if (AL_IsAMember(SystemId, client->CPS) == 0)
- * osi_Assert(AL_DisableGroup(SystemId, client->CPS) == 0); */
+ * if (AL_IsAMember(SystemId, client->z.CPS) == 0)
+ * osi_Assert(AL_DisableGroup(SystemId, client->z.CPS) == 0); */
}
/* Now, tcon may already be set to a rock, since we blocked with no host
*/
oldClient = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
if (oldClient && oldClient != client
- && oldClient->sid == rx_GetConnectionId(tcon)
- && oldClient->VenusEpoch == rx_GetConnectionEpoch(tcon)
- && !(oldClient->host->z.hostFlags & HOSTDELETED)) {
+ && oldClient->z.sid == rx_GetConnectionId(tcon)
+ && oldClient->z.VenusEpoch == rx_GetConnectionEpoch(tcon)
+ && !(oldClient->z.host->z.hostFlags & HOSTDELETED)) {
char hoststr[16];
- if (!oldClient->deleted) {
+ if (!oldClient->z.deleted) {
/* if we didn't create it, it's not ours to put back */
if (created) {
ViceLog(0, ("FindClient: stillborn client %p(%x); "
"conn %p (host %s:%d) had client %p(%x)\n",
- client, client->sid, tcon,
+ client, client->z.sid, tcon,
afs_inet_ntoa_r(rxr_HostOf(tcon), hoststr),
ntohs(rxr_PortOf(tcon)),
- oldClient, oldClient->sid));
- if ((client->ViceId != ANONYMOUSID) && client->CPS.prlist_val)
- free(client->CPS.prlist_val);
- client->CPS.prlist_val = NULL;
- client->CPS.prlist_len = 0;
+ oldClient, oldClient->z.sid));
+ if ((client->z.ViceId != ANONYMOUSID) && client->z.CPS.prlist_val)
+ free(client->z.CPS.prlist_val);
+ client->z.CPS.prlist_val = NULL;
+ client->z.CPS.prlist_len = 0;
}
/* We should perhaps check for 0 here */
- client->refCount--;
+ client->z.refCount--;
ReleaseWriteLock(&client->lock);
if (created) {
FreeCE(client);
created = 0;
}
- oldClient->refCount++;
+ oldClient->z.refCount++;
- h_Hold_r(oldClient->host);
- h_Release_r(client->host);
+ h_Hold_r(oldClient->z.host);
+ h_Release_r(client->z.host);
H_UNLOCK;
ObtainWriteLock(&oldClient->lock);
H_LOCK;
client = oldClient;
- host = oldClient->host;
+ host = oldClient->z.host;
} else {
ViceLog(0, ("FindClient: deleted client %p(%x ref %d host %p href "
"%d) already had conn %p (host %s:%d, cid %x), stolen "
"by client %p(%x, ref %d host %p href %d)\n",
- oldClient, oldClient->sid, oldClient->refCount,
- oldClient->host, oldClient->host->z.refCount, tcon,
+ oldClient, oldClient->z.sid, oldClient->z.refCount,
+ oldClient->z.host, oldClient->z.host->z.refCount, tcon,
afs_inet_ntoa_r(rxr_HostOf(tcon), hoststr),
ntohs(rxr_PortOf(tcon)), rx_GetConnectionId(tcon),
- client, client->sid, client->refCount,
- client->host, client->host->z.refCount));
+ client, client->z.sid, client->z.refCount,
+ client->z.host, client->z.host->z.refCount));
/* rx_SetSpecific will be done immediately below */
}
}
h_Release_r(host);
host = NULL;
- client->host = NULL;
+ client->z.host = NULL;
- if ((client->ViceId != ANONYMOUSID) && client->CPS.prlist_val)
- free(client->CPS.prlist_val);
- client->CPS.prlist_val = NULL;
- client->CPS.prlist_len = 0;
+ if ((client->z.ViceId != ANONYMOUSID) && client->z.CPS.prlist_val)
+ free(client->z.CPS.prlist_val);
+ client->z.CPS.prlist_val = NULL;
+ client->z.CPS.prlist_len = 0;
- client->refCount--;
+ client->z.refCount--;
ReleaseWriteLock(&client->lock);
FreeCE(client);
return NULL;
}
- client->next = host->z.FirstClient;
+ client->z.next = host->z.FirstClient;
host->z.FirstClient = client;
h_Unlock_r(host);
CurrentConnections++; /* increment number of connections */
int
h_ReleaseClient_r(struct client *client)
{
- opr_Assert(client->refCount > 0);
- client->refCount--;
+ opr_Assert(client->z.refCount > 0);
+ client->z.refCount--;
return 0;
}
H_UNLOCK;
return VBUSY;
}
- if (rx_GetConnectionId(tcon) != client->sid
- || rx_GetConnectionEpoch(tcon) != client->VenusEpoch) {
+ if (rx_GetConnectionId(tcon) != client->z.sid
+ || rx_GetConnectionEpoch(tcon) != client->z.VenusEpoch) {
ViceLog(0,
("GetClient: tcon %p tcon sid %d client sid %d\n",
- tcon, rx_GetConnectionId(tcon), client->sid));
+ tcon, rx_GetConnectionId(tcon), client->z.sid));
H_UNLOCK;
return VBUSY;
}
- if (client && client->LastCall > client->expTime && client->expTime) {
+ if (client && client->z.LastCall > client->z.expTime && client->z.expTime) {
ViceLog(1,
("Token for %s at %s:%d expired %d\n", h_UserName(client),
- afs_inet_ntoa_r(client->host->z.host, hoststr),
- ntohs(client->host->z.port), client->expTime));
+ afs_inet_ntoa_r(client->z.host->z.host, hoststr),
+ ntohs(client->z.host->z.port), client->z.expTime));
H_UNLOCK;
return VICETOKENDEAD;
}
- if (client->deleted) {
+ if (client->z.deleted) {
ViceLog(0, ("GetClient: got deleted client, connection will appear "
- "anonymous; tcon %p cid %x client %p ref %d host %p "
- "(%s:%d) href %d ViceId %d\n",
- tcon, rx_GetConnectionId(tcon), client, client->refCount,
- client->host,
- afs_inet_ntoa_r(client->host->z.host, hoststr),
- (int)ntohs(client->host->z.port), client->host->z.refCount,
- (int)client->ViceId));
+ "anonymous; tcon %p cid %x client %p ref %d host %p "
+ "(%s:%d) href %d ViceId %d\n",
+ tcon, rx_GetConnectionId(tcon), client, client->z.refCount,
+ client->z.host,
+ afs_inet_ntoa_r(client->z.host->z.host, hoststr),
+ (int)ntohs(client->z.host->z.port), client->z.host->z.refCount,
+ (int)client->z.ViceId));
}
- client->refCount++;
+ client->z.refCount++;
*cp = client;
H_UNLOCK;
return 0;
}
lnames.namelist_len = 0;
lnames.namelist_val = (prname *) 0;
- lids.idlist_val[0] = client->ViceId;
+ lids.idlist_val[0] = client->z.ViceId;
if (hpr_IdToName(&lids, &lnames)) {
/* We need to free id we alloced above! */
free(lids.idlist_val);
ntohs(host->z.port), (host->z.hostFlags & VENUSDOWN),
tbuffer);
(void)STREAM_WRITE(tmpStr, strlen(tmpStr), 1, file);
- for (client = host->z.FirstClient; client; client = client->next) {
- if (!client->deleted) {
- expTime = client->expTime;
+ for (client = host->z.FirstClient; client; client = client->z.next) {
+ if (!client->z.deleted) {
+ expTime = client->z.expTime;
strftime(tbuffer, sizeof(tbuffer), "%a %b %d %H:%M:%S %Y",
localtime_r(&expTime, &tm));
snprintf(tmpStr, sizeof tmpStr,
" user id=%d, name=%s, sl=%s till %s\n",
- client->ViceId, h_UserName(client),
- client->authClass ? "Authenticated"
+ client->z.ViceId, h_UserName(client),
+ client->z.authClass ? "Authenticated"
: "Not authenticated",
- client->authClass ? tbuffer : "No Limit");
+ client->z.authClass ? tbuffer : "No Limit");
(void)STREAM_WRITE(tmpStr, strlen(tmpStr), 1, file);
snprintf(tmpStr, sizeof tmpStr, " CPS-%d is [",
- client->CPS.prlist_len);
+ client->z.CPS.prlist_len);
(void)STREAM_WRITE(tmpStr, strlen(tmpStr), 1, file);
- if (client->CPS.prlist_val) {
- for (i = 0; i < client->CPS.prlist_len; i++) {
+ if (client->z.CPS.prlist_val) {
+ for (i = 0; i < client->z.CPS.prlist_len; i++) {
snprintf(tmpStr, sizeof tmpStr, " %d",
- client->CPS.prlist_val[i]);
+ client->z.CPS.prlist_val[i]);
(void)STREAM_WRITE(tmpStr, strlen(tmpStr), 1, file);
}
}
#endif
/* Host is held by h_Enumerate_r */
- for (client = host->z.FirstClient; client; client = client->next) {
- if (client->refCount == 0 && client->LastCall < clientdeletetime) {
- client->deleted = 1;
+ for (client = host->z.FirstClient; client; client = client->z.next) {
+ if (client->z.refCount == 0 && client->z.LastCall < clientdeletetime) {
+ client->z.deleted = 1;
host->z.hostFlags |= CLIENTDELETED;
}
}