DEVEL15-windows-get-buffer-20071228
authorJeffrey Altman <jaltman@secure-endpoints.com>
Fri, 28 Dec 2007 07:26:00 +0000 (07:26 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Fri, 28 Dec 2007 07:26:00 +0000 (07:26 +0000)
commit2ba19804b979816b802ed0fda9aa60db9b4c1394
treeb5b10054587a0f4c0ed432753a501e9a44eeb9d5
parent3f8a21aaf8235f2c209003cc1ef96a44886a2950
DEVEL15-windows-get-buffer-20071228

LICENSE MIT

cm_BkgPrefetch() contained two errors.  First, the loop at the top of the
function that ensures that a cm_buf_t is allocated for each of the offset
positions failed to actually obtain the buffer for the specified offset.
Instead, it repeatedly obtained the buffer for the starting base address.

Second, cm_GetBuffer() would reserve all of the buffers associated with
the cm_scache_t even in the case where we already have a callback and the
existing buffer has the proper data version number.  In that situation
reserving the buffers simply wastes valuable time.

(cherry picked from commit 33aeecd83f8ce670269868145648ae6e277cf3cb)
src/WINNT/afsd/cm_dcache.c