VirtualBox

Changeset 24442 in vbox for trunk/src


Ignore:
Timestamp:
Nov 6, 2009 1:49:49 PM (15 years ago)
Author:
vboxsync
Message:

AsyncCompletion: New key to enable the host cache with async I/O. Not supported on Linux

Location:
trunk/src/VBox/VMM
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/PDMAsyncCompletionFile.cpp

    r24360 r24442  
    533533    if (RT_SUCCESS(rc))
    534534    {
     535        /* Check if the host cache should be used too. */
     536#ifndef RT_OS_LINUX
     537        rc = CFGMR3QueryBoolDef(pCfgNode, "HostCacheEnabled", &pEpClassFile->fHostCacheEnabled, false);
     538        AssertLogRelRCReturn(rc, rc);
     539#else
     540        /*
     541         * Host cache + async I/O is not supported on Linux. Check if the user enabled the cache,
     542         * leave a warning and disable it always.
     543         */
     544        bool fDummy;
     545        rc = CFGMR3QueryBoolDef(pCfgNode, "HostCacheEnabled", &fDummy);
     546        if (RT_SUCCESS(rc))
     547            LogRel(("AIOMgr: The host cache is not supported with async I/O on Linux\n"));
     548
     549        pEpClassFile->fHostCacheEnabled = false;
     550#endif
     551
    535552        /* Check if the cache was disabled by the user. */
    536553        rc = CFGMR3QueryBoolDef(pCfgNode, "CacheEnabled", &pEpClassFile->fCacheEnabled, true);
     
    611628            {
    612629                fFileFlags &= ~RTFILE_O_WRITE_THROUGH;
     630
     631#if defined(RT_OS_LINUX)
     632                AssertMsg(!pEpClassFile->fHostCacheEnabled, ("Host cache + async I/O is not supported on Linux\n"));
    613633                fFileFlags |= RTFILE_O_NO_CACHE;
     634#else
     635                if (!pEpClassFile->fHostCacheEnabled)
     636                    fFileFlags |= RTFILE_O_NO_CACHE;
     637#endif
    614638            }
    615639
  • trunk/src/VBox/VMM/PDMAsyncCompletionFileInternal.h

    r24359 r24442  
    334334    /** Flag whether the file data cache is enabled. */
    335335    bool                                fCacheEnabled;
     336    /** Flag whether the host cache should be used too. */
     337    bool                                fHostCacheEnabled;
    336338    /** Critical section protecting the list of async I/O managers. */
    337339    RTCRITSECT                          CritSect;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette