From: Jeffrey Altman Date: Fri, 26 Dec 2008 23:34:37 +0000 (+0000) Subject: DEVEL15-windows-afsd-dir-prefetch-20081226 X-Git-Tag: openafs-devel-1_5_56~14 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=49f6f9e74ba1455028eb6a1227cd12de186c36cf;p=packages%2Fo%2Fopenafs.git DEVEL15-windows-afsd-dir-prefetch-20081226 LICENSE MIT when prefetching the directory buffers do not call cm_FlushFile to discard locally modified buffers. Instead just set the cm_scache_t bufDataVersionLow to the current version. out of date buffers will therefore be ignored without requiring that locks be dropped and reacquired and without searching all of the buffers associated with the directory. (cherry picked from commit 4435c4fdcc6ba21b86277cfd09b0dfa1b88989c5) --- diff --git a/src/WINNT/afsd/cm_dir.c b/src/WINNT/afsd/cm_dir.c index 5f2439c1e..ceb92ff33 100644 --- a/src/WINNT/afsd/cm_dir.c +++ b/src/WINNT/afsd/cm_dir.c @@ -600,6 +600,8 @@ cm_DirLookup(cm_dirOp_t * op, char *entry, cm_fid_t * cfid) LARGE_INTEGER start; LARGE_INTEGER end; + lock_AssertNone(&op->scp->rw); + QueryPerformanceCounter(&start); osi_Log2(afsd_logp, "cm_DirLookup for op 0x%p, entry[%s]", @@ -1498,13 +1500,8 @@ cm_DirPrefetchBuffers(cm_dirOp_t * op) contents just to make sure that we don't end up with buffers that was locally modified. */ - if (op->scp->flags & CM_SCACHEFLAG_LOCAL) { - lock_ReleaseWrite(&op->scp->rw); - code = cm_FlushFile(op->scp, op->userp, &op->req); - if (code != 0) - return code; - lock_ObtainWrite(&op->scp->rw); - } + if (op->scp->flags & CM_SCACHEFLAG_LOCAL) + op->scp->bufDataVersionLow = op->scp->dataVersion; offset = ConvertLongToLargeInteger(0); while (LargeIntegerLessThan(offset, op->scp->length)) {