LICENSE MIT
Add CM_CONFIGDEFAULT_CELLS (1024) to cm_config.h and a "Cells" registry
value that can be used to alter the limit at runtime.
No longer tie the number of cells to the number of stat cache objects.
1024 should be more than sufficient.
(cherry picked from commit
edbde00d6c3be0228b1647505d8483632cceaf39)
long logChunkSize;
DWORD stats;
DWORD volumes;
+ DWORD cells;
DWORD dwValue;
DWORD rx_enable_peer_stats;
DWORD rx_enable_process_stats;
afsi_log("Default volume cache entries: %d", volumes);
}
+ dummyLen = sizeof(cells);
+ code = RegQueryValueEx(parmKey, "Cells", NULL, NULL,
+ (BYTE *) &cells, &dummyLen);
+ if (code == ERROR_SUCCESS)
+ afsi_log("Cell cache entries: %d", cells);
+ else {
+ cells = CM_CONFIGDEFAULT_CELLS;
+ afsi_log("Default cell cache entries: %d", cells);
+ }
+
dummyLen = sizeof(ltt);
code = RegQueryValueEx(parmKey, "LogoffTokenTransfer", NULL, NULL,
(BYTE *) <t, &dummyLen);
cm_InitCallback();
- code = cm_InitMappedMemory(virtualCache, cm_CachePath, stats, volumes, cm_chunkSize, cacheBlocks, blockSize);
+ code = cm_InitMappedMemory(virtualCache, cm_CachePath, stats, volumes, cells, cm_chunkSize, cacheBlocks, blockSize);
afsi_log("cm_InitMappedMemory code %x", code);
if (code != 0) {
*reasonP = "error initializing cache file";
#define CM_CONFIGDEFAULT_CACHESIZE 98304
#define CM_CONFIGDEFAULT_BLOCKSIZE 4096
#define CM_CONFIGDEFAULT_ASYNCSTORESIZE 131072 /* 128K */
+#define CM_CONFIGDEFAULT_CELLS 1024
#define CM_CONFIGDEFAULT_STATS 10000
#define CM_CONFIGDEFAULT_CHUNKSIZE 18 /* 256KB */
#define CM_CONFIGDEFAULT_DAEMONS 4
}
int
-cm_InitMappedMemory(DWORD virtualCache, char * cachePath, DWORD stats, DWORD maxVols, DWORD chunkSize,
- afs_uint64 cacheBlocks, afs_uint32 blockSize)
+cm_InitMappedMemory(DWORD virtualCache, char * cachePath, DWORD stats, DWORD maxVols, DWORD maxCells,
+ DWORD chunkSize, afs_uint64 cacheBlocks, afs_uint32 blockSize)
{
HANDLE hf = INVALID_HANDLE_VALUE, hm;
PSECURITY_ATTRIBUTES psa;
int newFile = 1;
afs_uint64 mappingSize;
- DWORD maxCells = stats/4;
DWORD volumeSerialNumber = 0;
DWORD sidStringSize = 0;
DWORD rc;
VOID FreeCacheFileSA(PSECURITY_ATTRIBUTES psa);
int cm_ShutdownMappedMemory(void);
int cm_ValidateMappedMemory(char * cachePath);
-int cm_InitMappedMemory(DWORD virtualCache, char * cachePath, DWORD stats, DWORD maxVols, DWORD chunkSize, afs_uint64 cacheBlocks, afs_uint32 blockSize);
+int cm_InitMappedMemory(DWORD virtualCache, char * cachePath, DWORD stats, DWORD maxVols, DWORD maxCells, DWORD chunkSize, afs_uint64 cacheBlocks, afs_uint32 blockSize);
#endif /* CM_MEMMAP_H */
\ No newline at end of file