Changeset 51750 in vbox for trunk/src/VBox/Storage
- Timestamp:
- Jun 27, 2014 8:44:58 PM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 94562
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Storage/VD.cpp
r51623 r51750 480 480 * it was alloacted elsewhere (stack, ...). */ 481 481 #define VDIOCTX_FLAGS_DONT_FREE RT_BIT_32(4) 482 /* Don't set the modified flag for this I/O context when writing. */482 /** Don't set the modified flag for this I/O context when writing. */ 483 483 #define VDIOCTX_FLAGS_DONT_SET_MODIFIED_FLAG RT_BIT_32(5) 484 /** The write filter was applied already and shouldn't be applied a second time. 485 * Used at the beginning of vdWriteHelperAsync() because it might be called 486 * multiple times. 487 */ 488 #define VDIOCTX_FLAGS_WRITE_FILTER_APPLIED RT_BIT_32(6) 484 489 485 490 /** NIL I/O context pointer value. */ … … 967 972 int rc = VINF_SUCCESS; 968 973 974 VD_IS_LOCKED(pDisk); 975 969 976 if (pDisk->pFilterHead) 970 977 { … … 998 1005 { 999 1006 int rc = VINF_SUCCESS; 1007 1008 VD_IS_LOCKED(pDisk); 1000 1009 1001 1010 if (pDisk->pFilterHead) … … 1741 1750 if (pTmp == pIoCtxRc) 1742 1751 { 1752 if ( rcTmp == VINF_VD_ASYNC_IO_FINISHED 1753 && RT_SUCCESS(pTmp->rcReq) 1754 && pTmp->enmTxDir == VDIOCTXTXDIR_READ) 1755 { 1756 int rc2 = vdFilterChainApplyRead(pDisk, pTmp->Req.Io.uOffsetXferOrig, 1757 pTmp->Req.Io.cbXferOrig, pTmp); 1758 if (RT_FAILURE(rc2)) 1759 rcTmp = rc2; 1760 } 1761 1743 1762 /* The given I/O context was processed, pass the return code to the caller. */ 1744 1763 if ( rcTmp == VINF_VD_ASYNC_IO_FINISHED … … 2209 2228 IoCtx.Type.Root.pvUser2 = hEventComplete; 2210 2229 rc = vdIoCtxProcessSync(&IoCtx, hEventComplete); 2211 if (RT_SUCCESS(rc))2212 rc = vdFilterChainApplyRead(pDisk, uOffset, cbRead, &IoCtx);2213 2214 2230 RTSemEventDestroy(hEventComplete); 2215 2231 return rc; … … 2308 2324 IoCtx.Type.Root.pvUser1 = pDisk; 2309 2325 IoCtx.Type.Root.pvUser2 = hEventComplete; 2310 /* Apply write filter chain here. */2311 rc = vdFilterChainApplyWrite(pDisk, uOffset, cbWrite, &IoCtx);2312 2326 if (RT_SUCCESS(rc)) 2313 2327 rc = vdIoCtxProcessSync(&IoCtx, hEventComplete); … … 2921 2935 size_t cbThisWrite; 2922 2936 size_t cbPreRead, cbPostRead; 2937 2938 /* Apply write filter chain here if it was not done already. */ 2939 if (!(pIoCtx->fFlags & VDIOCTX_FLAGS_WRITE_FILTER_APPLIED)) 2940 { 2941 rc = vdFilterChainApplyWrite(pDisk, uOffset, cbWrite, pIoCtx); 2942 if (RT_FAILURE(rc)) 2943 return rc; 2944 pIoCtx->fFlags |= VDIOCTX_FLAGS_WRITE_FILTER_APPLIED; 2945 } 2923 2946 2924 2947 if (!(pIoCtx->fFlags & VDIOCTX_FLAGS_DONT_SET_MODIFIED_FLAG)) … … 10051 10074 { 10052 10075 if (ASMAtomicCmpXchgBool(&pIoCtx->fComplete, true, false)) 10053 {10054 rc2 = vdFilterChainApplyRead(pDisk, pIoCtx->Req.Io.uOffsetXferOrig,10055 pIoCtx->Req.Io.cbXferOrig, pIoCtx);10056 if (RT_FAILURE(rc2))10057 rc = rc2;10058 10076 vdIoCtxFree(pDisk, pIoCtx); 10059 }10060 10077 else 10061 10078 rc = VERR_VD_ASYNC_IO_IN_PROGRESS; /* Let the other handler complete the request. */ … … 10122 10139 { 10123 10140 rc = VERR_NO_MEMORY; 10124 break;10125 }10126 10127 /* Apply write filter chain here. */10128 rc = vdFilterChainApplyWrite(pDisk, uOffset, cbWrite, pIoCtx);10129 if (RT_FAILURE(rc))10130 {10131 vdIoCtxFree(pDisk, pIoCtx);10132 10141 break; 10133 10142 }
Note:
See TracChangeset
for help on using the changeset viewer.