[FREELDR] Rename almost everything to Ext

This commit is contained in:
Daniel Victor 2025-01-19 21:54:13 -03:00 committed by Timo Kreuzer
parent d0dfb6cf6f
commit 1f3083be75
3 changed files with 283 additions and 283 deletions

View file

@ -39,19 +39,19 @@
* along with GRUB. If not, see <http://www.gnu.org/licenses/>. * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
*/ */
/* Magic value used to identify an ext2 filesystem. */ /* Magic value used to identify an ext filesystem. */
#define EXT2_MAGIC 0xEF53 #define EXT_MAGIC 0xEF53
/* Amount of indirect blocks in an inode. */ /* Amount of indirect blocks in an inode. */
#define INDIRECT_BLOCKS 12 #define INDIRECT_BLOCKS 12
/* Maximum length of a pathname. */ /* Maximum length of a pathname. */
#define EXT2_PATH_MAX 4096 #define EXT_PATH_MAX 4096
/* Maximum nesting of symlinks, used to prevent a loop. */ /* Maximum nesting of symlinks, used to prevent a loop. */
#define EXT2_MAX_SYMLINKCNT 8 #define EXT_MAX_SYMLINKCNT 8
/* The good old revision and the default inode size. */ /* The good old revision and the default inode size. */
#define EXT2_GOOD_OLD_REVISION 0 #define EXT_GOOD_OLD_REVISION 0
#define EXT2_DYNAMIC_REVISION 1 #define EXT_DYNAMIC_REVISION 1
#define EXT2_GOOD_OLD_INODE_SIZE 128 #define EXT_GOOD_OLD_INODE_SIZE 128
/* Filetype used in directory entry. */ /* Filetype used in directory entry. */
#define FILETYPE_UNKNOWN 0 #define FILETYPE_UNKNOWN 0
@ -65,8 +65,8 @@
#define FILETYPE_INO_DIRECTORY 0040000 #define FILETYPE_INO_DIRECTORY 0040000
#define FILETYPE_INO_SYMLINK 0120000 #define FILETYPE_INO_SYMLINK 0120000
/* The ext2 superblock. */ /* The ext superblock. */
struct ext2_sblock struct ext_sblock
{ {
ULONG total_inodes; ULONG total_inodes;
ULONG total_blocks; ULONG total_blocks;
@ -106,8 +106,8 @@ struct ext2_sblock
ULONG padding[77]; ULONG padding[77];
}; };
/* The ext2 blockgroup. */ /* The ext blockgroup. */
struct ext2_block_group struct ext_block_group
{ {
ULONG block_id; ULONG block_id;
ULONG inode_id; ULONG inode_id;
@ -119,8 +119,8 @@ struct ext2_block_group
ULONG reserved[3]; ULONG reserved[3];
}; };
/* The ext2 inode. */ /* The ext inode. */
struct ext2_inode struct ext_inode
{ {
USHORT mode; USHORT mode;
USHORT uid; USHORT uid;
@ -152,89 +152,89 @@ struct ext2_inode
ULONG osd2[3]; ULONG osd2[3];
}; };
/* The header of an ext2 directory entry. */ /* The header of an ext directory entry. */
#define EXT2_NAME_LEN 255 #define EXT_NAME_LEN 255
struct ext2_dirent struct ext_dirent
{ {
ULONG inode; ULONG inode;
USHORT direntlen; USHORT direntlen;
UCHAR namelen; UCHAR namelen;
UCHAR filetype; UCHAR filetype;
CHAR name[EXT2_NAME_LEN]; CHAR name[EXT_NAME_LEN];
}; };
/* /*
* End of code from grub/fs/ext2.c * End of code from grub/fs/ext2.c
*/ */
typedef struct ext2_sblock EXT2_SUPER_BLOCK, *PEXT2_SUPER_BLOCK; typedef struct ext_sblock EXT_SUPER_BLOCK, *PEXT_SUPER_BLOCK;
typedef struct ext2_inode EXT2_INODE, *PEXT2_INODE; typedef struct ext_inode EXT_INODE, *PEXT_INODE;
typedef struct ext2_block_group EXT2_GROUP_DESC, *PEXT2_GROUP_DESC; typedef struct ext_block_group EXT_GROUP_DESC, *PEXT_GROUP_DESC;
typedef struct ext2_dirent EXT2_DIR_ENTRY, *PEXT2_DIR_ENTRY; typedef struct ext_dirent EXT_DIR_ENTRY, *PEXT_DIR_ENTRY;
/* Special inode numbers. */ /* Special inode numbers. */
#define EXT2_ROOT_INO 2 #define EXT_ROOT_INO 2
/* Feature set definitions. */ /* Feature set definitions. */
#define EXT3_FEATURE_INCOMPAT_SUPP 0x0002 #define EXT3_FEATURE_INCOMPAT_SUPP 0x0002
/* Log2 size of ext2 block in bytes. */ /* Log2 size of ext block in bytes. */
#define LOG2_BLOCK_SIZE(sb) (sb->log2_block_size + 10) #define LOG2_BLOCK_SIZE(sb) (sb->log2_block_size + 10)
/* The size of an ext2 block in bytes. */ /* The size of an ext block in bytes. */
#define EXT2_BLOCK_SIZE(sb) (((SIZE_T)1) << LOG2_BLOCK_SIZE(sb)) #define EXT_BLOCK_SIZE(sb) (((SIZE_T)1) << LOG2_BLOCK_SIZE(sb))
/* The revision level. */ /* The revision level. */
#define EXT2_REVISION(sb) (sb->revision_level) #define EXT_REVISION(sb) (sb->revision_level)
/* The inode size. */ /* The inode size. */
#define EXT2_INODE_SIZE(sb) (EXT2_REVISION(sb) == EXT2_GOOD_OLD_REVISION \ #define EXT_INODE_SIZE(sb) (EXT_REVISION(sb) == EXT_GOOD_OLD_REVISION \
? EXT2_GOOD_OLD_INODE_SIZE \ ? EXT_GOOD_OLD_INODE_SIZE \
: sb->inode_size) : sb->inode_size)
#define EXT2_DESC_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / sizeof(struct ext2_block_group)) #define EXT_DESC_PER_BLOCK(s) (EXT_BLOCK_SIZE(s) / sizeof(struct ext_block_group))
// EXT2_INODE::mode values // EXT_INODE::mode values
#define EXT2_S_IRWXO 0x0007 // Other mask #define EXT_S_IRWXO 0x0007 // Other mask
#define EXT2_S_IXOTH 0x0001 // ---------x execute #define EXT_S_IXOTH 0x0001 // ---------x execute
#define EXT2_S_IWOTH 0x0002 // --------w- write #define EXT_S_IWOTH 0x0002 // --------w- write
#define EXT2_S_IROTH 0x0004 // -------r-- read #define EXT_S_IROTH 0x0004 // -------r-- read
#define EXT2_S_IRWXG 0x0038 // Group mask #define EXT_S_IRWXG 0x0038 // Group mask
#define EXT2_S_IXGRP 0x0008 // ------x--- execute #define EXT_S_IXGRP 0x0008 // ------x--- execute
#define EXT2_S_IWGRP 0x0010 // -----w---- write #define EXT_S_IWGRP 0x0010 // -----w---- write
#define EXT2_S_IRGRP 0x0020 // ----r----- read #define EXT_S_IRGRP 0x0020 // ----r----- read
#define EXT2_S_IRWXU 0x01C0 // User mask #define EXT_S_IRWXU 0x01C0 // User mask
#define EXT2_S_IXUSR 0x0040 // ---x------ execute #define EXT_S_IXUSR 0x0040 // ---x------ execute
#define EXT2_S_IWUSR 0x0080 // --w------- write #define EXT_S_IWUSR 0x0080 // --w------- write
#define EXT2_S_IRUSR 0x0100 // -r-------- read #define EXT_S_IRUSR 0x0100 // -r-------- read
#define EXT2_S_ISVTX 0x0200 // Sticky bit #define EXT_S_ISVTX 0x0200 // Sticky bit
#define EXT2_S_ISGID 0x0400 // SGID #define EXT_S_ISGID 0x0400 // SGID
#define EXT2_S_ISUID 0x0800 // SUID #define EXT_S_ISUID 0x0800 // SUID
#define EXT2_S_IFMT 0xF000 // Format mask #define EXT_S_IFMT 0xF000 // Format mask
#define EXT2_S_IFIFO 0x1000 // FIFO buffer #define EXT_S_IFIFO 0x1000 // FIFO buffer
#define EXT2_S_IFCHR 0x2000 // Character device #define EXT_S_IFCHR 0x2000 // Character device
#define EXT2_S_IFDIR 0x4000 // Directory #define EXT_S_IFDIR 0x4000 // Directory
#define EXT2_S_IFBLK 0x6000 // Block device #define EXT_S_IFBLK 0x6000 // Block device
#define EXT2_S_IFREG 0x8000 // Regular file #define EXT_S_IFREG 0x8000 // Regular file
#define EXT2_S_IFLNK 0xA000 // Symbolic link #define EXT_S_IFLNK 0xA000 // Symbolic link
#define EXT2_S_IFSOCK 0xC000 // Socket #define EXT_S_IFSOCK 0xC000 // Socket
#define FAST_SYMLINK_MAX_NAME_SIZE 60 #define FAST_SYMLINK_MAX_NAME_SIZE 60
typedef struct _EXT2_VOLUME_INFO *PEXT2_VOLUME_INFO; typedef struct _EXT_VOLUME_INFO *PEXT_VOLUME_INFO;
typedef struct typedef struct
{ {
ULONGLONG FileSize; // File size ULONGLONG FileSize; // File size
ULONGLONG FilePointer; // File pointer ULONGLONG FilePointer; // File pointer
ULONG* FileBlockList; // File block list ULONG* FileBlockList; // File block list
EXT2_INODE Inode; // File's inode EXT_INODE Inode; // File's inode
PEXT2_VOLUME_INFO Volume; PEXT_VOLUME_INFO Volume;
} EXT2_FILE_INFO, * PEXT2_FILE_INFO; } EXT_FILE_INFO, * PEXT_FILE_INFO;
const DEVVTBL* Ext2Mount(ULONG DeviceId); const DEVVTBL* ExtMount(ULONG DeviceId);

File diff suppressed because it is too large Load diff

View file

@ -65,7 +65,7 @@ PFS_MOUNT FileSystems[] =
BtrFsMount, BtrFsMount,
#ifndef _M_ARM #ifndef _M_ARM
NtfsMount, NtfsMount,
Ext2Mount, ExtMount,
#endif #endif
#if defined(_M_IX86) || defined(_M_AMD64) #if defined(_M_IX86) || defined(_M_AMD64)
#ifndef UEFIBOOT #ifndef UEFIBOOT