osi_panic("buf_GetNewLocked: TryMutex failed",__FILE__,__LINE__);
}
+ if ( cm_data.buf_usedCount < cm_data.buf_nbuffers)
+ InterlockedIncrement(&cm_data.buf_usedCount);
+
lock_ReleaseWrite(&buf_globalLock);
lock_ReleaseRead(&scp->bufCreateLock);
* so we report the entire cache in use since reporting 0 in use disturbs
* many users.
*/
- parms.parms[1] = cm_data.buf_nbuffers * (cm_data.buf_blockSize / 1024);
+ parms.parms[1] = cm_data.buf_usedCount * (cm_data.buf_blockSize / 1024);
memcpy(ioctlp->outDatap, &parms, sizeof(parms));
ioctlp->outDatap += sizeof(parms);
}
cm_data.buf_nbuffers = cacheBlocks;
- cm_data.buf_nOrigBuffers = 0;
+ cm_data.buf_nOrigBuffers = cacheBlocks;
+ cm_data.buf_usedCount = 0;
cm_data.buf_blockSize = blockSize;
cm_data.buf_hashSize = cm_NextHighestPowerOf2((afs_uint32)(cacheBlocks/7));
#ifndef CM_MEMMAP_H
#define CM_MEMMAP_H 1
-#define CM_CONFIG_DATA_VERSION 21
+#define CM_CONFIG_DATA_VERSION 22
#define CM_CONFIG_DATA_MAGIC ('A' | 'F'<<8 | 'S'<<16 | CM_CONFIG_DATA_VERSION<<24)
typedef struct cm_config_data {
afs_uint32 buf_reserveWaiting;
afs_uint32 buf_freeCount;
afs_uint32 buf_redirCount;
+ afs_uint32 buf_usedCount;
#else
afs_uint64 buf_nbuffers;
afs_uint64 buf_nOrigBuffers;
afs_uint64 buf_reserveWaiting;
afs_uint64 buf_freeCount;
afs_uint64 buf_redirCount;
+ afs_uint64 buf_usedCount;
#endif
time_t mountRootGen;
afsUUID Uuid;