Changeset 90820 in vbox
- Timestamp:
- Aug 23, 2021 8:37:24 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Storage/VD.cpp
r90819 r90820 8139 8139 int rc2 = vdThreadStartWrite(pDisk); 8140 8140 AssertRC(rc2); 8141 bool fLockWrite = true;8142 8141 8143 8142 PVDCACHE pCache = pDisk->pCache; … … 8170 8169 Assert(!RT_VALID_PTR(pDisk->pLast)); 8171 8170 8172 if (RT_UNLIKELY(fLockWrite)) 8173 { 8174 rc2 = vdThreadFinishWrite(pDisk); 8175 AssertRC(rc2); 8176 } 8171 rc2 = vdThreadFinishWrite(pDisk); 8172 AssertRC(rc2); 8177 8173 8178 8174 LogFlowFunc(("returns %Rrc\n", rc)); … … 8183 8179 VBOXDDU_DECL(int) VDFilterRemoveAll(PVDISK pDisk) 8184 8180 { 8185 int rc = VINF_SUCCESS;8186 int rc2;8187 bool fLockWrite = false;8188 8189 8181 LogFlowFunc(("pDisk=%#p\n", pDisk)); 8190 do 8191 { 8192 /* sanity check */ 8193 AssertPtrBreakStmt(pDisk, rc = VERR_INVALID_PARAMETER); 8194 AssertMsg(pDisk->u32Signature == VDISK_SIGNATURE, ("u32Signature=%08x\n", pDisk->u32Signature)); 8195 8196 /* Lock the entire operation. */ 8197 rc2 = vdThreadStartWrite(pDisk); 8198 AssertRC(rc2); 8199 fLockWrite = true; 8200 8201 PVDFILTER pFilter, pFilterNext; 8202 RTListForEachSafe(&pDisk->ListFilterChainWrite, pFilter, pFilterNext, VDFILTER, ListNodeChainWrite) 8203 { 8204 RTListNodeRemove(&pFilter->ListNodeChainWrite); 8205 vdFilterRelease(pFilter); 8206 } 8207 8208 RTListForEachSafe(&pDisk->ListFilterChainRead, pFilter, pFilterNext, VDFILTER, ListNodeChainRead) 8209 { 8210 RTListNodeRemove(&pFilter->ListNodeChainRead); 8211 vdFilterRelease(pFilter); 8212 } 8213 Assert(RTListIsEmpty(&pDisk->ListFilterChainRead)); 8214 Assert(RTListIsEmpty(&pDisk->ListFilterChainWrite)); 8215 } while (0); 8216 8217 if (RT_UNLIKELY(fLockWrite)) 8218 { 8219 rc2 = vdThreadFinishWrite(pDisk); 8220 AssertRC(rc2); 8221 } 8222 8223 LogFlowFunc(("returns %Rrc\n", rc)); 8224 return rc; 8182 /* sanity check */ 8183 AssertPtrReturn(pDisk, VERR_INVALID_POINTER); 8184 AssertMsg(pDisk->u32Signature == VDISK_SIGNATURE, ("u32Signature=%08x\n", pDisk->u32Signature)); 8185 8186 /* Lock the entire operation. */ 8187 int rc2 = vdThreadStartWrite(pDisk); 8188 AssertRC(rc2); 8189 8190 PVDFILTER pFilter, pFilterNext; 8191 RTListForEachSafe(&pDisk->ListFilterChainWrite, pFilter, pFilterNext, VDFILTER, ListNodeChainWrite) 8192 { 8193 RTListNodeRemove(&pFilter->ListNodeChainWrite); 8194 vdFilterRelease(pFilter); 8195 } 8196 8197 RTListForEachSafe(&pDisk->ListFilterChainRead, pFilter, pFilterNext, VDFILTER, ListNodeChainRead) 8198 { 8199 RTListNodeRemove(&pFilter->ListNodeChainRead); 8200 vdFilterRelease(pFilter); 8201 } 8202 Assert(RTListIsEmpty(&pDisk->ListFilterChainRead)); 8203 Assert(RTListIsEmpty(&pDisk->ListFilterChainWrite)); 8204 8205 rc2 = vdThreadFinishWrite(pDisk); 8206 AssertRC(rc2); 8207 8208 LogFlowFunc(("returns %Rrc\n", VINF_SUCCESS)); 8209 return VINF_SUCCESS; 8225 8210 } 8226 8211 … … 8292 8277 int rc = VINF_SUCCESS; 8293 8278 int rc2; 8294 bool fLockWrite = false;8295 8279 8296 8280 LogFlowFunc(("pDisk=%#p uOffset=%llu pvBuf=%p cbWrite=%zu\n", … … 8308 8292 rc2 = vdThreadStartWrite(pDisk); 8309 8293 AssertRC(rc2); 8310 fLockWrite = true;8311 8294 8312 8295 AssertMsgBreakStmt( uOffset < pDisk->cbSize … … 8338 8321 } while (0); 8339 8322 8340 if (RT_UNLIKELY(fLockWrite)) 8341 { 8342 rc2 = vdThreadFinishWrite(pDisk); 8343 AssertRC(rc2); 8344 } 8323 rc2 = vdThreadFinishWrite(pDisk); 8324 AssertRC(rc2); 8345 8325 8346 8326 LogFlowFunc(("returns %Rrc\n", rc)); … … 8353 8333 int rc = VINF_SUCCESS; 8354 8334 int rc2; 8355 bool fLockWrite = false;8356 8335 8357 8336 LogFlowFunc(("pDisk=%#p\n", pDisk)); 8337 /* sanity check */ 8338 AssertPtrReturn(pDisk, VERR_INVALID_POINTER); 8339 AssertMsg(pDisk->u32Signature == VDISK_SIGNATURE, ("u32Signature=%08x\n", pDisk->u32Signature)); 8340 8358 8341 do 8359 8342 { 8360 /* sanity check */8361 AssertPtrBreakStmt(pDisk, rc = VERR_INVALID_PARAMETER);8362 AssertMsg(pDisk->u32Signature == VDISK_SIGNATURE, ("u32Signature=%08x\n", pDisk->u32Signature));8363 8364 8343 rc2 = vdThreadStartWrite(pDisk); 8365 8344 AssertRC(rc2); 8366 fLockWrite = true;8367 8345 8368 8346 PVDIMAGE pImage = pDisk->pLast; … … 8387 8365 } while (0); 8388 8366 8389 if (RT_UNLIKELY(fLockWrite)) 8390 { 8391 rc2 = vdThreadFinishWrite(pDisk); 8392 AssertRC(rc2); 8393 } 8367 rc2 = vdThreadFinishWrite(pDisk); 8368 AssertRC(rc2); 8394 8369 8395 8370 LogFlowFunc(("returns %Rrc\n", rc));
Note:
See TracChangeset
for help on using the changeset viewer.