VirtualBox

Changeset 27524 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Mar 19, 2010 11:22:40 AM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
59029
Message:

I/O cache: We have to clip the read size if there is an intersecting entry in the cache

File:
1 edited

Legend:

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

    r27523 r27524  
    18731873            }
    18741874            else
    1875 #endif
    18761875            {
    18771876                /*
     
    18791878                 * Pass the request directly to the I/O manager.
    18801879                 */
    1881                 //LogFlow(("Couldn't evict %u bytes from the cache. Remaining request will be passed through\n", cbToRead));
     1880                LogFlow(("Couldn't evict %u bytes from the cache. Remaining request will be passed through\n", cbToRead));
    18821881
    18831882                pdmacFileEpCacheRequestPassthrough(pEndpoint, pTask,
     
    18851884                                                   PDMACTASKFILETRANSFER_READ);
    18861885            }
     1886#else
     1887            /* Clip read size if neccessary. */
     1888            PPDMACFILECACHEENTRY pEntryAbove;
     1889            pdmacFileEpCacheGetCacheBestFitEntryByOffset(pEndpointCache, off,
     1890                                                         &pEntryAbove, NULL);
     1891
     1892            if (pEntryAbove)
     1893            {
     1894                if (off + (RTFOFF)cbRead > pEntryAbove->Core.Key)
     1895                    cbToRead = pEntryAbove->Core.Key - off;
     1896                else
     1897                    cbToRead = cbRead;
     1898
     1899                pdmacFileEpCacheEntryRelease(pEntryAbove);
     1900            }
     1901
     1902            cbRead -= cbToRead;
     1903            pdmacFileEpCacheRequestPassthrough(pEndpoint, pTask,
     1904                                                &IoMemCtx, off, cbToRead,
     1905                                                PDMACTASKFILETRANSFER_READ);
     1906#endif
    18871907        }
    18881908        off += cbToRead;
Note: See TracChangeset for help on using the changeset viewer.

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