Changeset 24359 in vbox for trunk/src/VBox
- Timestamp:
- Nov 4, 2009 10:28:48 PM (15 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PDMAsyncCompletionFile.cpp
r24278 r24359 527 527 if (RT_SUCCESS(rc)) 528 528 { 529 /* Init cache structure */ 530 rc = pdmacFileCacheInit(pEpClassFile, pCfgNode); 531 if (RT_FAILURE(rc)) 532 RTCritSectDelete(&pEpClassFile->CritSect); 529 /* Check if the cache was disabled by the user. */ 530 rc = CFGMR3QueryBoolDef(pCfgNode, "CacheEnabled", &pEpClassFile->fCacheEnabled, true); 531 AssertLogRelRCReturn(rc, rc); 532 533 if (pEpClassFile->fCacheEnabled) 534 { 535 /* Init cache structure */ 536 rc = pdmacFileCacheInit(pEpClassFile, pCfgNode); 537 if (RT_FAILURE(rc)) 538 { 539 RTCritSectDelete(&pEpClassFile->CritSect); 540 pEpClassFile->fCacheEnabled = false; 541 LogRel(("AIOMgr: Failed to initialise the cache (rc=%Rrc), disabled caching\n")); 542 } 543 } 544 else 545 LogRel(("AIOMgr: Cache was globally disabled\n")); 533 546 } 534 547 … … 546 559 while (pEpClassFile->pAioMgrHead) 547 560 pdmacFileAioMgrDestroy(pEpClassFile, pEpClassFile->pAioMgrHead); 561 562 /* Destroy the cache. */ 563 if (pEpClassFile->fCacheEnabled) 564 pdmacFileCacheDestroy(pEpClassFile); 548 565 549 566 RTCritSectDelete(&pEpClassFile->CritSect); … … 657 674 else 658 675 { 659 if (fFlags & PDMACEP_FILE_FLAGS_CACHING) 676 if ( (fFlags & PDMACEP_FILE_FLAGS_CACHING) 677 && (pEpClassFile->fCacheEnabled)) 660 678 { 661 679 pEpFile->fCaching = true; -
trunk/src/VBox/VMM/PDMAsyncCompletionFileCache.cpp
r24356 r24359 681 681 /* Initialize the critical section */ 682 682 rc = RTCritSectInit(&pCache->CritSect); 683 684 if (RT_SUCCESS(rc)) 685 LogRel(("AIOMgr: Cache successfully initialised. Cache size is %u bytes\n", pCache->cbMax)); 686 683 687 return rc; 684 688 } -
trunk/src/VBox/VMM/PDMAsyncCompletionFileInternal.h
r24356 r24359 332 332 /** Flag whether we use the failsafe method. */ 333 333 bool fFailsafe; 334 /** Flag whether the file data cache is enabled. */ 335 bool fCacheEnabled; 334 336 /** Critical section protecting the list of async I/O managers. */ 335 337 RTCRITSECT CritSect;
Note:
See TracChangeset
for help on using the changeset viewer.