VirtualBox

Changeset 90814 in vbox


Ignore:
Timestamp:
Aug 23, 2021 8:14:15 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

    r90813 r90814  
    94379437    int rc;
    94389438    int rc2;
    9439     bool fLockWrite = false;
    94409439
    94419440    LogFlowFunc(("pDisk=%#p paRanges=%#p cRanges=%u\n",
    94429441                 pDisk, paRanges, cRanges));
     9442    /* sanity check */
     9443    AssertPtrReturn(pDisk, VERR_INVALID_POINTER);
     9444    AssertMsg(pDisk->u32Signature == VDISK_SIGNATURE, ("u32Signature=%08x\n", pDisk->u32Signature));
     9445
     9446    /* Check arguments. */
     9447    AssertReturn(cRanges > 0, VERR_INVALID_PARAMETER);
     9448    AssertPtrReturn(paRanges, VERR_INVALID_POINTER);
     9449
    94439450    do
    94449451    {
    9445         /* sanity check */
    9446         AssertPtrBreakStmt(pDisk, rc = VERR_INVALID_PARAMETER);
    9447         AssertMsg(pDisk->u32Signature == VDISK_SIGNATURE, ("u32Signature=%08x\n", pDisk->u32Signature));
    9448 
    9449         /* Check arguments. */
    9450         AssertMsgBreakStmt(cRanges,
    9451                            ("cRanges=%u\n", cRanges),
    9452                            rc = VERR_INVALID_PARAMETER);
    9453         AssertMsgBreakStmt(VALID_PTR(paRanges),
    9454                            ("paRanges=%#p\n", paRanges),
    9455                            rc = VERR_INVALID_PARAMETER);
    9456 
    94579452        rc2 = vdThreadStartWrite(pDisk);
    94589453        AssertRC(rc2);
    9459         fLockWrite = true;
    94609454
    94619455        AssertPtrBreakStmt(pDisk->pLast, rc = VERR_VD_NOT_OPENED);
     
    94809474    } while (0);
    94819475
    9482     if (RT_UNLIKELY(fLockWrite))
    9483     {
    9484         rc2 = vdThreadFinishWrite(pDisk);
    9485         AssertRC(rc2);
    9486     }
     9476    rc2 = vdThreadFinishWrite(pDisk);
     9477    AssertRC(rc2);
    94879478
    94889479    LogFlowFunc(("returns %Rrc\n", rc));
     
    94989489    int rc = VERR_VD_BLOCK_FREE;
    94999490    int rc2;
    9500     bool fLockRead = false;
    95019491    PVDIOCTX pIoCtx = NULL;
    95029492
     
    95049494                 pDisk, uOffset, pcSgBuf, cbRead, pvUser1, pvUser2));
    95059495
     9496    /* sanity check */
     9497    AssertPtrReturn(pDisk, VERR_INVALID_POINTER);
     9498    AssertMsg(pDisk->u32Signature == VDISK_SIGNATURE, ("u32Signature=%08x\n", pDisk->u32Signature));
     9499
     9500    /* Check arguments. */
     9501    AssertReturn(cbRead > 0, VERR_INVALID_PARAMETER);
     9502    AssertPtrReturn(pcSgBuf, VERR_INVALID_POINTER);
     9503
    95069504    do
    95079505    {
    9508         /* sanity check */
    9509         AssertPtrBreakStmt(pDisk, rc = VERR_INVALID_PARAMETER);
    9510         AssertMsg(pDisk->u32Signature == VDISK_SIGNATURE, ("u32Signature=%08x\n", pDisk->u32Signature));
    9511 
    9512         /* Check arguments. */
    9513         AssertMsgBreakStmt(cbRead,
    9514                            ("cbRead=%zu\n", cbRead),
    9515                            rc = VERR_INVALID_PARAMETER);
    9516         AssertMsgBreakStmt(VALID_PTR(pcSgBuf),
    9517                            ("pcSgBuf=%#p\n", pcSgBuf),
    9518                            rc = VERR_INVALID_PARAMETER);
    9519 
    95209506        rc2 = vdThreadStartRead(pDisk);
    95219507        AssertRC(rc2);
    9522         fLockRead = true;
    95239508
    95249509        AssertMsgBreakStmt(   uOffset < pDisk->cbSize
     
    95539538    } while (0);
    95549539
    9555     if (RT_UNLIKELY(fLockRead) && (rc != VERR_VD_ASYNC_IO_IN_PROGRESS))
     9540    if (rc != VERR_VD_ASYNC_IO_IN_PROGRESS)
    95569541    {
    95579542        rc2 = vdThreadFinishRead(pDisk);
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