VirtualBox

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


Ignore:
Timestamp:
Oct 20, 2011 1:47:45 PM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
74476
Message:

PDMBlkCache: Remove dead code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/PDMBlkCache.cpp

    r39042 r39054  
    17451745 *
    17461746 * @returns The number of bytes the entry can hold of the requested amount
    1747  *          of byte.
     1747 *          of bytes.
    17481748 * @param   pEndpoint       The endpoint.
    17491749 * @param   pBlkCache       The endpoint cache.
     
    17511751 * @param   cb              The number of bytes the entry needs to hold at
    17521752 *                          least.
    1753  * @param   uAlignment      Alignment of the boundary sizes.
    1754  * @param   poffAligned     Where to store the aligned offset.
    1755  * @param   pcbAligned      Where to store the aligned size of the entry.
     1753 * @param   pcbEntry        Where to store the number of bytes the entry can hold.
     1754 *                          Can be less than given because of other entries.
    17561755 */
    17571756static uint32_t pdmBlkCacheEntryBoundariesCalc(PPDMBLKCACHE pBlkCache,
    17581757                                               uint64_t off, uint32_t cb,
    1759                                                unsigned uAlignment,
    1760                                                uint64_t *poffAligned, uint32_t *pcbAligned)
     1758                                               uint32_t *pcbEntry)
    17611759{
    17621760    /* Get the best fit entries around the offset */
     
    17721770             pEntryAbove ? pEntryAbove->cbData : 0));
    17731771
    1774     /** @todo r=bird: Why is uAlignment disregarded here? */
    1775     uint64_t offAligned = off;
    1776 
    1777     uint32_t cbAligned;
     1772    uint32_t cbNext;
    17781773    uint32_t cbInEntry;
    17791774    if (    pEntryAbove
     
    17811776    {
    17821777        cbInEntry = (uint32_t)(pEntryAbove->Core.Key - off);
    1783         cbAligned = (uint32_t)(pEntryAbove->Core.Key - offAligned);
     1778        cbNext = (uint32_t)(pEntryAbove->Core.Key - off);
    17841779    }
    17851780    else
    17861781    {
    17871782        cbInEntry = cb;
    1788         cbAligned = cb;
     1783        cbNext    = cb;
    17891784    }
    17901785
    17911786    /* A few sanity checks */
    1792     AssertMsg(!pEntryAbove || offAligned + cbAligned <= pEntryAbove->Core.Key,
     1787    AssertMsg(!pEntryAbove || off + cbNext <= pEntryAbove->Core.Key,
    17931788              ("Aligned size intersects with another cache entry\n"));
    1794     Assert(cbInEntry <= cbAligned);
     1789    Assert(cbInEntry <= cbNext);
    17951790
    17961791    if (pEntryAbove)
    17971792        pdmBlkCacheEntryRelease(pEntryAbove);
    17981793
    1799     LogFlow(("offAligned=%llu cbAligned=%u\n", offAligned, cbAligned));
    1800 
    1801     *poffAligned = offAligned;
    1802     *pcbAligned  = cbAligned;
     1794    LogFlow(("off=%llu cbNext=%u\n", off, cbNext));
     1795
     1796    *pcbEntry  = cbNext;
    18031797
    18041798    return cbInEntry;
     
    18141808 * @param   off               The offset.
    18151809 * @param   cb                Number of bytes the cache entry should have.
    1816  * @param   uAlignment        Alignment the size of the entry should have.
    18171810 * @param   pcbData           Where to store the number of bytes the new
    18181811 *                            entry can hold. May be lower than actually requested
     
    18211814static PPDMBLKCACHEENTRY pdmBlkCacheEntryCreate(PPDMBLKCACHE pBlkCache,
    18221815                                                uint64_t off, size_t cb,
    1823                                                 unsigned uAlignment,
    18241816                                                size_t *pcbData)
    18251817{
    1826     uint64_t offStart = 0;
    18271818    uint32_t cbEntry  = 0;
    1828     *pcbData = pdmBlkCacheEntryBoundariesCalc(pBlkCache, off, (uint32_t)cb, uAlignment,
    1829                                               &offStart, &cbEntry);
     1819
     1820    *pcbData = pdmBlkCacheEntryBoundariesCalc(pBlkCache, off, (uint32_t)cb, &cbEntry);
    18301821    AssertReturn(cb <= UINT32_MAX, NULL);
    18311822
     
    18401831        LogFlow(("Evicted enough bytes (%u requested). Creating new cache entry\n", cbEntry));
    18411832
    1842         pEntryNew = pdmBlkCacheEntryAlloc(pBlkCache, offStart, cbEntry, pbBuffer);
     1833        pEntryNew = pdmBlkCacheEntryAlloc(pBlkCache, off, cbEntry, pbBuffer);
    18431834        if (RT_LIKELY(pEntryNew))
    18441835        {
     
    18511842            AssertMsg(   (off >= pEntryNew->Core.Key)
    18521843                      && (off + *pcbData <= pEntryNew->Core.KeyLast + 1),
    1853                       ("Overflow in calculation off=%llu OffsetAligned=%llu\n",
    1854                        off, pEntryNew->Core.Key));
     1844                      ("Overflow in calculation off=%llu\n", off));
    18551845        }
    18561846        else
     
    20852075            PPDMBLKCACHEENTRY pEntryNew = pdmBlkCacheEntryCreate(pBlkCache,
    20862076                                                                 off, cbRead,
    2087                                                                  PAGE_SIZE,
    20882077                                                                 &cbToRead);
    20892078
     
    23172306            PPDMBLKCACHEENTRY pEntryNew = pdmBlkCacheEntryCreate(pBlkCache,
    23182307                                                                 off, cbWrite,
    2319                                                                  512, &cbToWrite);
     2308                                                                 &cbToWrite);
    23202309
    23212310            cbWrite -= cbToWrite;
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