VirtualBox

Changeset 76256 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Dec 16, 2018 8:36:28 PM (6 years ago)
Author:
vboxsync
Message:

Runtime/formats/ext: Add more structures

Location:
trunk/src/VBox/Runtime/common
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/fs/extvfs.cpp

    r76221 r76256  
    126126    }
    127127
    128     uint64_t           offRead = (pThis->iSbBlock + 1) * pThis->cbBlock;
    129     EXTBLOCKGROUPDESC  BlkDesc;
     128    uint64_t            offRead = (pThis->iSbBlock + 1) * pThis->cbBlock;
     129    EXTBLOCKGROUPDESC32 BlkDesc;
    130130    int rc = RTVfsFileReadAt(pThis->hVfsBacking, offRead, &BlkDesc, sizeof(BlkDesc), NULL);
    131131    if (RT_SUCCESS(rc))
     
    133133        pBlkGrpDesc->offStart = pThis->iSbBlock + (uint64_t)iBlkGrp * pThis->cBlocksPerGroup * pThis->cbBlock;
    134134        pBlkGrpDesc->offLast  = pBlkGrpDesc->offStart + pThis->cBlocksPerGroup * pThis->cbBlock;
    135         rc = RTVfsFileReadAt(pThis->hVfsBacking, BlkDesc.offBlockBitmap * pThis->cbBlock,
     135        rc = RTVfsFileReadAt(pThis->hVfsBacking, BlkDesc.offBlockBitmapLow * pThis->cbBlock,
    136136                             &pBlkGrpDesc->abBlockBitmap[0], cbBlockBitmap, NULL);
    137137    }
     
    279279            /** @todo Convert to host endianess. */
    280280#endif
    281             if (SuperBlock.u16FilesystemState == EXT_STATE_ERRORS)
     281            if (SuperBlock.u16FilesystemState == EXT_SB_STATE_ERRORS)
    282282                rc = RTERRINFO_LOG_SET(pErrInfo, VERR_FILESYSTEM_CORRUPT, "EXT_STATE_ERRORS");
    283283            else
    284284            {
    285285                pThis->iSbBlock = SuperBlock.iBlockOfSuperblock;
    286                 pThis->cbBlock = 1024 << SuperBlock.cBitsShiftLeftBlockSize;
     286                pThis->cbBlock = 1024 << SuperBlock.cLogBlockSize;
    287287                pThis->cBlocksPerGroup = SuperBlock.cBlocksPerGroup;
    288                 pThis->cBlockGroups = SuperBlock.cBlocksTotal / pThis->cBlocksPerGroup;
     288                pThis->cBlockGroups = SuperBlock.cBlocksTotalLow / pThis->cBlocksPerGroup;
    289289
    290290                /* Load first block group descriptor. */
  • trunk/src/VBox/Runtime/common/vfs/vfsmount.cpp

    r76216 r76256  
    359359static bool rtVfsMountIsExt(PCEXTSUPERBLOCK pSuperBlock)
    360360{
    361     if (RT_LE2H_U16(pSuperBlock->u16Signature) != EXT_SIGNATURE)
    362         return false;
    363 
    364     uint32_t cShift = RT_LE2H_U32(pSuperBlock->cBitsShiftLeftBlockSize);
     361    if (RT_LE2H_U16(pSuperBlock->u16Signature) != EXT_SB_SIGNATURE)
     362        return false;
     363
     364    uint32_t cShift = RT_LE2H_U32(pSuperBlock->cLogBlockSize);
    365365    if (cShift > 54)
    366366    {
    367         Log2(("rtVfsMountIsExt: cBitsShiftLeftBlockSize=%#x: out of range\n", cShift));
    368         return false;
    369     }
    370 
    371     cShift = RT_LE2H_U32(pSuperBlock->cBitsShiftLeftFragmentSize);
     367        Log2(("rtVfsMountIsExt: cLogBlockSize=%#x: out of range\n", cShift));
     368        return false;
     369    }
     370
     371    cShift = RT_LE2H_U32(pSuperBlock->cLogClusterSize);
    372372    if (cShift > 54)
    373373    {
    374         Log2(("rtVfsMountIsExt: cBitsShiftLeftFragmentSize=%#x: out of range\n", cShift));
     374        Log2(("rtVfsMountIsExt: cLogClusterSize=%#x: out of range\n", cShift));
    375375        return false;
    376376    }
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