Changeset 59305 in vbox
- Timestamp:
- Jan 10, 2016 8:38:50 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/err.h
r59299 r59305 1467 1467 #define VERR_PDM_MEDIAEX_IOBUF_OVERFLOW (-2894) 1468 1468 /** There is not enough data to satisfy the request. */ 1469 #define VERR_PDM_MEDIAEX_IOBUF_UNDER FLOW(-2895)1469 #define VERR_PDM_MEDIAEX_IOBUF_UNDERRUN (-2895) 1470 1470 /** The I/O request ID is already existing. */ 1471 1471 #define VERR_PDM_MEDIAEX_IOREQID_CONFLICT (-2896) -
trunk/include/VBox/vmm/pdmstorageifs.h
r59291 r59305 571 571 typedef uint64_t PDMMEDIAEXIOREQID; 572 572 573 /** 574 * I/O Request Type. 575 */ 576 typedef enum PDMMEDIAEXIOREQTYPE 577 { 578 /** Invalid tpe. */ 579 PDMMEDIAEXIOREQTYPE_INVALID = 0, 580 /** Flush request. */ 581 PDMMEDIAEXIOREQTYPE_FLUSH, 582 /** Write request. */ 583 PDMMEDIAEXIOREQTYPE_WRITE, 584 /** Read request. */ 585 PDMMEDIAEXIOREQTYPE_READ, 586 /** Discard request. */ 587 PDMMEDIAEXIOREQTYPE_DISCARD 588 } PDMMEDIAEXIOREQTYPE; 589 573 590 /** @name I/O request specific flags 574 591 * @{ */ … … 623 640 * 624 641 * @returns VBox status code. 625 * @retval VERR_PDM_MEDIAEX_IOBUF_UNDER FLOWif there is not enough data to copy from the buffer.642 * @retval VERR_PDM_MEDIAEX_IOBUF_UNDERRUN if there is not enough data to copy from the buffer. 626 643 * @param pInterface Pointer to the interface structure containing the called function pointer. 627 644 * @param hIoReq The I/O request handle. -
trunk/src/VBox/Devices/Storage/DrvVD.cpp
r59290 r59305 140 140 141 141 /** 142 * VD I/O Request Type.143 */144 typedef enum VDIOREQTYPE145 {146 /** Invalid tpe. */147 VDIOREQTYPE_INVALID = 0,148 /** Flush request. */149 VDIOREQTYPE_FLUSH,150 /** Write request. */151 VDIOREQTYPE_WRITE,152 /** Read request. */153 VDIOREQTYPE_READ,154 /** Discard request. */155 VDIOREQTYPE_DISCARD156 } VDIOREQTYPE;157 158 /**159 142 * VD I/O request state. 160 143 */ … … 188 171 RTLISTNODE NdAllocatedList; 189 172 /** I/O request type. */ 190 VDIOREQTYPEenmType;173 PDMMEDIAEXIOREQTYPE enmType; 191 174 /** Request state. */ 192 175 volatile VDIOREQSTATE enmState; … … 2804 2787 static void drvvdMediaExIoReqBufFree(PVBOXDISK pThis, PPDMMEDIAEXIOREQINT pIoReq) 2805 2788 { 2806 if (pThis->pCfgCrypto) 2807 RTMemSaferFree(pIoReq->DataSeg.pvSeg, pIoReq->DataSeg.cbSeg); 2808 else 2809 { 2810 size_t cb = RT_ALIGN_Z(pIoReq->DataSeg.cbSeg, _4K); 2811 RTMemPageFree(pIoReq->DataSeg.pvSeg, cb); 2789 if (pIoReq->DataSeg.pvSeg) 2790 { 2791 if (pThis->pCfgCrypto) 2792 RTMemSaferFree(pIoReq->DataSeg.pvSeg, pIoReq->DataSeg.cbSeg); 2793 else 2794 { 2795 size_t cb = RT_ALIGN_Z(pIoReq->DataSeg.cbSeg, _4K); 2796 RTMemPageFree(pIoReq->DataSeg.pvSeg, cb); 2797 } 2812 2798 } 2813 2799 } … … 2831 2817 2832 2818 if ( RT_SUCCESS(rcReq) 2833 && pIoReq->enmType == VDIOREQTYPE_READ)2819 && pIoReq->enmType == PDMMEDIAEXIOREQTYPE_READ) 2834 2820 { 2835 2821 /* Sync memory buffer with caller. */ … … 2895 2881 return VERR_NO_MEMORY; 2896 2882 2897 pIoReq->uIoReqId = uIoReqId; 2898 pIoReq->fFlags = fFlags; 2899 pIoReq->pDisk = pThis; 2900 pIoReq->enmState = VDIOREQSTATE_ALLOCATED; 2901 pIoReq->enmType = VDIOREQTYPE_INVALID; 2883 pIoReq->uIoReqId = uIoReqId; 2884 pIoReq->fFlags = fFlags; 2885 pIoReq->pDisk = pThis; 2886 pIoReq->enmState = VDIOREQSTATE_ALLOCATED; 2887 pIoReq->enmType = PDMMEDIAEXIOREQTYPE_INVALID; 2888 pIoReq->DataSeg.pvSeg = NULL; 2889 pIoReq->DataSeg.cbSeg = 0; 2902 2890 2903 2891 int rc = drvvdMediaExIoReqInsert(pThis, pIoReq); … … 2996 2984 VDIOREQSTATE enmState = (VDIOREQSTATE)ASMAtomicReadU32((volatile uint32_t *)&pIoReq->enmState); 2997 2985 2998 if (RT_UNLIKELY(enmState != VDIOREQSTATE_CANCELED))2986 if (RT_UNLIKELY(enmState == VDIOREQSTATE_CANCELED)) 2999 2987 return VERR_PDM_MEDIAEX_IOREQ_CANCELED; 3000 2988 … … 3002 2990 return VERR_PDM_MEDIAEX_IOREQ_INVALID_STATE; 3003 2991 3004 pIoReq->enmType = VDIOREQTYPE_READ;2992 pIoReq->enmType = PDMMEDIAEXIOREQTYPE_READ; 3005 2993 /* Allocate a suitable I/O buffer for this request. */ 3006 2994 int rc = drvvdMediaExIoReqBufAlloc(pThis, pIoReq, cbRead); … … 3038 3026 VDIOREQSTATE enmState = (VDIOREQSTATE)ASMAtomicReadU32((volatile uint32_t *)&pIoReq->enmState); 3039 3027 3040 if (RT_UNLIKELY(enmState != VDIOREQSTATE_CANCELED))3028 if (RT_UNLIKELY(enmState == VDIOREQSTATE_CANCELED)) 3041 3029 return VERR_PDM_MEDIAEX_IOREQ_CANCELED; 3042 3030 … … 3044 3032 return VERR_PDM_MEDIAEX_IOREQ_INVALID_STATE; 3045 3033 3046 pIoReq->enmType = VDIOREQTYPE_WRITE;3034 pIoReq->enmType = PDMMEDIAEXIOREQTYPE_WRITE; 3047 3035 /* Allocate a suitable I/O buffer for this request. */ 3048 3036 int rc = drvvdMediaExIoReqBufAlloc(pThis, pIoReq, cbWrite); … … 3062 3050 3063 3051 ASMAtomicIncU32(&pThis->cIoReqsActive); 3064 rc = VDAsync Read(pThis->pDisk, off, cbWrite, &pIoReq->SgBuf,3065 drvvdMediaExIoReqComplete, pThis, pIoReq);3052 rc = VDAsyncWrite(pThis->pDisk, off, cbWrite, &pIoReq->SgBuf, 3053 drvvdMediaExIoReqComplete, pThis, pIoReq); 3066 3054 if (rc == VERR_VD_ASYNC_IO_IN_PROGRESS) 3067 3055 rc = VINF_PDM_MEDIAEX_IOREQ_IN_PROGRESS; … … 3086 3074 VDIOREQSTATE enmState = (VDIOREQSTATE)ASMAtomicReadU32((volatile uint32_t *)&pIoReq->enmState); 3087 3075 3088 if (RT_UNLIKELY(enmState != VDIOREQSTATE_CANCELED))3076 if (RT_UNLIKELY(enmState == VDIOREQSTATE_CANCELED)) 3089 3077 return VERR_PDM_MEDIAEX_IOREQ_CANCELED; 3090 3078 … … 3092 3080 return VERR_PDM_MEDIAEX_IOREQ_INVALID_STATE; 3093 3081 3094 pIoReq->enmType = VDIOREQTYPE_FLUSH;3082 pIoReq->enmType = PDMMEDIAEXIOREQTYPE_FLUSH; 3095 3083 3096 3084 bool fXchg = ASMAtomicCmpXchgU32((volatile uint32_t *)&pIoReq->enmState, VDIOREQSTATE_ACTIVE, VDIOREQSTATE_ALLOCATED); … … 3124 3112 VDIOREQSTATE enmState = (VDIOREQSTATE)ASMAtomicReadU32((volatile uint32_t *)&pIoReq->enmState); 3125 3113 3126 if (RT_UNLIKELY(enmState != VDIOREQSTATE_CANCELED))3114 if (RT_UNLIKELY(enmState == VDIOREQSTATE_CANCELED)) 3127 3115 return VERR_PDM_MEDIAEX_IOREQ_CANCELED; 3128 3116 … … 3130 3118 return VERR_PDM_MEDIAEX_IOREQ_INVALID_STATE; 3131 3119 3132 pIoReq->enmType = VDIOREQTYPE_DISCARD;3120 pIoReq->enmType = PDMMEDIAEXIOREQTYPE_DISCARD; 3133 3121 3134 3122 bool fXchg = ASMAtomicCmpXchgU32((volatile uint32_t *)&pIoReq->enmState, VDIOREQSTATE_ACTIVE, VDIOREQSTATE_ALLOCATED); -
trunk/src/VBox/Devices/testcase/tstDeviceStructSizeRC.cpp
r59248 r59305 1958 1958 GEN_CHECK_OFF(NVMEQUEUESUBM, hEvtProcess); 1959 1959 GEN_CHECK_OFF(NVMEQUEUESUBM, pWrkThrdR3); 1960 GEN_CHECK_OFF(NVMEQUEUESUBM, CritSectIoReqsActive);1961 1960 GEN_CHECK_OFF(NVMEQUEUESUBM, NdLstWrkThrdAssgnd); 1962 1961 GEN_CHECK_OFF(NVMEQUEUESUBM, cReqsActive); 1963 GEN_CHECK_OFF(NVMEQUEUESUBM, LstIoReqsActive);1964 1962 1965 1963 GEN_CHECK_SIZE(NVMEQUEUECOMP);
Note:
See TracChangeset
for help on using the changeset viewer.