- Timestamp:
- Nov 24, 2010 8:11:53 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PDMBlkCache.cpp
r34246 r34340 608 608 pIoXfer->cbXfer = cbData; 609 609 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 } 612 615 613 616 return pdmBlkCacheEnqueue(pBlkCache, offStart, pIoXfer); … … 1574 1577 cbAligned = cb; 1575 1578 cbInEntry = cb; 1576 #if 01577 /*1578 * Align the size to a 4KB boundary.1579 * Memory size is aligned to a page boundary1580 * 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't1588 * exceed the file (not an appending write)1589 */1590 uint64_t cbReq = off + cb;1591 if (cbReq >= pEndpoint->cbFile)1592 cbAligned = cbReq - offAligned;1593 else1594 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 #endif1601 1579 } 1602 1580 … … 2203 2181 { 2204 2182 int rc = VINF_SUCCESS; 2183 PPDMBLKCACHEREQ pReq; 2205 2184 2206 2185 LogFlowFunc((": pBlkCache=%#p{%s}\n", pBlkCache, pBlkCache->pszId)); … … 2209 2188 pdmBlkCacheCommit(pBlkCache); 2210 2189 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 2211 2199 LogFlowFunc((": Leave rc=%Rrc\n", rc)); 2212 return rc;2200 return VINF_AIO_TASK_PENDING; 2213 2201 } 2214 2202
Note:
See TracChangeset
for help on using the changeset viewer.