Changeset 29006 in vbox
- Timestamp:
- May 4, 2010 11:37:42 AM (15 years ago)
- Location:
- trunk/src/VBox/Devices/Storage
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DrvVD.cpp
r28835 r29006 302 302 rc = pStorageBackend->pfnCompleted(pvUser, rcReq); 303 303 AssertRC(rc); 304 305 /* If thread synchronization is active, then signal the end of the306 * this disk read/write operation. */307 /** @todo provide a way to determine the type of task (read/write)308 * which was completed, see also VBoxHDD.cpp. */309 if (RT_UNLIKELY(pStorageBackend->pInterfaceThreadSyncCallbacks))310 {311 int rc2 = pStorageBackend->pInterfaceThreadSyncCallbacks->pfnFinishWrite(pStorageBackend->pInterfaceThreadSync->pvUser);312 AssertRC(rc2);313 }314 304 } 315 305 } -
trunk/src/VBox/Devices/Storage/VBoxHDD.cpp
r28800 r29006 1816 1816 pIoCtxParent->Type.Root.pvUser2, 1817 1817 pIoCtxParent->rcReq); 1818 vdThreadFinishWrite(pDisk); 1818 1819 vdIoCtxFree(pDisk, pIoCtxParent); 1819 1820 } … … 1855 1856 { 1856 1857 LogFlowFunc(("Waiting I/O context completed pIoCtxWait=%#p\n", pIoCtxWait)); 1858 vdThreadFinishWrite(pDisk); 1857 1859 pIoCtxWait->Type.Root.pfnComplete(pIoCtxWait->Type.Root.pvUser1, 1858 1860 pIoCtxWait->Type.Root.pvUser2, … … 1866 1868 } 1867 1869 else 1870 { 1871 if (pIoCtx->enmTxDir == VDIOCTXTXDIR_WRITE) 1872 vdThreadFinishWrite(pDisk); 1873 else 1874 vdThreadFinishRead(pDisk); 1875 1868 1876 pIoCtx->Type.Root.pfnComplete(pIoCtx->Type.Root.pvUser1, 1869 1877 pIoCtx->Type.Root.pvUser2, 1870 1878 pIoCtx->rcReq); 1879 } 1871 1880 1872 1881 vdIoCtxFree(pDisk, pIoCtx); … … 5967 5976 } while (0); 5968 5977 5969 if (RT_UNLIKELY(fLockRead) && (rc != VINF_VD_ASYNC_IO_FINISHED)) 5978 if (RT_UNLIKELY(fLockRead) && ( rc == VINF_VD_ASYNC_IO_FINISHED 5979 || rc != VERR_VD_ASYNC_IO_IN_PROGRESS)) 5970 5980 { 5971 5981 rc2 = vdThreadFinishRead(pDisk); … … 6042 6052 } while (0); 6043 6053 6044 if (RT_UNLIKELY(fLockWrite) && RT_FAILURE(rc)) 6054 if (RT_UNLIKELY(fLockWrite) && ( rc == VINF_VD_ASYNC_IO_FINISHED 6055 || rc != VERR_VD_ASYNC_IO_IN_PROGRESS)) 6045 6056 { 6046 6057 rc2 = vdThreadFinishWrite(pDisk); … … 6088 6099 6089 6100 rc = vdIoCtxProcess(pIoCtx); 6101 if (rc == VINF_VD_ASYNC_IO_FINISHED) 6102 { 6103 if (ASMAtomicCmpXchgBool(&pIoCtx->fComplete, true, false)) 6104 vdIoCtxFree(pDisk, pIoCtx); 6105 else 6106 rc = VERR_VD_ASYNC_IO_IN_PROGRESS; /* Let the other handler complete the request. */ 6107 } 6108 else if (rc != VERR_VD_ASYNC_IO_IN_PROGRESS) /* Another error */ 6109 vdIoCtxFree(pDisk, pIoCtx); 6090 6110 } while (0); 6091 6111 6092 if (RT_UNLIKELY(fLockWrite) && RT_FAILURE(rc)) 6112 if (RT_UNLIKELY(fLockWrite) && ( rc == VINF_VD_ASYNC_IO_FINISHED 6113 || rc != VERR_VD_ASYNC_IO_IN_PROGRESS)) 6093 6114 { 6094 6115 rc2 = vdThreadFinishWrite(pDisk); 6095 6116 AssertRC(rc2); 6096 }6097 6098 if (RT_SUCCESS(rc))6099 {6100 if ( !pIoCtx->cbTransferLeft6101 && !pIoCtx->cMetaTransfersPending6102 && ASMAtomicCmpXchgBool(&pIoCtx->fComplete, true, false))6103 {6104 vdIoCtxFree(pDisk, pIoCtx);6105 rc = VINF_VD_ASYNC_IO_FINISHED;6106 }6107 else6108 {6109 LogFlow(("cbTransferLeft=%u cMetaTransfersPending=%u fComplete=%RTbool\n",6110 pIoCtx->cbTransferLeft, pIoCtx->cMetaTransfersPending,6111 pIoCtx->fComplete));6112 rc = VERR_VD_ASYNC_IO_IN_PROGRESS;6113 }6114 6117 } 6115 6118
Note:
See TracChangeset
for help on using the changeset viewer.