ReactOS  0.4.13-dev-482-ge57f103
ext2.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


struct  ext2_sblock
struct  ext2_block_group
struct  ext2_inode
struct  ext2_dirent
struct  EXT2_FILE_INFO


#define EXT2_MAGIC   0xEF53
#define INDIRECT_BLOCKS   12
#define EXT2_PATH_MAX   4096
#define EXT2_GOOD_OLD_INODE_SIZE   128
#define FILETYPE_REG   1
#define FILETYPE_INO_MASK   0170000
#define FILETYPE_INO_REG   0100000
#define FILETYPE_INO_DIRECTORY   0040000
#define FILETYPE_INO_SYMLINK   0120000
#define EXT2_NAME_LEN   255
#define EXT2_ROOT_INO   2
#define LOG2_BLOCK_SIZE(sb)   (sb->log2_block_size + 10)
#define EXT2_BLOCK_SIZE(sb)   (((SIZE_T)1) << LOG2_BLOCK_SIZE(sb))
#define EXT2_REVISION(sb)   (sb->revision_level)
#define EXT2_INODE_SIZE(sb)
#define EXT2_DESC_PER_BLOCK(s)   (EXT2_BLOCK_SIZE(s) / sizeof(struct ext2_block_group))
#define EXT2_S_IRWXO   0x0007
#define EXT2_S_IXOTH   0x0001
#define EXT2_S_IWOTH   0x0002
#define EXT2_S_IROTH   0x0004
#define EXT2_S_IRWXG   0x0038
#define EXT2_S_IXGRP   0x0008
#define EXT2_S_IWGRP   0x0010
#define EXT2_S_IRGRP   0x0020
#define EXT2_S_IRWXU   0x01C0
#define EXT2_S_IXUSR   0x0040
#define EXT2_S_IWUSR   0x0080
#define EXT2_S_IRUSR   0x0100
#define EXT2_S_ISVTX   0x0200
#define EXT2_S_ISGID   0x0400
#define EXT2_S_ISUID   0x0800
#define EXT2_S_IFMT   0xF000
#define EXT2_S_IFIFO   0x1000
#define EXT2_S_IFCHR   0x2000
#define EXT2_S_IFDIR   0x4000
#define EXT2_S_IFBLK   0x6000
#define EXT2_S_IFREG   0x8000
#define EXT2_S_IFLNK   0xA000
#define EXT2_S_IFSOCK   0xC000


typedef struct ext2_sblock EXT2_SUPER_BLOCK
typedef struct ext2_sblockPEXT2_SUPER_BLOCK
typedef struct ext2_inode EXT2_INODE
typedef struct ext2_inodePEXT2_INODE
typedef struct ext2_block_group EXT2_GROUP_DESC
typedef struct ext2_block_groupPEXT2_GROUP_DESC
typedef struct ext2_dirent EXT2_DIR_ENTRY
typedef struct ext2_direntPEXT2_DIR_ENTRY


const DEVVTBLExt2Mount (ULONG DeviceId)

Macro Definition Documentation


#define EXT2_BLOCK_SIZE (   sb)    (((SIZE_T)1) << LOG2_BLOCK_SIZE(sb))

Definition at line 186 of file ext2.h.


#define EXT2_DESC_PER_BLOCK (   s)    (EXT2_BLOCK_SIZE(s) / sizeof(struct ext2_block_group))

Definition at line 196 of file ext2.h.



Definition at line 53 of file ext2.h.


#define EXT2_GOOD_OLD_INODE_SIZE   128

Definition at line 54 of file ext2.h.



Definition at line 52 of file ext2.h.


#define EXT2_INODE_SIZE (   sb)
: sb->inode_size)
superblock * sb
Definition: btrfs.c:3952
#define EXT2_REVISION(sb)
Definition: ext2.h:189
Definition: ext2.h:54
Definition: ext2.h:52

Definition at line 192 of file ext2.h.


#define EXT2_MAGIC   0xEF53

Definition at line 43 of file ext2.h.



Definition at line 49 of file ext2.h.


#define EXT2_NAME_LEN   255

Definition at line 156 of file ext2.h.


#define EXT2_PATH_MAX   4096

Definition at line 47 of file ext2.h.


#define EXT2_REVISION (   sb)    (sb->revision_level)

Definition at line 189 of file ext2.h.


#define EXT2_ROOT_INO   2

Definition at line 177 of file ext2.h.


#define EXT2_S_IFBLK   0x6000

Definition at line 222 of file ext2.h.


#define EXT2_S_IFCHR   0x2000

Definition at line 220 of file ext2.h.


#define EXT2_S_IFDIR   0x4000

Definition at line 221 of file ext2.h.


#define EXT2_S_IFIFO   0x1000

Definition at line 219 of file ext2.h.


#define EXT2_S_IFLNK   0xA000

Definition at line 224 of file ext2.h.


#define EXT2_S_IFMT   0xF000

Definition at line 218 of file ext2.h.


#define EXT2_S_IFREG   0x8000

Definition at line 223 of file ext2.h.


#define EXT2_S_IFSOCK   0xC000

Definition at line 225 of file ext2.h.


#define EXT2_S_IRGRP   0x0020

Definition at line 207 of file ext2.h.


#define EXT2_S_IROTH   0x0004

Definition at line 202 of file ext2.h.


#define EXT2_S_IRUSR   0x0100

Definition at line 212 of file ext2.h.


#define EXT2_S_IRWXG   0x0038

Definition at line 204 of file ext2.h.


#define EXT2_S_IRWXO   0x0007

Definition at line 199 of file ext2.h.


#define EXT2_S_IRWXU   0x01C0

Definition at line 209 of file ext2.h.


#define EXT2_S_ISGID   0x0400

Definition at line 215 of file ext2.h.


#define EXT2_S_ISUID   0x0800

Definition at line 216 of file ext2.h.


#define EXT2_S_ISVTX   0x0200

Definition at line 214 of file ext2.h.


#define EXT2_S_IWGRP   0x0010

Definition at line 206 of file ext2.h.


#define EXT2_S_IWOTH   0x0002

Definition at line 201 of file ext2.h.


#define EXT2_S_IWUSR   0x0080

Definition at line 211 of file ext2.h.


#define EXT2_S_IXGRP   0x0008

Definition at line 205 of file ext2.h.


#define EXT2_S_IXOTH   0x0001

Definition at line 200 of file ext2.h.


#define EXT2_S_IXUSR   0x0040

Definition at line 210 of file ext2.h.



Definition at line 180 of file ext2.h.



Definition at line 227 of file ext2.h.



Definition at line 59 of file ext2.h.


#define FILETYPE_INO_DIRECTORY   0040000

Definition at line 65 of file ext2.h.


#define FILETYPE_INO_MASK   0170000

Definition at line 63 of file ext2.h.


#define FILETYPE_INO_REG   0100000

Definition at line 64 of file ext2.h.


#define FILETYPE_INO_SYMLINK   0120000

Definition at line 66 of file ext2.h.


#define FILETYPE_REG   1

Definition at line 58 of file ext2.h.



Definition at line 60 of file ext2.h.



Definition at line 57 of file ext2.h.


#define INDIRECT_BLOCKS   12

Definition at line 45 of file ext2.h.


#define LOG2_BLOCK_SIZE (   sb)    (sb->log2_block_size + 10)

Definition at line 183 of file ext2.h.

Typedef Documentation


Definition at line 174 of file ext2.h.


Definition at line 173 of file ext2.h.


Definition at line 172 of file ext2.h.


Definition at line 171 of file ext2.h.


Definition at line 174 of file ext2.h.



Definition at line 173 of file ext2.h.


Definition at line 172 of file ext2.h.


Definition at line 171 of file ext2.h.

Function Documentation

◆ Ext2Mount()

const DEVVTBL* Ext2Mount ( ULONG  DeviceId)

Definition at line 1300 of file ext2.c.

1301 {
1302  EXT2_SUPER_BLOCK SuperBlock;
1304  ULONG Count;
1307  //
1308  // Read the SuperBlock
1309  //
1310  Position.HighPart = 0;
1311  Position.LowPart = 2 * 512;
1312  Status = ArcSeek(DeviceId, &Position, SeekAbsolute);
1313  if (Status != ESUCCESS)
1314  return NULL;
1315  Status = ArcRead(DeviceId, &SuperBlock, sizeof(SuperBlock), &Count);
1316  if (Status != ESUCCESS || Count != sizeof(SuperBlock))
1317  return NULL;
1319  //
1320  // Check if SuperBlock is valid. If yes, return Ext2 function table
1321  //
1322  if (SuperBlock.magic == EXT2_MAGIC)
1323  {
1324  //
1325  // Compatibility hack as long as FS is not using underlying device DeviceId
1326  //
1327  UCHAR DriveNumber;
1328  ULONGLONG StartSector;
1330  int Type;
1331  if (!DiskGetBootVolume(&DriveNumber, &StartSector, &SectorCount, &Type))
1332  return NULL;
1333  Ext2OpenVolume(DriveNumber, StartSector, SectorCount);
1334  return &Ext2FuncTable;
1335  }
1336  else
1337  return NULL;
1338 }
Definition: Type.h:6
Definition: arc.h:32
static COORD Position
Definition: mouse.c:34
BOOLEAN DiskGetBootVolume(PUCHAR DriveNumber, PULONGLONG StartSector, PULONGLONG SectorCount, int *FsType)
Definition: ext2.c:72
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
Definition: arc.h:4
BOOLEAN Ext2OpenVolume(UCHAR DriveNumber, ULONGLONG VolumeStartSector, ULONGLONG PartitionSectorCount)
Definition: ext2.c:81
#define EXT2_MAGIC
Definition: ext2.h:43
smooth NULL
Definition: ftsmooth.c:416
USHORT magic
Definition: ext2.h:86
uint64_t ULONGLONG
Definition: typedefs.h:65
Definition: fs.c:237
unsigned char UCHAR
Definition: xmlstorage.h:181
Definition: fs.c:244
ULONG SectorCount
Definition: part_xbox.c:32
Definition: gdiplustypes.h:24
unsigned int ULONG
Definition: retypes.h:1
const DEVVTBL Ext2FuncTable
Definition: ext2.c:1290

Referenced by ArcOpen().