ReactOS  0.4.14-dev-114-gc8cbd56
ext2.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ext2_sblock
 
struct  ext2_block_group
 
struct  ext2_inode
 
struct  ext2_dirent
 
struct  EXT2_FILE_INFO
 

Macros

#define EXT2_MAGIC   0xEF53
 
#define INDIRECT_BLOCKS   12
 
#define EXT2_PATH_MAX   4096
 
#define EXT2_MAX_SYMLINKCNT   8
 
#define EXT2_GOOD_OLD_REVISION   0
 
#define EXT2_DYNAMIC_REVISION   1
 
#define EXT2_GOOD_OLD_INODE_SIZE   128
 
#define FILETYPE_UNKNOWN   0
 
#define FILETYPE_REG   1
 
#define FILETYPE_DIRECTORY   2
 
#define FILETYPE_SYMLINK   7
 
#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 EXT3_FEATURE_INCOMPAT_SUPP   0x0002
 
#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
 
#define FAST_SYMLINK_MAX_NAME_SIZE   60
 

Typedefs

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
 
typedef struct _EXT2_VOLUME_INFOPEXT2_VOLUME_INFO
 
typedef struct EXT2_FILE_INFOPEXT2_FILE_INFO
 

Functions

const DEVVTBLExt2Mount (ULONG DeviceId)
 

Macro Definition Documentation

◆ EXT2_BLOCK_SIZE

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

Definition at line 186 of file ext2.h.

◆ EXT2_DESC_PER_BLOCK

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

Definition at line 196 of file ext2.h.

◆ EXT2_DYNAMIC_REVISION

#define EXT2_DYNAMIC_REVISION   1

Definition at line 53 of file ext2.h.

◆ EXT2_GOOD_OLD_INODE_SIZE

#define EXT2_GOOD_OLD_INODE_SIZE   128

Definition at line 54 of file ext2.h.

◆ EXT2_GOOD_OLD_REVISION

#define EXT2_GOOD_OLD_REVISION   0

Definition at line 52 of file ext2.h.

◆ EXT2_INODE_SIZE

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

Definition at line 192 of file ext2.h.

◆ EXT2_MAGIC

#define EXT2_MAGIC   0xEF53

Definition at line 43 of file ext2.h.

◆ EXT2_MAX_SYMLINKCNT

#define EXT2_MAX_SYMLINKCNT   8

Definition at line 49 of file ext2.h.

◆ EXT2_NAME_LEN

#define EXT2_NAME_LEN   255

Definition at line 156 of file ext2.h.

◆ EXT2_PATH_MAX

#define EXT2_PATH_MAX   4096

Definition at line 47 of file ext2.h.

◆ EXT2_REVISION

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

Definition at line 189 of file ext2.h.

◆ EXT2_ROOT_INO

#define EXT2_ROOT_INO   2

Definition at line 177 of file ext2.h.

◆ EXT2_S_IFBLK

#define EXT2_S_IFBLK   0x6000

Definition at line 222 of file ext2.h.

◆ EXT2_S_IFCHR

#define EXT2_S_IFCHR   0x2000

Definition at line 220 of file ext2.h.

◆ EXT2_S_IFDIR

#define EXT2_S_IFDIR   0x4000

Definition at line 221 of file ext2.h.

◆ EXT2_S_IFIFO

#define EXT2_S_IFIFO   0x1000

Definition at line 219 of file ext2.h.

◆ EXT2_S_IFLNK

#define EXT2_S_IFLNK   0xA000

Definition at line 224 of file ext2.h.

◆ EXT2_S_IFMT

#define EXT2_S_IFMT   0xF000

Definition at line 218 of file ext2.h.

◆ EXT2_S_IFREG

#define EXT2_S_IFREG   0x8000

Definition at line 223 of file ext2.h.

◆ EXT2_S_IFSOCK

#define EXT2_S_IFSOCK   0xC000

Definition at line 225 of file ext2.h.

◆ EXT2_S_IRGRP

#define EXT2_S_IRGRP   0x0020

Definition at line 207 of file ext2.h.

◆ EXT2_S_IROTH

#define EXT2_S_IROTH   0x0004

Definition at line 202 of file ext2.h.

◆ EXT2_S_IRUSR

#define EXT2_S_IRUSR   0x0100

Definition at line 212 of file ext2.h.

◆ EXT2_S_IRWXG

#define EXT2_S_IRWXG   0x0038

Definition at line 204 of file ext2.h.

◆ EXT2_S_IRWXO

#define EXT2_S_IRWXO   0x0007

Definition at line 199 of file ext2.h.

◆ EXT2_S_IRWXU

#define EXT2_S_IRWXU   0x01C0

Definition at line 209 of file ext2.h.

◆ EXT2_S_ISGID

#define EXT2_S_ISGID   0x0400

Definition at line 215 of file ext2.h.

◆ EXT2_S_ISUID

#define EXT2_S_ISUID   0x0800

Definition at line 216 of file ext2.h.

◆ EXT2_S_ISVTX

#define EXT2_S_ISVTX   0x0200

Definition at line 214 of file ext2.h.

◆ EXT2_S_IWGRP

#define EXT2_S_IWGRP   0x0010

Definition at line 206 of file ext2.h.

◆ EXT2_S_IWOTH

#define EXT2_S_IWOTH   0x0002

Definition at line 201 of file ext2.h.

◆ EXT2_S_IWUSR

#define EXT2_S_IWUSR   0x0080

Definition at line 211 of file ext2.h.

◆ EXT2_S_IXGRP

#define EXT2_S_IXGRP   0x0008

Definition at line 205 of file ext2.h.

◆ EXT2_S_IXOTH

#define EXT2_S_IXOTH   0x0001

Definition at line 200 of file ext2.h.

◆ EXT2_S_IXUSR

#define EXT2_S_IXUSR   0x0040

Definition at line 210 of file ext2.h.

◆ EXT3_FEATURE_INCOMPAT_SUPP

#define EXT3_FEATURE_INCOMPAT_SUPP   0x0002

Definition at line 180 of file ext2.h.

◆ FAST_SYMLINK_MAX_NAME_SIZE

#define FAST_SYMLINK_MAX_NAME_SIZE   60

Definition at line 227 of file ext2.h.

◆ FILETYPE_DIRECTORY

#define FILETYPE_DIRECTORY   2

Definition at line 59 of file ext2.h.

◆ FILETYPE_INO_DIRECTORY

#define FILETYPE_INO_DIRECTORY   0040000

Definition at line 65 of file ext2.h.

◆ FILETYPE_INO_MASK

#define FILETYPE_INO_MASK   0170000

Definition at line 63 of file ext2.h.

◆ FILETYPE_INO_REG

#define FILETYPE_INO_REG   0100000

Definition at line 64 of file ext2.h.

◆ FILETYPE_INO_SYMLINK

#define FILETYPE_INO_SYMLINK   0120000

Definition at line 66 of file ext2.h.

◆ FILETYPE_REG

#define FILETYPE_REG   1

Definition at line 58 of file ext2.h.

◆ FILETYPE_SYMLINK

#define FILETYPE_SYMLINK   7

Definition at line 60 of file ext2.h.

◆ FILETYPE_UNKNOWN

#define FILETYPE_UNKNOWN   0

Definition at line 57 of file ext2.h.

◆ INDIRECT_BLOCKS

#define INDIRECT_BLOCKS   12

Definition at line 45 of file ext2.h.

◆ LOG2_BLOCK_SIZE

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

Definition at line 183 of file ext2.h.

Typedef Documentation

◆ EXT2_DIR_ENTRY

Definition at line 174 of file ext2.h.

◆ EXT2_GROUP_DESC

Definition at line 173 of file ext2.h.

◆ EXT2_INODE

Definition at line 172 of file ext2.h.

◆ EXT2_SUPER_BLOCK

Definition at line 171 of file ext2.h.

◆ PEXT2_DIR_ENTRY

Definition at line 174 of file ext2.h.

◆ PEXT2_FILE_INFO

◆ PEXT2_GROUP_DESC

Definition at line 173 of file ext2.h.

◆ PEXT2_INODE

Definition at line 172 of file ext2.h.

◆ PEXT2_SUPER_BLOCK

Definition at line 171 of file ext2.h.

◆ PEXT2_VOLUME_INFO

Definition at line 229 of file ext2.h.

Function Documentation

◆ Ext2Mount()

const DEVVTBL* Ext2Mount ( ULONG  DeviceId)

Definition at line 1297 of file ext2.c.

1298 {
1300  EXT2_SUPER_BLOCK SuperBlock;
1302  ULONG Count;
1304 
1305  TRACE("Enter Ext2Mount(%lu)\n", DeviceId);
1306 
1307  /* Allocate data for volume information */
1309  if (!Volume)
1310  return NULL;
1312 
1313  /* Read the SuperBlock */
1314  Position.QuadPart = 2 * 512;
1315  Status = ArcSeek(DeviceId, &Position, SeekAbsolute);
1316  if (Status != ESUCCESS)
1317  {
1319  return NULL;
1320  }
1321  Status = ArcRead(DeviceId, &SuperBlock, sizeof(SuperBlock), &Count);
1322  if (Status != ESUCCESS || Count != sizeof(SuperBlock))
1323  {
1325  return NULL;
1326  }
1327 
1328  /* Check if SuperBlock is valid. If yes, return Ext2 function table. */
1329  if (SuperBlock.magic != EXT2_MAGIC)
1330  {
1332  return NULL;
1333  }
1334 
1335  Volume->DeviceId = DeviceId;
1336 
1337  /* Really open the volume */
1338  if (!Ext2OpenVolume(Volume))
1339  {
1341  return NULL;
1342  }
1343 
1344  /* Remember EXT2 volume information */
1345  Ext2Volumes[DeviceId] = Volume;
1346 
1347  /* Return success */
1348  TRACE("Ext2Mount(%lu) success\n", DeviceId);
1349  return &Ext2FuncTable;
1350 }
Definition: arc.h:32
static COORD Position
Definition: mouse.c:34
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
ULONG ARC_STATUS
Definition: arc.h:4
#define EXT2_MAGIC
Definition: ext2.h:43
FORCEINLINE PVOID FrLdrTempAlloc(_In_ SIZE_T Size, _In_ ULONG Tag)
Definition: mm.h:177
smooth NULL
Definition: ftsmooth.c:416
USHORT magic
Definition: ext2.h:86
#define TRACE(s)
Definition: solgame.cpp:4
ARC_STATUS ArcRead(ULONG FileId, VOID *Buffer, ULONG N, ULONG *Count)
Definition: fs.c:236
ARC_STATUS ArcSeek(ULONG FileId, LARGE_INTEGER *Position, SEEKMODE SeekMode)
Definition: fs.c:243
Status
Definition: gdiplustypes.h:24
#define TAG_EXT_VOLUME
Definition: ext2.c:72
PEXT2_VOLUME_INFO Ext2Volumes[MAX_FDS]
Definition: ext2.c:65
unsigned int ULONG
Definition: retypes.h:1
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
const DEVVTBL Ext2FuncTable
Definition: ext2.c:1287
BOOLEAN Ext2OpenVolume(PEXT2_VOLUME_INFO Volume)
Definition: ext2.c:74
FORCEINLINE VOID FrLdrTempFree(PVOID Allocation, ULONG Tag)
Definition: mm.h:186

Referenced by ArcOpen().