VirtualBox

Changeset 34340 in vbox for trunk


Ignore:
Timestamp:
Nov 24, 2010 8:11:53 PM (14 years ago)
Author:
vboxsync
Message:

PDMBlkCache: Bug fixes

File:
1 edited

Legend:

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

    r34246 r34340  
    608608    pIoXfer->cbXfer      = cbData;
    609609    pIoXfer->enmXferDir  = enmXferDir;
    610     RTSgBufClone(&pIoXfer->SgBuf, pSgBuf);
    611     RTSgBufAdvance(pSgBuf, cbData);
     610    if (pSgBuf)
     611    {
     612        RTSgBufClone(&pIoXfer->SgBuf, pSgBuf);
     613        RTSgBufAdvance(pSgBuf, cbData);
     614    }
    612615
    613616    return pdmBlkCacheEnqueue(pBlkCache, offStart, pIoXfer);
     
    15741577        cbAligned = cb;
    15751578        cbInEntry = cb;
    1576 #if 0
    1577         /*
    1578          * Align the size to a 4KB boundary.
    1579          * Memory size is aligned to a page boundary
    1580          * and memory is wasted if the size is rather small.
    1581          * (For example reads with a size of 512 bytes).
    1582          */
    1583         cbInEntry = cb;
    1584         cbAligned = RT_ALIGN_Z(cb + (off - offAligned), uAlignment);
    1585 
    1586         /*
    1587          * Clip to file size if the original request doesn't
    1588          * exceed the file (not an appending write)
    1589          */
    1590         uint64_t cbReq = off + cb;
    1591         if (cbReq >= pEndpoint->cbFile)
    1592             cbAligned = cbReq - offAligned;
    1593         else
    1594             cbAligned = RT_MIN(pEndpoint->cbFile - offAligned, cbAligned);
    1595         if (pEntryAbove)
    1596         {
    1597             Assert(pEntryAbove->Core.Key >= off);
    1598             cbAligned = RT_MIN(cbAligned, pEntryAbove->Core.Key - offAligned);
    1599         }
    1600 #endif
    16011579    }
    16021580
     
    22032181{
    22042182    int rc = VINF_SUCCESS;
     2183    PPDMBLKCACHEREQ pReq;
    22052184
    22062185    LogFlowFunc((": pBlkCache=%#p{%s}\n", pBlkCache, pBlkCache->pszId));
     
    22092188    pdmBlkCacheCommit(pBlkCache);
    22102189
     2190    /* Allocate new request structure. */
     2191    pReq = pdmBlkCacheReqAlloc(0, pvUser);
     2192    if (RT_UNLIKELY(!pReq))
     2193        return VERR_NO_MEMORY;
     2194
     2195    rc = pdmBlkCacheRequestPassthrough(pBlkCache, pReq, NULL, 0, 0,
     2196                                       PDMBLKCACHEXFERDIR_FLUSH);
     2197    AssertRC(rc);
     2198
    22112199    LogFlowFunc((": Leave rc=%Rrc\n", rc));
    2212     return rc;
     2200    return VINF_AIO_TASK_PENDING;
    22132201}
    22142202
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