X-Git-Url: https://git.openafs.org/?p=openafs.git;a=blobdiff_plain;f=src%2FWINNT%2Fafsd%2Fcm_scache.c;h=9d7bdbc83772a448c694f53affeb55ad5beab0fc;hp=9b6ed5e447a6da4b6f7bc17c7f52534f56ab8d5a;hb=5d245327f057389950c30bb36af6d12f6f96c73a;hpb=473b0345210c98a44cffb8c5de1d0da5980969f4 diff --git a/src/WINNT/afsd/cm_scache.c b/src/WINNT/afsd/cm_scache.c index 9b6ed5e..9d7bdbc 100644 --- a/src/WINNT/afsd/cm_scache.c +++ b/src/WINNT/afsd/cm_scache.c @@ -1476,6 +1476,8 @@ void cm_MergeStatus(cm_scache_t *dscp, 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 @@ -1486,7 +1488,7 @@ void cm_MergeStatus(cm_scache_t *dscp, 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; @@ -1499,7 +1501,7 @@ void cm_MergeStatus(cm_scache_t *dscp, 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 */ @@ -1535,8 +1537,11 @@ void cm_MergeStatus(cm_scache_t *dscp, 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); @@ -1551,8 +1556,8 @@ void cm_MergeStatus(cm_scache_t *dscp, 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. @@ -1629,19 +1634,18 @@ void cm_MergeStatus(cm_scache_t *dscp, 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