#endif
#endif /* AFS_HPUX_ENV */
-#include <rx/xdr.h>
+#include <afs/opr.h>
#include <afs/nfs.h>
#include <lwp.h>
#include <lock.h>
code = hpr_Initialize(&uclient);
if (!code)
- osi_Assert(pthread_setspecific(viced_uclient_key, (void *)uclient) == 0);
+ opr_Verify(pthread_setspecific(viced_uclient_key,
+ (void *)uclient) == 0);
H_LOCK;
if (code) {
*volptr = VGetVolumeWithCall(&local_errorCode, &errorCode,
fid->Volume, ts, cbv);
if (!errorCode) {
- osi_Assert(*volptr);
+ opr_Assert(*volptr);
break;
}
if ((errorCode == VOFFLINE) && (VInit < 2)) {
return (errorCode);
}
}
- osi_Assert(*volptr);
+ opr_Assert(*volptr);
/* get the vnode */
*vptr = VGetVnode(&errorCode, *volptr, fid->Vnode, lock);
return (errorCode);
if ((*vptr)->disk.uniquifier != fid->Unique) {
VPutVnode(&fileCode, *vptr);
- osi_Assert(fileCode == 0);
+ opr_Assert(fileCode == 0);
*vptr = 0;
return (VNOVNODE); /* return the right error code, at least */
}
*ACLSize = VAclSize(*targetptr);
return (0);
} else {
- osi_Assert(Fid != 0);
+ opr_Assert(Fid != 0);
while (1) {
VnodeId parentvnode;
Error errorCode = 0;
(chkforDir == MustBeDIR ? 0 : locktype))) != 0)
goto gvpdone;
if (chkforDir == MustBeDIR)
- osi_Assert((*parent) == 0);
+ opr_Assert((*parent) == 0);
if (!(*client)) {
if ((errorCode = GetClient(tcon, client)) != 0)
goto gvpdone;
rx_KeepAliveOff(acall);
if (parentwhentargetnotdir) {
VPutVnode(&fileCode, parentwhentargetnotdir);
- osi_Assert(!fileCode || (fileCode == VSALVAGE));
+ opr_Assert(!fileCode || (fileCode == VSALVAGE));
}
if (targetptr) {
VPutVnode(&fileCode, targetptr);
- osi_Assert(!fileCode || (fileCode == VSALVAGE));
+ opr_Assert(!fileCode || (fileCode == VSALVAGE));
}
if (parentptr) {
VPutVnode(&fileCode, parentptr);
- osi_Assert(!fileCode || (fileCode == VSALVAGE));
+ opr_Assert(!fileCode || (fileCode == VSALVAGE));
}
if (volptr) {
VPutVolumeWithCall(volptr, cbv);
}
IH_INIT(newH, V_device(volptr), V_id(volptr), ino);
newFdP = IH_OPEN(newH);
- osi_Assert(newFdP != NULL);
+ opr_Assert(newFdP != NULL);
done = off;
while (size > 0) {
FDH_REALLYCLOSE(targFdP);
rc = IH_DEC(V_linkHandle(volptr), VN_GET_INO(targetptr),
V_parentId(volptr));
- osi_Assert(!rc);
+ opr_Assert(!rc);
IH_RELEASE(targetptr->handle);
rc = FDH_SYNC(newFdP);
- osi_Assert(rc == 0);
+ opr_Assert(rc == 0);
FDH_CLOSE(newFdP);
targetptr->handle = newH;
VN_SET_INO(targetptr, ino);
* slot this operation belongs, and bump the appropriate slot.
*/
now = time(NULL);
- currDate = (time(NULL) - parentptr->disk.unixModifyTime);
+ currDate = (now - parentptr->disk.unixModifyTime);
timeIdx =
(currDate < VOL_STATS_TIME_CAP_0 ? VOL_STATS_TIME_IDX_0 : currDate <
VOL_STATS_TIME_CAP_1 ? VOL_STATS_TIME_IDX_1 : currDate <
parentptr->disk.author = author;
parentptr->disk.linkCount = linkcount;
- parentptr->disk.unixModifyTime = time(NULL); /* This should be set from CLIENT!! */
- parentptr->disk.serverModifyTime = time(NULL);
+ parentptr->disk.unixModifyTime = now; /* This should be set from CLIENT!! */
+ parentptr->disk.serverModifyTime = now;
parentptr->changed_newTime = 1; /* vnode changed, write it back. */
}
if (parentwhentargetnotdir != NULL) {
tparentwhentargetnotdir = *parentwhentargetnotdir;
VPutVnode(&fileCode, parentwhentargetnotdir);
- osi_Assert(!fileCode || (fileCode == VSALVAGE));
+ opr_Assert(!fileCode || (fileCode == VSALVAGE));
parentwhentargetnotdir = NULL;
}
rx_KeepAliveOff(acall);
VPutVnode(&fileCode, parentwhentargetnotdir);
rx_KeepAliveOn(acall);
- osi_Assert(!fileCode || (fileCode == VSALVAGE));
+ opr_Assert(!fileCode || (fileCode == VSALVAGE));
parentwhentargetnotdir = NULL;
}
/* convert the write lock to a read lock before breaking callbacks */
VVnodeWriteToRead(&errorCode, targetptr);
- osi_Assert(!errorCode || errorCode == VSALVAGE);
+ opr_Assert(!errorCode || errorCode == VSALVAGE);
rx_KeepAliveOn(acall);
/* convert the write lock to a read lock before breaking callbacks */
VVnodeWriteToRead(&errorCode, targetptr);
- osi_Assert(!errorCode || errorCode == VSALVAGE);
+ opr_Assert(!errorCode || errorCode == VSALVAGE);
/* Break call backs on Fid */
BreakCallBack(client->host, Fid, 0);
DeleteFileCallBacks(&fileFid);
/* convert the parent lock to a read lock before breaking callbacks */
VVnodeWriteToRead(&errorCode, parentptr);
- osi_Assert(!errorCode || errorCode == VSALVAGE);
+ opr_Assert(!errorCode || errorCode == VSALVAGE);
} else {
/* convert the parent lock to a read lock before breaking callbacks */
VVnodeWriteToRead(&errorCode, parentptr);
- osi_Assert(!errorCode || errorCode == VSALVAGE);
+ opr_Assert(!errorCode || errorCode == VSALVAGE);
/* convert the target lock to a read lock before breaking callbacks */
VVnodeWriteToRead(&errorCode, targetptr);
- osi_Assert(!errorCode || errorCode == VSALVAGE);
+ opr_Assert(!errorCode || errorCode == VSALVAGE);
/* tell all the file has changed */
BreakCallBack(client->host, &fileFid, 1);
}
/* convert the write lock to a read lock before breaking callbacks */
VVnodeWriteToRead(&errorCode, parentptr);
- osi_Assert(!errorCode || errorCode == VSALVAGE);
+ opr_Assert(!errorCode || errorCode == VSALVAGE);
/* break call back on parent dir */
BreakCallBack(client->host, DirFid, 0);
}
if (testnode == 1) top = 1;
testvptr = VGetVnode(&errorCode, volptr, testnode, READ_LOCK);
- osi_Assert(errorCode == 0);
+ opr_Assert(errorCode == 0);
testnode = testvptr->disk.parent;
VPutVnode(&errorCode, testvptr);
if ((top == 1) && (testnode != 0)) {
errorCode = EIO;
goto Bad_Rename;
}
- osi_Assert(errorCode == 0);
+ opr_Assert(errorCode == 0);
}
}
if (newfileptr) {
/* Delete NewName from its directory */
code = afs_dir_Delete(&newdir, NewName);
- osi_Assert(code == 0);
+ opr_Assert(code == 0);
/* Drop the link count */
newfileptr->disk.linkCount--;
goto Bad_Rename;
/* Delete the old name */
- osi_Assert(afs_dir_Delete(&olddir, OldName) == 0);
+ 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,
/* if we are dealing with a rename of a directory, and we need to
* update the .. entry of that directory */
if (updatefile) {
- osi_Assert(!fileptr->disk.cloned);
+ opr_Assert(!fileptr->disk.cloned);
fileptr->changed_newTime = 1; /* status change of moved file */
/* fix .. to point to the correct place */
afs_dir_Delete(&filedir, ".."); /* No assert--some directories may be bad */
- osi_Assert(afs_dir_Create(&filedir, "..", NewDirFid) == 0);
+ opr_Assert(afs_dir_Create(&filedir, "..", NewDirFid) == 0);
fileptr->disk.dataVersion++;
/* if the parent directories are different the link counts have to be */
/* convert the write locks to a read locks before breaking callbacks */
VVnodeWriteToRead(&errorCode, newvptr);
- osi_Assert(!errorCode || errorCode == VSALVAGE);
+ opr_Assert(!errorCode || errorCode == VSALVAGE);
if (oldvptr != newvptr) {
VVnodeWriteToRead(&errorCode, oldvptr);
- osi_Assert(!errorCode || errorCode == VSALVAGE);
+ opr_Assert(!errorCode || errorCode == VSALVAGE);
}
if (newfileptr && !doDelete) {
/* convert the write lock to a read lock before breaking callbacks */
VVnodeWriteToRead(&errorCode, newfileptr);
- osi_Assert(!errorCode || errorCode == VSALVAGE);
+ opr_Assert(!errorCode || errorCode == VSALVAGE);
}
rx_KeepAliveOn(acall);
if (newfileptr) {
rx_KeepAliveOff(acall);
VPutVnode(&fileCode, newfileptr);
- osi_Assert(fileCode == 0);
+ opr_Assert(fileCode == 0);
}
(void)PutVolumePackage(acall, fileptr, (newvptr && newvptr != oldvptr ?
newvptr : 0), oldvptr, volptr, &client);
/* convert the write lock to a read lock before breaking callbacks */
VVnodeWriteToRead(&errorCode, parentptr);
- osi_Assert(!errorCode || errorCode == VSALVAGE);
+ opr_Assert(!errorCode || errorCode == VSALVAGE);
rx_KeepAliveOn(acall);
/* convert the write locks to read locks before breaking callbacks */
VVnodeWriteToRead(&errorCode, targetptr);
- osi_Assert(!errorCode || errorCode == VSALVAGE);
+ opr_Assert(!errorCode || errorCode == VSALVAGE);
VVnodeWriteToRead(&errorCode, parentptr);
- osi_Assert(!errorCode || errorCode == VSALVAGE);
+ opr_Assert(!errorCode || errorCode == VSALVAGE);
rx_KeepAliveOn(acall);
client->InSameNetwork);
/* Point to target's ACL buffer and copy the parent's ACL contents to it */
- osi_Assert((SetAccessList
- (&targetptr, &volptr, &newACL, &newACLSize,
- &parentwhentargetnotdir, (AFSFid *) 0, 0)) == 0);
- osi_Assert(parentwhentargetnotdir == 0);
+ opr_Verify((SetAccessList(&targetptr, &volptr, &newACL, &newACLSize,
+ &parentwhentargetnotdir, NULL, 0)) == 0);
+ opr_Assert(parentwhentargetnotdir == 0);
memcpy((char *)newACL, (char *)VVnodeACL(parentptr), VAclSize(parentptr));
/* update the status for the target vnode */
/* Actually create the New directory in the directory package */
SetDirHandle(&dir, targetptr);
- osi_Assert(!(afs_dir_MakeDir(&dir, (afs_int32 *)OutFid, (afs_int32 *)DirFid)));
+ opr_Verify(!(afs_dir_MakeDir(&dir, (afs_int32 *)OutFid,
+ (afs_int32 *)DirFid)));
DFlush();
VN_SET_LEN(targetptr, (afs_fsize_t) afs_dir_Length(&dir));
/* convert the write lock to a read lock before breaking callbacks */
VVnodeWriteToRead(&errorCode, parentptr);
- osi_Assert(!errorCode || errorCode == VSALVAGE);
+ opr_Assert(!errorCode || errorCode == VSALVAGE);
rx_KeepAliveOn(acall);
/* convert the write lock to a read lock before breaking callbacks */
VVnodeWriteToRead(&errorCode, parentptr);
- osi_Assert(!errorCode || errorCode == VSALVAGE);
+ opr_Assert(!errorCode || errorCode == VSALVAGE);
rx_KeepAliveOn(acall);
rx_KeepAliveOn(acall);
/* convert the write lock to a read lock before breaking callbacks */
VVnodeWriteToRead(&errorCode, targetptr);
- osi_Assert(!errorCode || errorCode == VSALVAGE);
+ opr_Assert(!errorCode || errorCode == VSALVAGE);
BreakCallBack(client->host, Fid, 0);
}
{
afs_int32 high, low;
SplitOffsetOrSize(Len, high, low);
- osi_Assert(Int64Mode || (Len >= 0 && high == 0) || Len < 0);
+ opr_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_sfsize_t * a_bytesStoredP)
{
afs_sfsize_t bytesTransfered; /* number of bytes actually transfered */
- struct timeval StartTime, StopTime; /* Used to measure how long the store takes */
Error errorCode = 0; /* Returned error code to caller */
#ifndef HAVE_PIOV
char *tbuffer; /* data copying buffer */
/* this bit means that the locks are set and protections are OK */
rx_SetLocalStatus(Call, 1);
- gettimeofday(&StartTime, 0);
-
optSize = sendBufSize;
ViceLog(25,
("StoreData_RXStyle: Pos %llu, DataLength %llu, FileLength %llu, Length %llu\n",
if (errorCode) {
Error tmp_errorCode = 0;
afs_sfsize_t nfSize = FDH_SIZE(fdP);
- osi_Assert(nfSize >= 0);
+ opr_Assert(nfSize >= 0);
/* something went wrong: adjust size and return */
VN_SET_LEN(targetptr, nfSize); /* set new file size. */
/* changed_newTime is tested in StoreData to detemine if we
}
FDH_CLOSE(fdP);
- gettimeofday(&StopTime, 0);
-
VN_SET_LEN(targetptr, NewLength);
/* Update all StoreData related stats */