char buffer[1024];
cm_scache_t *scp;
char * type = "ScpNotFound";
- afs_int32 dv = -1;
+ afs_uint64 dv = -1;
scp = cm_FindSCache(&entryp->fid);
if (scp) {
}
dv = scp->dataVersion;
- cm_ReleaseSCache(scp);
+ cm_ReleaseSCache(scp);
}
- sprintf(buffer, "'%s' Fid = (%d,%d,%d,%d) Short = '%s' Type %s DV %d",
+ sprintf(buffer, "'%s' Fid = (%d,%d,%d,%d) Short = '%s' Type %s DV %I64d",
entryp->name,
entryp->fid.cell, entryp->fid.volume, entryp->fid.vnode, entryp->fid.unique,
entryp->shortName,
}
/* Must be called with scp->mx held */
-long buf_ForceDataVersion(cm_scache_t * scp, afs_uint32 fromVersion, afs_uint32 toVersion)
+long buf_ForceDataVersion(cm_scache_t * scp, afs_uint64 fromVersion, afs_uint64 toVersion)
{
cm_buf_t * bp;
- cm_buf_t * nbp;
unsigned int i;
int found = 0;
cm_user_t *userp; /* user who wrote to the buffer last */
/* fields added for the CM; locked by scp->mx */
- afs_uint32 dataVersion; /* data version of this page */
+ afs_uint64 dataVersion; /* data version of this page */
afs_uint32 cmFlags; /* flags for cm */
/* syncop state */
extern long buf_CleanDirtyBuffers(cm_scache_t *scp);
-extern long buf_ForceDataVersion(cm_scache_t * scp, afs_uint32 fromVersion, afs_uint32 toVersion);
+extern long buf_ForceDataVersion(cm_scache_t * scp, afs_uint64 fromVersion, afs_uint64 toVersion);
/* error codes */
#define CM_BUF_EXISTS 1 /* buffer exists, and shouldn't */
cep->lock.pid_writer = 0;
cep->lock.src_indicator = 0;
cep->Length = scp->length.LowPart;
- cep->DataVersion = scp->dataVersion;
+ cep->DataVersion = (afs_uint32)(scp->dataVersion & 0xFFFFFFFF);
cep->callback = afs_data_pointer_to_int32(scp->cbServerp);
if (scp->flags & CM_SCACHEFLAG_PURERO && scp->volp)
cep->cbExpires = scp->volp->cbExpiresRO;
#else
cep->Length = (afs_int64) scp->length.QuadPart;
#endif
- cep->DataVersion = scp->dataVersion;
+ cep->DataVersion = (afs_uint32)(scp->dataVersion & 0xFFFFFFFF);
cep->callback = afs_data_pointer_to_int32(scp->cbServerp);
if (scp->flags & CM_SCACHEFLAG_PURERO && scp->volp)
cep->cbExpires = scp->volp->cbExpiresRO;
afsStatus.FileType = 0x2;
afsStatus.LinkCount = scp->linkCount;
afsStatus.Length = cm_fakeDirSize;
- afsStatus.DataVersion = cm_data.fakeDirVersion;
+ afsStatus.DataVersion = (afs_uint32)(cm_data.fakeDirVersion & 0xFFFFFFFF);
afsStatus.Author = 0x1;
afsStatus.Owner = 0x0;
afsStatus.CallerAccess = 0x9;
afsStatus.ServerModTime = (afs_uint32)FakeFreelanceModTime;
afsStatus.Group = 0;
afsStatus.SyncCounter = 0;
- afsStatus.dataVersionHigh = 0;
+ afsStatus.dataVersionHigh = (afs_uint32)(cm_data.fakeDirVersion >> 32);
afsStatus.lockCount = 0;
afsStatus.Length_hi = 0;
afsStatus.errorCode = 0;
qdp;
qdp = (osi_queueData_t *) osi_QNext(&qdp->q)) {
tbufp = osi_GetQData(qdp);
- tbufp->dataVersion = afsStatus.DataVersion;
+ tbufp->dataVersion = afsStatus.dataVersionHigh;
+ tbufp->dataVersion <<= 32;
+ tbufp->dataVersion |= afsStatus.DataVersion;
#ifdef DISKCACHE95
/* write buffer out to disk cache */
osi_hyper_t length; /* scp->length at the time
cm_BeginDirOp() was called.*/
osi_hyper_t newLength; /* adjusted scp->length */
- afs_uint32 dataVersion; /* scp->dataVersion when
+ afs_uint64 dataVersion; /* scp->dataVersion when
cm_BeginDirOp() was called.*/
- afs_uint32 newDataVersion; /* scp->dataVersion when
+ afs_uint64 newDataVersion; /* scp->dataVersion when
cm_CheckDirOpForSingleChange()
was called. */
- afs_uint32 dirtyBufCount;
+ afs_uint64 dirtyBufCount;
- afs_uint32 nBuffers; /* number of buffers below */
+ afs_uint64 nBuffers; /* number of buffers below */
cm_dirOpBuffer_t buffers[CM_DIROP_MAXBUFFERS];
} cm_dirOp_t;
cm_fid_t rootFid;
cm_scache_t * rootSCachep;
cm_scache_t fakeSCache;
- afs_uint32 fakeDirVersion;
+ afs_uint64 fakeDirVersion;
cm_aclent_t * aclLRUp;
cm_aclent_t * aclLRUEndp;
AFSVolSync *volsyncp,
cm_user_t *userp, afs_uint32 flags)
{
+ afs_uint64 dataVersion;
+
// yj: i want to create some fake status for the /afs directory and the
// entries under that directory
#ifdef AFS_FREELANCE_CLIENT
statusp->LinkCount = scp->linkCount;
statusp->Length = cm_fakeDirSize;
statusp->Length_hi = 0;
- statusp->DataVersion = cm_data.fakeDirVersion;
+ statusp->DataVersion = (afs_uint32)(cm_data.fakeDirVersion & 0xFFFFFFFF);
statusp->Author = 0x1;
statusp->Owner = 0x0;
statusp->CallerAccess = 0x9;
statusp->ServerModTime = FakeFreelanceModTime;
statusp->Group = 0;
statusp->SyncCounter = 0;
- statusp->dataVersionHigh = 0;
+ statusp->dataVersionHigh = (afs_uint32)(cm_data.fakeDirVersion >> 32);
statusp->errorCode = 0;
}
#endif /* AFS_FREELANCE_CLIENT */
scp->flags &= ~CM_SCACHEFLAG_EACCESS;
}
- if (!(flags & CM_MERGEFLAG_FORCE)
- && statusp->DataVersion < (unsigned long) scp->dataVersion) {
+ dataVersion = statusp->dataVersionHigh;
+ dataVersion <<= 32;
+ dataVersion |= statusp->DataVersion;
+
+ if (!(flags & CM_MERGEFLAG_FORCE) && dataVersion < scp->dataVersion) {
struct cm_cell *cellp;
cellp = cm_FindCellByID(scp->fid.cell);
if (volp)
cm_PutVolume(volp);
}
- osi_Log3(afsd_logp, "Bad merge, scp %x, scp dv %d, RPC dv %d",
- scp, scp->dataVersion, statusp->DataVersion);
+ osi_Log3(afsd_logp, "Bad merge, scp %x, scp dv %I64d, RPC dv %I64d",
+ scp, scp->dataVersion, dataVersion);
/* we have a number of data fetch/store operations running
* concurrently, and we can tell which one executed last at the
* server by its mtime.
cm_AddACLCache(scp, userp, statusp->CallerAccess);
}
- if ((flags & CM_MERGEFLAG_STOREDATA) &&
- statusp->DataVersion - scp->dataVersion == 1) {
+ if ((flags & CM_MERGEFLAG_STOREDATA) && dataVersion - scp->dataVersion == 1) {
cm_buf_t *bp;
for (bp = cm_data.buf_fileHashTablepp[BUF_FILEHASH(&scp->fid)]; bp; bp=bp->fileHashp)
{
if (cm_FidCmp(&scp->fid, &bp->fid) == 0 &&
bp->dataVersion == scp->dataVersion)
- bp->dataVersion = statusp->DataVersion;
+ bp->dataVersion = dataVersion;
}
}
- scp->dataVersion = statusp->DataVersion;
+ scp->dataVersion = dataVersion;
}
/* note that our stat cache info is incorrect, so force us eventually
cm_prefetch_t prefetch; /* prefetch info structure */
afs_uint32 unixModeBits; /* unix protection mode bits */
afs_uint32 linkCount; /* link count */
- afs_uint32 dataVersion; /* data version */
+ afs_uint64 dataVersion; /* data version */
afs_uint32 owner; /* file owner */
afs_uint32 group; /* file owning group */
cm_user_t *creator; /* user, if new file */
*/
unsigned long lastRefreshCycle; /* protected with cm_scacheLock
* for all scaches. */
- afs_uint32 lockDataVersion; /* dataVersion of the scp at the time
+ afs_uint64 lockDataVersion; /* dataVersion of the scp at the time
the server lock for the scp was
asserted for this lock the last
time. */
#ifdef USE_BPLUS
/* directory B+ tree */ /* only allocated if is directory */
osi_rwlock_t dirlock; /* controls access to dirBplus */
- afs_uint32 dirDataVersion; /* data version represented by dirBplus */
+ afs_uint64 dirDataVersion; /* data version represented by dirBplus */
struct tree *dirBplus; /* dirBplus */
#endif