]>
git.ipfire.org Git - thirdparty/util-linux.git/blob - mount/linux_fs.h
1 /* Including <linux/fs.h> became more and more painful.
2 Below a very abbreviated version of some declarations,
3 only designed to be able to check a magic number
4 in case no filesystem type was given. */
9 #define BLKGETSIZE 0x1260 /* return device size */
11 /* same on i386, m68k, arm; different on alpha, mips, sparc, ppc */
12 #define BLKGETSIZE _IO(0x12,96)
16 #define MINIX_SUPER_MAGIC 0x137F /* original minix fs */
17 #define MINIX_SUPER_MAGIC2 0x138F /* minix fs, 30 char names */
18 struct minix_super_block
{
22 #define minixmagic(s) ((uint) s.s_magic[0] + (((uint) s.s_magic[1]) << 8))
24 #define ISODCL(from, to) (to - from + 1)
25 #define ISO_STANDARD_ID "CD001"
26 struct iso_volume_descriptor
{
27 char type
[ISODCL(1,1)]; /* 711 */
29 char version
[ISODCL(7,7)];
30 char data
[ISODCL(8,2048)];
33 #define HS_STANDARD_ID "CDROM"
34 struct hs_volume_descriptor
{
35 char foo
[ISODCL ( 1, 8)]; /* 733 */
36 char type
[ISODCL ( 9, 9)]; /* 711 */
37 char id
[ISODCL ( 10, 14)];
38 char version
[ISODCL ( 15, 15)]; /* 711 */
39 char data
[ISODCL(16,2048)];
42 #define EXT_SUPER_MAGIC 0x137D
43 struct ext_super_block
{
47 #define extmagic(s) ((uint) s.s_magic[0] + (((uint) s.s_magic[1]) << 8))
49 #define EXT2_PRE_02B_MAGIC 0xEF51
50 #define EXT2_SUPER_MAGIC 0xEF53
51 struct ext2_super_block
{
56 u_char s_volume_name
[16];
58 #define ext2magic(s) ((uint) s.s_magic[0] + (((uint) s.s_magic[1]) << 8))
60 #define _XIAFS_SUPER_MAGIC 0x012FD16D
61 struct xiafs_super_block
{
62 u_char s_boot_segment
[512]; /* 1st sector reserved for boot */
66 #define xiafsmagic(s) ((uint) s.s_magic[0] + (((uint) s.s_magic[1]) << 8) + \
67 (((uint) s.s_magic[2]) << 16) + \
68 (((uint) s.s_magic[3]) << 24))
70 /* From jj@sunsite.ms.mff.cuni.cz Mon Mar 23 15:19:05 1998 */
71 #define UFS_SUPER_MAGIC 0x00011954
72 struct ufs_super_block
{
73 u_char s_dummy
[0x55c];
76 #define ufsmagic(s) ((uint) s.s_magic[0] + (((uint) s.s_magic[1]) << 8) + \
77 (((uint) s.s_magic[2]) << 16) + \
78 (((uint) s.s_magic[3]) << 24))
80 /* From Richard.Russon@ait.co.uk Wed Feb 24 08:05:27 1999 */
81 #define NTFS_SUPER_MAGIC "NTFS"
82 struct ntfs_super_block
{
87 /* From inspection of a few FAT filesystems - aeb */
88 /* Unfortunately I find almost the same thing on an extended partition;
89 it looks like a primary has some directory entries where the extended
90 has a partition table: IO.SYS, MSDOS.SYS, WINBOOT.SYS */
91 struct fat_super_block
{
93 u_char s_os
[8]; /* "MSDOS5.0" or "MSWIN4.0" or "MSWIN4.1" */
94 /* mtools-3.9.4 writes "MTOOL394" */
96 u_char s_label
[11]; /* for DOS? */
97 u_char s_fs
[8]; /* "FAT12 " or "FAT16 " or all zero */
98 /* OS/2 BM has "FAT " here. */
100 u_char s_label2
[11]; /* for Windows? */
101 u_char s_fs2
[8]; /* garbage or "FAT32 " */
104 #define XFS_SUPER_MAGIC "XFSB"
105 #define XFS_SUPER_MAGIC2 "BSFX"
106 struct xfs_super_block
{
114 #define CRAMFS_SUPER_MAGIC 0x28cd3d45
115 struct cramfs_super_block
{
120 #define cramfsmagic(s) ((uint) s.s_magic[0] + (((uint) s.s_magic[1]) << 8) + \
121 (((uint) s.s_magic[2]) << 16) + \
122 (((uint) s.s_magic[3]) << 24))
124 #define HFS_SUPER_MAGIC 0x4244
125 struct hfs_super_block
{
130 #define hfsmagic(s) ((uint) s.s_magic[0] + (((uint) s.s_magic[1]) << 8))
131 #define hfsblksize(s) ((uint) s.s_blksize[0] + \
132 (((uint) s.s_blksize[1]) << 8) + \
133 (((uint) s.s_blksize[2]) << 16) + \
134 (((uint) s.s_blksize[3]) << 24))
136 #define HPFS_SUPER_MAGIC 0xf995e849
137 struct hpfs_super_block
{
141 #define hpfsmagic(s) ((uint) s.s_magic[0] + (((uint) s.s_magic[1]) << 8) + \
142 (((uint) s.s_magic[2]) << 16) + \
143 (((uint) s.s_magic[3]) << 24))
145 struct adfs_super_block
{
149 u_char s_checksum
[1];
151 #define adfsblksize(s) ((uint) s.s_blksize[0])