VirtualBox

Changeset 90820 in vbox


Ignore:
Timestamp:
Aug 23, 2021 8:37:24 PM (3 years ago)
Author:
vboxsync
Message:

Storage: More VALID_PTR -> RT_VALID_PTR/AssertPtr.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Storage/VD.cpp

    r90819 r90820  
    81398139    int rc2 = vdThreadStartWrite(pDisk);
    81408140    AssertRC(rc2);
    8141     bool fLockWrite = true;
    81428141
    81438142    PVDCACHE pCache = pDisk->pCache;
     
    81708169    Assert(!RT_VALID_PTR(pDisk->pLast));
    81718170
    8172     if (RT_UNLIKELY(fLockWrite))
    8173     {
    8174         rc2 = vdThreadFinishWrite(pDisk);
    8175         AssertRC(rc2);
    8176     }
     8171    rc2 = vdThreadFinishWrite(pDisk);
     8172    AssertRC(rc2);
    81778173
    81788174    LogFlowFunc(("returns %Rrc\n", rc));
     
    81838179VBOXDDU_DECL(int) VDFilterRemoveAll(PVDISK pDisk)
    81848180{
    8185     int rc = VINF_SUCCESS;
    8186     int rc2;
    8187     bool fLockWrite = false;
    8188 
    81898181    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;
    82258210}
    82268211
     
    82928277    int rc = VINF_SUCCESS;
    82938278    int rc2;
    8294     bool fLockWrite = false;
    82958279
    82968280    LogFlowFunc(("pDisk=%#p uOffset=%llu pvBuf=%p cbWrite=%zu\n",
     
    83088292        rc2 = vdThreadStartWrite(pDisk);
    83098293        AssertRC(rc2);
    8310         fLockWrite = true;
    83118294
    83128295        AssertMsgBreakStmt(   uOffset < pDisk->cbSize
     
    83388321    } while (0);
    83398322
    8340     if (RT_UNLIKELY(fLockWrite))
    8341     {
    8342         rc2 = vdThreadFinishWrite(pDisk);
    8343         AssertRC(rc2);
    8344     }
     8323    rc2 = vdThreadFinishWrite(pDisk);
     8324    AssertRC(rc2);
    83458325
    83468326    LogFlowFunc(("returns %Rrc\n", rc));
     
    83538333    int rc = VINF_SUCCESS;
    83548334    int rc2;
    8355     bool fLockWrite = false;
    83568335
    83578336    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
    83588341    do
    83598342    {
    8360         /* sanity check */
    8361         AssertPtrBreakStmt(pDisk, rc = VERR_INVALID_PARAMETER);
    8362         AssertMsg(pDisk->u32Signature == VDISK_SIGNATURE, ("u32Signature=%08x\n", pDisk->u32Signature));
    8363 
    83648343        rc2 = vdThreadStartWrite(pDisk);
    83658344        AssertRC(rc2);
    8366         fLockWrite = true;
    83678345
    83688346        PVDIMAGE pImage = pDisk->pLast;
     
    83878365    } while (0);
    83888366
    8389     if (RT_UNLIKELY(fLockWrite))
    8390     {
    8391         rc2 = vdThreadFinishWrite(pDisk);
    8392         AssertRC(rc2);
    8393     }
     8367    rc2 = vdThreadFinishWrite(pDisk);
     8368    AssertRC(rc2);
    83948369
    83958370    LogFlowFunc(("returns %Rrc\n", rc));
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