VirtualBox

Ignore:
Timestamp:
Dec 13, 2018 7:26:25 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
127483
Message:

Runtime/fs: Started restructurin the ext2 filesystem code to indicate that it will be used for ext3/ext4 later on

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/vfs/vfsmount.cpp

    r73097 r76216  
    4545#include <iprt/formats/iso9660.h>
    4646#include <iprt/formats/udf.h>
    47 #include <iprt/formats/ext2.h>
     47#include <iprt/formats/ext.h>
    4848
    4949
     
    352352
    353353/**
    354  * Check if the given bootsector is an HPFS boot sector.
     354 * Check if the given bootsector is an ext2/3/4 super block.
    355355 *
    356356 * @returns true if NTFS, false if not.
    357357 * @param   pSuperBlock         The ext2 superblock.
    358358 */
    359 static bool rtVfsMountIsExt2(PCEXT2SUPERBLOCK pSuperBlock)
    360 {
    361     if (RT_LE2H_U16(pSuperBlock->u16Signature) != EXT2_SIGNATURE)
     359static bool rtVfsMountIsExt(PCEXTSUPERBLOCK pSuperBlock)
     360{
     361    if (RT_LE2H_U16(pSuperBlock->u16Signature) != EXT_SIGNATURE)
    362362        return false;
    363363
     
    365365    if (cShift > 54)
    366366    {
    367         Log2(("rtVfsMountIsExt2: cBitsShiftLeftBlockSize=%#x: out of range\n", cShift));
     367        Log2(("rtVfsMountIsExt: cBitsShiftLeftBlockSize=%#x: out of range\n", cShift));
    368368        return false;
    369369    }
     
    372372    if (cShift > 54)
    373373    {
    374         Log2(("rtVfsMountIsExt2: cBitsShiftLeftFragmentSize=%#x: out of range\n", cShift));
     374        Log2(("rtVfsMountIsExt: cBitsShiftLeftFragmentSize=%#x: out of range\n", cShift));
    375375        return false;
    376376    }
     
    435435    }
    436436
    437     AssertCompile(sizeof(*pBuf) >= 1024 + sizeof(EXT2SUPERBLOCK));
    438     if (rtVfsMountIsExt2((PCEXT2SUPERBLOCK)&pBuf->ab[1024]))
    439     {
    440         Log(("RTVfsMount: Detected ISO-9660 or UDF.\n"));
    441         return RTFsExt2VolOpen(hVfsFileIn, fFlags, 0 /*fExt2Flags*/, phVfs, pErrInfo);
     437    AssertCompile(sizeof(*pBuf) >= 1024 + sizeof(EXTSUPERBLOCK));
     438    if (rtVfsMountIsExt((PCEXTSUPERBLOCK)&pBuf->ab[1024]))
     439    {
     440        Log(("RTVfsMount: Detected EXT2/3/4.\n"));
     441        return RTFsExtVolOpen(hVfsFileIn, fFlags, 0 /*fExt2Flags*/, phVfs, pErrInfo);
    442442    }
    443443
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette