VirtualBox

Changeset 27671 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Mar 24, 2010 3:45:38 PM (15 years ago)
Author:
vboxsync
Message:

SCSI: Fixes for the async I/O path

Location:
trunk/src/VBox/Devices/Storage
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/DrvSCSI.cpp

    r27665 r27671  
    197197    VSCSIIOREQTXDIR enmTxDir = VSCSIIoReqTxDirGet(hVScsiIoReq);
    198198
     199    LogFlowFunc(("Request hVScsiIoReq=%#p completed\n", hVScsiIoReq));
     200
    199201    if (enmTxDir == VSCSIIOREQTXDIR_READ)
    200202        pThis->pLed->Actual.s.fReading = 0;
     
    224226        VSCSIIOREQTXDIR enmTxDir;
    225227
     228        LogFlowFunc(("Enqueuing hVScsiIoReq=%#p\n", hVScsiIoReq));
     229
    226230        enmTxDir = VSCSIIoReqTxDirGet(hVScsiIoReq);
    227231
     
    231235            {
    232236                /** @todo Flush callback for the async I/O interface. */
     237                ASMAtomicDecU32(&pThis->StatIoDepth);
    233238                VSCSIIoReqCompleted(hVScsiIoReq, VINF_SUCCESS);
    234239                break;
     
    255260                    if (RT_FAILURE(rc))
    256261                        AssertMsgFailed(("%s: Failed to read data %Rrc\n", __FUNCTION__, rc));
    257                     STAM_REL_COUNTER_ADD(&pThis->StatBytesRead, cbSeg);
     262                    STAM_REL_COUNTER_ADD(&pThis->StatBytesRead, cbTransfer);
    258263                }
    259264                else
     
    265270                    if (RT_FAILURE(rc))
    266271                        AssertMsgFailed(("%s: Failed to write data %Rrc\n", __FUNCTION__, rc));
    267                     STAM_REL_COUNTER_ADD(&pThis->StatBytesWritten, cbSeg);
     272                    STAM_REL_COUNTER_ADD(&pThis->StatBytesWritten, cbTransfer);
     273                }
     274
     275                if (rc == VINF_VD_ASYNC_IO_FINISHED)
     276                {
     277                    if (enmTxDir == VSCSIIOREQTXDIR_READ)
     278                        pThis->pLed->Actual.s.fReading = 0;
     279                    else if (enmTxDir == VSCSIIOREQTXDIR_WRITE)
     280                        pThis->pLed->Actual.s.fWriting = 0;
     281                    else
     282                        AssertMsgFailed(("Invalid transfer direction %u\n", enmTxDir));
     283                    ASMAtomicDecU32(&pThis->StatIoDepth);
     284                    VSCSIIoReqCompleted(hVScsiIoReq, VINF_SUCCESS);
    268285                }
    269286
  • trunk/src/VBox/Devices/Storage/VSCSI/VSCSIIoReq.cpp

    r27653 r27671  
    4343    pVScsiIoReq->enmTxDir  = VSCSIIOREQTXDIR_FLUSH;
    4444
     45    ASMAtomicIncU32(&pVScsiLun->IoReq.cReqOutstanding);
     46
    4547    rc = vscsiLunReqTransferEnqueue(pVScsiLun, pVScsiIoReq);
    46     if (RT_SUCCESS(rc))
    47         ASMAtomicIncU32(&pVScsiLun->IoReq.cReqOutstanding);
    48     else
     48    if (RT_FAILURE(rc))
     49    {
     50        ASMAtomicDecU32(&pVScsiLun->IoReq.cReqOutstanding);
    4951        RTMemFree(pVScsiIoReq);
     52    }
    5053
    5154    return rc;
     
    7578    pVScsiIoReq->cSeg       = pVScsiReq->IoMemCtx.cSegments;
    7679
     80    ASMAtomicIncU32(&pVScsiLun->IoReq.cReqOutstanding);
     81
    7782    rc = vscsiLunReqTransferEnqueue(pVScsiLun, pVScsiIoReq);
    78     if (RT_SUCCESS(rc))
    79         ASMAtomicIncU32(&pVScsiLun->IoReq.cReqOutstanding);
    80     else
     83    if (RT_FAILURE(rc))
     84    {
     85        ASMAtomicDecU32(&pVScsiLun->IoReq.cReqOutstanding);
    8186        RTMemFree(pVScsiIoReq);
     87    }
    8288
    8389    return rc;
     
    99105
    100106    AssertPtrReturn(pVScsiIoReq, VERR_INVALID_HANDLE);
     107
     108    LogFlowFunc(("hVScsiIoReq=%#p rcIoReq=%Rrc\n", hVScsiIoReq, rcIoReq));
    101109
    102110    pVScsiLun = pVScsiIoReq->pVScsiLun;
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