/* I'm not really worried about when we restarted, I'm */
/* just worried about when the first VBUSY was returned. */
TM_GetTimeOfDay(&restartedat, 0);
+ if (busyonrst) {
+ FS_LOCK;
+ afs_perfstats.fs_nBusies++;
+ FS_UNLOCK;
+ }
return (busyonrst ? VBUSY : VRESTARTING);
} else {
struct timeval now;
TM_GetTimeOfDay(&now, 0);
if ((now.tv_sec - restartedat.tv_sec) < (11 * 60)) {
+ if (busyonrst) {
+ FS_LOCK;
+ afs_perfstats.fs_nBusies++;
+ FS_UNLOCK;
+ }
return (busyonrst ? VBUSY : VRESTARTING);
} else {
return (VRESTARTING);
*anyrights = 0;
}
*rights = 0;
+
+ ObtainWriteLock(&client->lock);
acl_CheckRights(ACL, &client->CPS, rights);
+ ReleaseWriteLock(&client->lock);
/* wait if somebody else is already doing the getCPS call */
H_LOCK;
#endif
} else { /* !VanillaUser(client) && !FetchData */
- osi_audit(PrivilegeEvent, 0, AUD_INT,
+ osi_audit(PrivilegeEvent, 0, AUD_ID,
(client ? client->ViceId : 0), AUD_INT, CallingRoutine,
AUD_END);
}
else if (VanillaUser(client))
return (EPERM); /* Was EACCES */
else
- osi_audit(PrivilegeEvent, 0, AUD_INT,
+ osi_audit(PrivilegeEvent, 0, AUD_ID,
(client ? client->ViceId : 0), AUD_INT,
CallingRoutine, AUD_END);
}
} else {
if (CallingRoutine != CHK_STOREDATA && !VanillaUser(client)) {
- osi_audit(PrivilegeEvent, 0, AUD_INT,
+ osi_audit(PrivilegeEvent, 0, AUD_ID,
(client ? client->ViceId : 0), AUD_INT,
CallingRoutine, AUD_END);
} else {
else if (VanillaUser(client))
return (EPERM); /* Was EACCES */
else
- osi_audit(PrivilegeEvent, 0, AUD_INT,
+ osi_audit(PrivilegeEvent, 0, AUD_ID,
(client ? client->ViceId : 0), AUD_INT,
CallingRoutine, AUD_END);
}
if (VanillaUser(client))
return (EACCES);
else
- osi_audit(PrivSetID, 0, AUD_INT,
+ osi_audit(PrivSetID, 0, AUD_ID,
(client ? client->ViceId : 0), AUD_INT,
CallingRoutine, AUD_END);
}
if (VanillaUser(client))
return (EACCES);
else
- osi_audit(PrivilegeEvent, 0, AUD_INT,
+ osi_audit(PrivilegeEvent, 0, AUD_ID,
(client ? client->ViceId : 0),
AUD_INT, CallingRoutine, AUD_END);
}
("DT: inode=%s, name=%s, errno=%d\n",
PrintInode(NULL, VN_GET_INO(*targetptr)), Name,
errno));
-#ifdef AFS_DEC_ENV
- if ((errno != ENOENT) && (errno != EIO) && (errno != ENXIO))
-#else
if (errno != ENOENT)
-#endif
{
ViceLog(0,
("Volume %u now offline, must be salvaged.\n",
targetptr->disk.modeBits = modebits;
switch (Caller) {
case TVS_SDATA:
- osi_audit(PrivSetID, 0, AUD_INT, client->ViceId, AUD_INT,
+ osi_audit(PrivSetID, 0, AUD_ID, client->ViceId, AUD_INT,
CHK_STOREDATA, AUD_END);
break;
case TVS_CFILE:
case TVS_SSTATUS:
- osi_audit(PrivSetID, 0, AUD_INT, client->ViceId, AUD_INT,
+ osi_audit(PrivSetID, 0, AUD_ID, client->ViceId, AUD_INT,
CHK_STORESTATUS, AUD_END);
break;
default:
}
strcpy(*motd, V_motd(volptr));
#endif /* FS_STATS_DETAILED */
-
+ return 0;
} /*RXGetVolumeStatus */
struct client *client; /* pointer to the client data */
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 client *t_client = NULL; /* tmp ptr to client data */
struct in_addr logHostAddr; /* host ip holder for inet_ntoa */
#if FS_STATS_DETAILED
struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */
}
#endif /* FS_STATS_DETAILED */
- osi_auditU(acall, FetchDataEvent, errorCode, AUD_FID, Fid, AUD_END);
+ osi_auditU(acall, FetchDataEvent, errorCode,
+ AUD_ID, t_client ? t_client->ViceId : 0,
+ AUD_FID, Fid, AUD_END);
return (errorCode);
} /*SRXAFS_FetchData */
afs_int32 Len, struct AFSFetchStatus * OutStatus,
struct AFSCallBack * CallBack, struct AFSVolSync * Sync)
{
- int code;
-
- code =
- common_FetchData64(acall, Fid, Pos, Len, OutStatus, CallBack, Sync,
- 0);
- return code;
+ return common_FetchData64(acall, Fid, Pos, Len, OutStatus, CallBack,
+ Sync, 0);
}
afs_int32
#ifdef AFS_64BIT_ENV
#ifndef AFS_LARGEFILE_ENV
if (Pos + Len > 0x7fffffff)
- return E2BIG;
+ return EFBIG;
#endif /* !AFS_LARGEFILE_ENV */
tPos = (afs_sfsize_t) Pos;
tLen = (afs_sfsize_t) Len;
#else /* AFS_64BIT_ENV */
if (Pos.high || Len.high)
- return E2BIG;
+ return EFBIG;
tPos = Pos.low;
tLen = Len.low;
#endif /* AFS_64BIT_ENV */
struct client *client; /* pointer to the client data */
afs_int32 rights, anyrights; /* rights for this and any user */
struct rx_connection *tcon = rx_ConnectionOf(acall);
- struct client *t_client; /* tmp ptr to client data */
+ struct client *t_client = NULL; /* tmp ptr to client data */
struct in_addr logHostAddr; /* host ip holder for inet_ntoa */
#if FS_STATS_DETAILED
struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */
}
#endif /* FS_STATS_DETAILED */
- osi_auditU(acall, FetchACLEvent, errorCode, AUD_FID, Fid, AUD_END);
+ osi_auditU(acall, FetchACLEvent, errorCode,
+ AUD_ID, t_client ? t_client->ViceId : 0,
+ AUD_FID, Fid, AUD_END);
return errorCode;
} /*SRXAFS_FetchACL */
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 client *t_client; /* tmp ptr to client data */
+ struct client *t_client = NULL; /* tmp ptr to client data */
struct in_addr logHostAddr; /* host ip holder for inet_ntoa */
struct rx_connection *tcon = rx_ConnectionOf(acall);
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 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 */
struct timeval opStartTime, opStopTime; /* Start/stop times for RPC op */
volptr);
errorCode = CallPostamble(tcon, errorCode);
+ t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
+
#if FS_STATS_DETAILED
TM_GetTimeOfDay(&opStopTime, 0);
if (errorCode == 0) {
Audit_and_Return:
ViceLog(2, ("SAFS_BulkStatus returns %d\n", errorCode));
- osi_auditU(acall, BulkFetchStatusEvent, errorCode, AUD_FIDS, Fids,
- AUD_END);
+ osi_auditU(acall, BulkFetchStatusEvent, errorCode,
+ AUD_ID, t_client ? t_client->ViceId : 0,
+ AUD_FIDS, Fids, AUD_END);
return errorCode;
} /*SRXAFS_BulkStatus */
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 client *t_client = NULL; /* tmp ptr to client data */
AFSFetchStatus *tstatus;
#if FS_STATS_DETAILED
struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */
&rights, &anyrights))) {
tstatus = &OutStats->AFSBulkStats_val[i];
tstatus->errorCode = errorCode;
+ PutVolumePackage(parentwhentargetnotdir, targetptr, (Vnode *) 0, volptr);
parentwhentargetnotdir = (Vnode *) 0;
targetptr = (Vnode *) 0;
volptr = (Volume *) 0;
volptr);
errorCode = CallPostamble(tcon, errorCode);
+ t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
+
#if FS_STATS_DETAILED
TM_GetTimeOfDay(&opStopTime, 0);
if (errorCode == 0) {
Audit_and_Return:
ViceLog(2, ("SAFS_InlineBulkStatus returns %d\n", errorCode));
- osi_auditU(acall, InlineBulkFetchStatusEvent, errorCode, AUD_FIDS, Fids,
- AUD_END);
+ osi_auditU(acall, InlineBulkFetchStatusEvent, errorCode,
+ AUD_ID, t_client ? t_client->ViceId : 0,
+ AUD_FIDS, Fids, AUD_END);
return 0;
} /*SRXAFS_InlineBulkStatus */
{
afs_int32 code;
struct rx_connection *tcon;
+ 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 */
struct timeval opStartTime, opStopTime; /* Start/stop times for RPC op */
Bad_FetchStatus:
code = CallPostamble(tcon, code);
+ t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
+
#if FS_STATS_DETAILED
TM_GetTimeOfDay(&opStopTime, 0);
if (code == 0) {
}
#endif /* FS_STATS_DETAILED */
- osi_auditU(acall, FetchStatusEvent, code, AUD_FID, Fid, AUD_END);
+ osi_auditU(acall, FetchStatusEvent, code,
+ AUD_ID, t_client ? t_client->ViceId : 0,
+ AUD_FID, Fid, AUD_END);
return code;
} /*SRXAFS_FetchStatus */
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 client *t_client; /* tmp ptr to client data */
+ struct client *t_client = NULL; /* tmp ptr to client data */
struct in_addr logHostAddr; /* host ip holder for inet_ntoa */
struct rx_connection *tcon;
#if FS_STATS_DETAILED
FS_UNLOCK;
}
#endif /* FS_STATS_DETAILED */
-
- osi_auditU(acall, StoreDataEvent, errorCode, AUD_FID, Fid, AUD_END);
+ osi_auditU(acall, StoreDataEvent, errorCode,
+ AUD_ID, t_client ? t_client->ViceId : 0,
+ AUD_FID, Fid, AUD_END);
return (errorCode);
-
} /*common_StoreData64 */
afs_int32
afs_uint32 Length, afs_uint32 FileLength,
struct AFSFetchStatus * OutStatus, struct AFSVolSync * Sync)
{
- int code;
-
- code =
- common_StoreData64(acall, Fid, InStatus, Pos, Length, FileLength,
- OutStatus, Sync);
- return code;
-
+ return common_StoreData64(acall, Fid, InStatus, Pos, Length, FileLength,
+ OutStatus, Sync);
} /*SRXAFS_StoreData */
afs_int32
#ifdef AFS_64BIT_ENV
#ifndef AFS_LARGEFILE_ENV
if (FileLength > 0x7fffffff)
- return E2BIG;
+ return EFBIG;
#endif /* !AFS_LARGEFILE_ENV */
tPos = (afs_fsize_t) Pos;
tLength = (afs_fsize_t) Length;
tFileLength = (afs_fsize_t) FileLength;
#else /* AFS_64BIT_ENV */
if (FileLength.high)
- return E2BIG;
+ return EFBIG;
tPos = Pos.low;
tLength = Length.low;
tFileLength = FileLength.low;
struct client *client; /* pointer to client structure */
afs_int32 rights, anyrights; /* rights for this and any user */
struct rx_connection *tcon;
- struct client *t_client; /* tmp ptr to client data */
+ struct client *t_client = NULL; /* tmp ptr to client data */
struct in_addr logHostAddr; /* host ip holder for inet_ntoa */
#if FS_STATS_DETAILED
struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */
}
#endif /* FS_STATS_DETAILED */
- osi_auditU(acall, StoreACLEvent, errorCode, AUD_FID, Fid, AUD_END);
+ osi_auditU(acall, StoreACLEvent, errorCode,
+ AUD_ID, t_client ? t_client->ViceId : 0,
+ AUD_FID, Fid, AUD_ACL, AccessList->AFSOpaque_val, AUD_END);
return errorCode;
} /*SRXAFS_StoreACL */
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 client *t_client; /* tmp ptr to client data */
+ struct client *t_client = NULL; /* tmp ptr to client data */
struct in_addr logHostAddr; /* host ip holder for inet_ntoa */
struct rx_connection *tcon = rx_ConnectionOf(acall);
{
afs_int32 code;
struct rx_connection *tcon;
+ 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 */
struct timeval opStartTime, opStopTime; /* Start/stop times for RPC op */
Bad_StoreStatus:
code = CallPostamble(tcon, code);
+ t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
+
#if FS_STATS_DETAILED
TM_GetTimeOfDay(&opStopTime, 0);
if (code == 0) {
}
#endif /* FS_STATS_DETAILED */
- osi_auditU(acall, StoreStatusEvent, code, AUD_FID, Fid, AUD_END);
+ osi_auditU(acall, StoreStatusEvent, code,
+ AUD_ID, t_client ? t_client->ViceId : 0,
+ AUD_FID, Fid, AUD_END);
return code;
} /*SRXAFS_StoreStatus */
{
afs_int32 code;
struct rx_connection *tcon;
+ 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 */
struct timeval opStartTime, opStopTime; /* Start/stop times for RPC op */
Bad_RemoveFile:
code = CallPostamble(tcon, code);
+ t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
+
#if FS_STATS_DETAILED
TM_GetTimeOfDay(&opStopTime, 0);
if (code == 0) {
}
#endif /* FS_STATS_DETAILED */
- osi_auditU(acall, RemoveFileEvent, code, AUD_FID, DirFid, AUD_STR, Name,
- AUD_END);
+ osi_auditU(acall, RemoveFileEvent, code,
+ AUD_ID, t_client ? t_client->ViceId : 0,
+ AUD_FID, DirFid, AUD_STR, Name, AUD_END);
return code;
} /*SRXAFS_RemoveFile */
Update_TargetVnodeStatus(targetptr, TVS_CFILE, client, InStatus,
parentptr, volptr, 0);
- /* set up the return status for the parent dir and the newly created file */
- GetStatus(targetptr, OutFidStatus, rights, anyrights, parentptr);
+ /* set up the return status for the parent dir and the newly created file, and since the newly created file is owned by the creator, give it PRSFS_ADMINISTER to tell the client its the owner of the file */
+ GetStatus(targetptr, OutFidStatus, rights | PRSFS_ADMINISTER, anyrights, parentptr);
GetStatus(parentptr, OutDirStatus, rights, anyrights, 0);
/* convert the write lock to a read lock before breaking callbacks */
{
afs_int32 code;
struct rx_connection *tcon;
+ 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 */
struct timeval opStartTime, opStopTime; /* Start/stop times for RPC op */
Bad_CreateFile:
code = CallPostamble(tcon, code);
+ t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
+
#if FS_STATS_DETAILED
TM_GetTimeOfDay(&opStopTime, 0);
if (code == 0) {
}
#endif /* FS_STATS_DETAILED */
- osi_auditU(acall, CreateFileEvent, code, AUD_FID, DirFid, AUD_STR, Name,
- AUD_END);
+ osi_auditU(acall, CreateFileEvent, code,
+ AUD_ID, t_client ? t_client->ViceId : 0,
+ AUD_FID, DirFid, AUD_STR, Name, AUD_END);
return code;
} /*SRXAFS_CreateFile */
{
afs_int32 code;
struct rx_connection *tcon;
+ 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 */
struct timeval opStartTime, opStopTime; /* Start/stop times for RPC op */
Bad_Rename:
code = CallPostamble(tcon, code);
+ t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
+
#if FS_STATS_DETAILED
TM_GetTimeOfDay(&opStopTime, 0);
if (code == 0) {
}
#endif /* FS_STATS_DETAILED */
- osi_auditU(acall, RenameFileEvent, code, AUD_FID, OldDirFid, AUD_STR,
- OldName, AUD_FID, NewDirFid, AUD_STR, NewName, AUD_END);
+ 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);
return code;
} /*SRXAFS_Rename */
{
afs_int32 code;
struct rx_connection *tcon;
+ 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 */
struct timeval opStartTime, opStopTime; /* Start/stop times for RPC op */
Bad_Symlink:
code = CallPostamble(tcon, code);
+ t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
+
#if FS_STATS_DETAILED
TM_GetTimeOfDay(&opStopTime, 0);
if (code == 0) {
}
#endif /* FS_STATS_DETAILED */
- osi_auditU(acall, SymlinkEvent, code, AUD_FID, DirFid, AUD_STR, Name,
- AUD_END);
+ osi_auditU(acall, SymlinkEvent, code,
+ AUD_ID, t_client ? t_client->ViceId : 0,
+ AUD_FID, DirFid, AUD_STR, Name,
+ AUD_FID, OutFid, AUD_STR, LinkContents, AUD_END);
return code;
} /*SRXAFS_Symlink */
{
afs_int32 code;
struct rx_connection *tcon;
+ 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 */
struct timeval opStartTime, opStopTime; /* Start/stop times for RPC op */
Bad_Link:
code = CallPostamble(tcon, code);
+ t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
+
#if FS_STATS_DETAILED
TM_GetTimeOfDay(&opStopTime, 0);
if (code == 0) {
}
#endif /* FS_STATS_DETAILED */
- osi_auditU(acall, LinkEvent, code, AUD_FID, DirFid, AUD_STR, Name,
+ osi_auditU(acall, LinkEvent, code,
+ AUD_ID, t_client ? t_client->ViceId : 0,
+ AUD_FID, DirFid, AUD_STR, Name,
AUD_FID, ExistingFid, AUD_END);
return code;
{
afs_int32 code;
struct rx_connection *tcon;
+ 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 */
struct timeval opStartTime, opStopTime; /* Start/stop times for RPC op */
Bad_MakeDir:
code = CallPostamble(tcon, code);
+ t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
+
#if FS_STATS_DETAILED
TM_GetTimeOfDay(&opStopTime, 0);
if (code == 0) {
}
#endif /* FS_STATS_DETAILED */
- osi_auditU(acall, MakeDirEvent, code, AUD_FID, DirFid, AUD_STR, Name,
- AUD_END);
+ osi_auditU(acall, MakeDirEvent, code,
+ AUD_ID, t_client ? t_client->ViceId : 0,
+ AUD_FID, DirFid, AUD_STR, Name,
+ AUD_FID, OutFid, AUD_END);
return code;
} /*SRXAFS_MakeDir */
{
afs_int32 code;
struct rx_connection *tcon;
+ 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 */
struct timeval opStartTime, opStopTime; /* Start/stop times for RPC op */
Bad_RemoveDir:
code = CallPostamble(tcon, code);
+ t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
+
#if FS_STATS_DETAILED
TM_GetTimeOfDay(&opStopTime, 0);
if (code == 0) {
}
#endif /* FS_STATS_DETAILED */
- osi_auditU(acall, RemoveDirEvent, code, AUD_FID, DirFid, AUD_STR, Name,
- AUD_END);
+ osi_auditU(acall, RemoveDirEvent, code,
+ AUD_ID, t_client ? t_client->ViceId : 0,
+ AUD_FID, DirFid, AUD_STR, Name, AUD_END);
return code;
} /*SRXAFS_RemoveDir */
ViceLockType type, struct AFSVolSync * Sync)
{
return SRXAFS_SetLock(acall, Fid, type, Sync);
-
} /*SRXAFS_OldSetLock */
{
afs_int32 code;
struct rx_connection *tcon;
+ 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 */
struct timeval opStartTime, opStopTime; /* Start/stop times for RPC op */
Bad_SetLock:
code = CallPostamble(tcon, code);
+ t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
+
#if FS_STATS_DETAILED
TM_GetTimeOfDay(&opStopTime, 0);
if (code == 0) {
}
#endif /* FS_STATS_DETAILED */
- osi_auditU(acall, SetLockEvent, code, AUD_FID, Fid, AUD_LONG, type,
- AUD_END);
+ osi_auditU(acall, SetLockEvent, code,
+ AUD_ID, t_client ? t_client->ViceId : 0,
+ AUD_FID, Fid, AUD_LONG, type, AUD_END);
return code;
-
} /*SRXAFS_SetLock */
struct AFSVolSync * Sync)
{
return SRXAFS_ExtendLock(acall, Fid, Sync);
-
} /*SRXAFS_OldExtendLock */
{
afs_int32 code;
struct rx_connection *tcon;
+ 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 */
struct timeval opStartTime, opStopTime; /* Start/stop times for RPC op */
Bad_ExtendLock:
code = CallPostamble(tcon, code);
+ t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
+
#if FS_STATS_DETAILED
TM_GetTimeOfDay(&opStopTime, 0);
if (code == 0) {
}
#endif /* FS_STATS_DETAILED */
- osi_auditU(acall, ExtendLockEvent, code, AUD_FID, Fid, AUD_END);
+ osi_auditU(acall, ExtendLockEvent, code,
+ AUD_ID, t_client ? t_client->ViceId : 0,
+ AUD_FID, Fid, AUD_END);
return code;
} /*SRXAFS_ExtendLock */
struct AFSVolSync * Sync)
{
return SRXAFS_ReleaseLock(acall, Fid, Sync);
-
} /*SRXAFS_OldReleaseLock */
{
afs_int32 code;
struct rx_connection *tcon;
+ 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 */
struct timeval opStartTime, opStopTime; /* Start/stop times for RPC op */
Bad_ReleaseLock:
code = CallPostamble(tcon, code);
+ t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
+
#if FS_STATS_DETAILED
TM_GetTimeOfDay(&opStopTime, 0);
if (code == 0) {
}
#endif /* FS_STATS_DETAILED */
- osi_auditU(acall, ReleaseLockEvent, code, AUD_FID, Fid, AUD_END);
+ osi_auditU(acall, ReleaseLockEvent, code,
+ AUD_ID, t_client ? t_client->ViceId : 0,
+ AUD_FID, Fid, AUD_END);
return code;
} /*SRXAFS_ReleaseLock */
SRXAFS_GetStatistics(struct rx_call *acall, struct ViceStatistics *Statistics)
{
afs_int32 code;
- struct rx_connection *tcon;
+ struct rx_connection *tcon = rx_ConnectionOf(acall);
+ 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 */
struct timeval opStartTime, opStopTime; /* Start/stop times for RPC op */
Bad_GetStatistics:
code = CallPostamble(tcon, code);
+ t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
+
#if FS_STATS_DETAILED
TM_GetTimeOfDay(&opStopTime, 0);
if (code == 0) {
}
#endif /* FS_STATS_DETAILED */
+ osi_auditU(acall, GetStatisticsEvent, code,
+ AUD_ID, t_client ? t_client->ViceId : 0, AUD_END);
return code;
-
} /*SRXAFS_GetStatistics */
SRXAFS_XStatsVersion(struct rx_call * a_call, afs_int32 * a_versionP)
{ /*SRXAFS_XStatsVersion */
+ struct client *t_client = NULL; /* tmp ptr to client data */
+ struct rx_connection *tcon;
#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 */
*a_versionP = AFS_XSTAT_VERSION;
+ t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
+
#if FS_STATS_DETAILED
TM_GetTimeOfDay(&opStopTime, 0);
fs_stats_GetDiff(elapsedTime, opStartTime, opStopTime);
(opP->numSuccesses)++;
FS_UNLOCK;
#endif /* FS_STATS_DETAILED */
- return (0);
+ osi_auditU(a_call, XStatsVersionEvent, 0,
+ AUD_ID, t_client ? t_client->ViceId : 0, AUD_END);
+ return (0);
} /*SRXAFS_XStatsVersion */
a_perfP->host_ClientBlocks = CEBlocks;
a_perfP->sysname_ID = afs_perfstats.sysname_ID;
-
+ a_perfP->rx_nBusies = (afs_int32) rx_stats.nBusies;
+ a_perfP->fs_nBusies = afs_perfstats.fs_nBusies;
} /*FillPerfValues */
for (i = 0; i < nids; i++, vd++) {
if (!*vd)
continue;
- client = h_ID2Client(*vd); /* returns client locked, or NULL */
+ client = h_ID2Client(*vd); /* returns client write locked, or NULL */
if (!client)
continue;
- BoostSharedLock(&client->lock);
client->prfail = 2; /* Means re-eval client's cps */
#ifdef notdef
if (client->tcon) {
afs_int32 rights, anyrights; /* rights for this and any user */
AFSFid dummyFid;
struct rx_connection *tcon;
+ 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 */
struct timeval opStartTime, opStopTime; /* Start/stop times for RPC op */
}
errorCode = CallPostamble(tcon, errorCode);
+ t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
+
#if FS_STATS_DETAILED
TM_GetTimeOfDay(&opStopTime, 0);
if (errorCode == 0) {
FS_UNLOCK;
}
#endif /* FS_STATS_DETAILED */
+
+ osi_auditU(acall, GetVolumeStatusEvent, errorCode,
+ AUD_ID, t_client ? t_client->ViceId : 0,
+ AUD_LONG, avolid, AUD_STR, *Name, AUD_END);
return (errorCode);
} /*SRXAFS_GetVolumeStatus */
afs_int32 rights, anyrights; /* rights for this and any user */
AFSFid dummyFid;
struct rx_connection *tcon = rx_ConnectionOf(acall);
+ 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 */
struct timeval opStartTime, opStopTime; /* Start/stop times for RPC op */
ViceLog(2, ("SAFS_SetVolumeStatus returns %d\n", errorCode));
errorCode = CallPostamble(tcon, errorCode);
+ t_client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
+
#if FS_STATS_DETAILED
TM_GetTimeOfDay(&opStopTime, 0);
if (errorCode == 0) {
}
#endif /* FS_STATS_DETAILED */
- osi_auditU(acall, SetVolumeStatusEvent, errorCode, AUD_LONG, avolid,
- AUD_STR, Name, AUD_END);
+ osi_auditU(acall, SetVolumeStatusEvent, errorCode,
+ AUD_ID, t_client ? t_client->ViceId : 0,
+ AUD_LONG, avolid, AUD_STR, Name, AUD_END);
return (errorCode);
-
} /*SRXAFS_SetVolumeStatus */
#define DEFAULTVOLUME "root.afs"
FDH_CLOSE(fdP);
return EIO;
}
+ if (Pos > tlen) {
+ Len = 0;
+ }
if (Pos + Len > tlen)
Len = tlen - Pos; /* get length we should send */
{
afs_int32 high, low;
SplitOffsetOrSize(Len, high, low);
- assert(Int64Mode || high == 0);
+ assert(Int64Mode || (Len >= 0 && high == 0) || Len < 0);
if (Int64Mode) {
high = htonl(high);
rx_Write(Call, (char *)&high, sizeof(afs_int32)); /* High order bits */
}
afs_int32
+SRXAFS_CallBackRxConnAddr (struct rx_call * acall, afs_int32 *addr)
+{
+ Error errorCode = 0;
+ struct host *thost;
+ struct client *tclient;
+ static struct rx_securityClass *sc = 0;
+ int i,j;
+ struct rx_connection *tcon;
+ struct rx_connection *conn;
+
+ if (errorCode = CallPreamble(acall, ACTIVECALL, &tcon))
+ goto Bad_CallBackRxConnAddr1;
+
+#ifndef __EXPERIMENTAL_CALLBACK_CONN_MOVING
+ errorCode = 1;
+#else
+ H_LOCK;
+ tclient = h_FindClient_r(tcon);
+ thost = tclient->host;
+
+ /* nothing more can be done */
+ if ( !thost->interface )
+ goto Bad_CallBackRxConnAddr;
+
+ assert(thost->interface->numberOfInterfaces > 0 );
+
+ /* the only address is the primary interface */
+ /* can't change when there's only 1 address, anyway */
+ if ( thost->interface->numberOfInterfaces == 1 )
+ goto Bad_CallBackRxConnAddr;
+
+ /* initialise a security object only once */
+ if ( !sc )
+ sc = (struct rx_securityClass *) rxnull_NewClientSecurityObject();
+
+ for ( i=0; i < thost->interface->numberOfInterfaces; i++)
+ {
+ if ( *addr == thost->interface->addr[i] ) {
+ break;
+ }
+ }
+
+ if ( *addr != thost->interface->addr[i] )
+ goto Bad_CallBackRxConnAddr;
+
+ conn = rx_NewConnection (thost->interface->addr[i],
+ thost->port, 1, sc, 0);
+ rx_SetConnDeadTime(conn, 2);
+ rx_SetConnHardDeadTime(conn, AFS_HARDDEADTIME);
+ H_UNLOCK;
+ errorCode = RXAFSCB_Probe(conn);
+ H_LOCK;
+ if (!errorCode) {
+ if ( thost->callback_rxcon )
+ rx_DestroyConnection(thost->callback_rxcon);
+ thost->callback_rxcon = conn;
+ thost->host = addr;
+ rx_SetConnDeadTime(thost->callback_rxcon, 50);
+ rx_SetConnHardDeadTime(thost->callback_rxcon, AFS_HARDDEADTIME);
+ H_UNLOCK;
+ errorCode = CallPostamble(tcon, errorCode);
+ return errorCode;
+ } else {
+ rx_DestroyConnection(conn);
+ }
+ Bad_CallBackRxConnAddr:
+ H_UNLOCK;
+#endif
+
+ errorCode = CallPostamble(tcon, errorCode);
+ Bad_CallBackRxConnAddr1:
+ return errorCode; /* failure */
+}
+
+afs_int32
sys_error_to_et(afs_int32 in)
{
if (in == 0)