Annotation of /trunk/mkinitrd-magellan/nash/linux_fs.h
Parent Directory | Revision Log
Revision 532 -
(hide annotations)
(download)
Sat Sep 1 22:45:15 2007 UTC (17 years ago) by niro
File MIME type: text/plain
File size: 6213 byte(s)
Sat Sep 1 22:45:15 2007 UTC (17 years ago) by niro
File MIME type: text/plain
File size: 6213 byte(s)
-import if magellan mkinitrd; it is a fork of redhats mkinitrd-5.0.8 with all magellan patches and features; deprecates magellan-src/mkinitrd
1 | niro | 532 | /* 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. */ | ||
5 | |||
6 | #ifndef BLKGETSIZE | ||
7 | #ifndef _IO | ||
8 | /* pre-1.3.45 */ | ||
9 | #define BLKGETSIZE 0x1260 /* return device size */ | ||
10 | #else | ||
11 | /* same on i386, m68k, arm; different on alpha, mips, sparc, ppc */ | ||
12 | #define BLKGETSIZE _IO(0x12,96) | ||
13 | #endif | ||
14 | #endif | ||
15 | |||
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 { | ||
19 | unsigned char s_dummy[16]; | ||
20 | unsigned char s_magic[2]; | ||
21 | }; | ||
22 | #define minixmagic(s) ((unsigned int) s.s_magic[0] + (((unsigned int) s.s_magic[1]) << 8)) | ||
23 | |||
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 */ | ||
28 | char id[ISODCL(2,6)]; | ||
29 | char version[ISODCL(7,7)]; | ||
30 | char data[ISODCL(8,2048)]; | ||
31 | }; | ||
32 | |||
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)]; | ||
40 | }; | ||
41 | |||
42 | #define EXT_SUPER_MAGIC 0x137D | ||
43 | struct ext_super_block { | ||
44 | unsigned char s_dummy[56]; | ||
45 | unsigned char s_magic[2]; | ||
46 | }; | ||
47 | #define extmagic(s) ((unsigned int) s.s_magic[0] + (((unsigned int) s.s_magic[1]) << 8)) | ||
48 | |||
49 | #define EXT2_PRE_02B_MAGIC 0xEF51 | ||
50 | #define EXT2_SUPER_MAGIC 0xEF53 | ||
51 | #define EXT3_FEATURE_COMPAT_HAS_JOURNAL 0x0004 | ||
52 | struct ext2_super_block { | ||
53 | unsigned char s_dummy1[56]; | ||
54 | unsigned char s_magic[2]; | ||
55 | unsigned char s_dummy2[34]; | ||
56 | unsigned char s_feature_compat[4]; | ||
57 | unsigned char s_feature_incompat[4]; | ||
58 | unsigned char s_feature_ro_compat[4]; | ||
59 | unsigned char s_uuid[16]; | ||
60 | unsigned char s_volume_name[16]; | ||
61 | unsigned char s_dummy3[88]; | ||
62 | unsigned char s_journal_inum[4]; /* ext3 only */ | ||
63 | }; | ||
64 | #define ext2magic(s) ((unsigned int) s.s_magic[0] + (((unsigned int) s.s_magic[1]) << 8)) | ||
65 | |||
66 | struct reiserfs_super_block | ||
67 | { | ||
68 | unsigned char s_block_count[4]; | ||
69 | unsigned char s_free_blocks[4]; | ||
70 | unsigned char s_root_block[4]; | ||
71 | unsigned char s_journal_block[4]; | ||
72 | unsigned char s_journal_dev[4]; | ||
73 | unsigned char s_orig_journal_size[4]; | ||
74 | unsigned char s_journal_trans_max[4]; | ||
75 | unsigned char s_journal_block_count[4]; | ||
76 | unsigned char s_journal_max_batch[4]; | ||
77 | unsigned char s_journal_max_commit_age[4]; | ||
78 | unsigned char s_journal_max_trans_age[4]; | ||
79 | unsigned char s_blocksize[2]; | ||
80 | unsigned char s_oid_maxsize[2]; | ||
81 | unsigned char s_oid_cursize[2]; | ||
82 | unsigned char s_state[2]; | ||
83 | unsigned char s_magic[12]; | ||
84 | }; | ||
85 | #define REISERFS_SUPER_MAGIC_STRING "ReIsErFs" | ||
86 | #define REISER2FS_SUPER_MAGIC_STRING "ReIsEr2Fs" | ||
87 | #define REISERFS_DISK_OFFSET_IN_BYTES (64 * 1024) | ||
88 | /* the spot for the super in versions 3.5 - 3.5.10 (inclusive) */ | ||
89 | #define REISERFS_OLD_DISK_OFFSET_IN_BYTES (8 * 1024) | ||
90 | |||
91 | #define _XIAFS_SUPER_MAGIC 0x012FD16D | ||
92 | struct xiafs_super_block { | ||
93 | unsigned char s_boot_segment[512]; /* 1st sector reserved for boot */ | ||
94 | unsigned char s_dummy[60]; | ||
95 | unsigned char s_magic[4]; | ||
96 | }; | ||
97 | #define xiafsmagic(s) ((unsigned int) s.s_magic[0] + (((unsigned int) s.s_magic[1]) << 8) + \ | ||
98 | (((unsigned int) s.s_magic[2]) << 16) + \ | ||
99 | (((unsigned int) s.s_magic[3]) << 24)) | ||
100 | |||
101 | /* From jj@sunsite.ms.mff.cuni.cz Mon Mar 23 15:19:05 1998 */ | ||
102 | #define UFS_SUPER_MAGIC 0x00011954 | ||
103 | struct ufs_super_block { | ||
104 | unsigned char s_dummy[0x55c]; | ||
105 | unsigned char s_magic[4]; | ||
106 | }; | ||
107 | #define ufsmagic(s) ((unsigned int) s.s_magic[0] + (((unsigned int) s.s_magic[1]) << 8) + \ | ||
108 | (((unsigned int) s.s_magic[2]) << 16) + \ | ||
109 | (((unsigned int) s.s_magic[3]) << 24)) | ||
110 | |||
111 | /* From Richard.Russon@ait.co.uk Wed Feb 24 08:05:27 1999 */ | ||
112 | #define NTFS_SUPER_MAGIC "NTFS" | ||
113 | struct ntfs_super_block { | ||
114 | unsigned char s_dummy[3]; | ||
115 | unsigned char s_magic[4]; | ||
116 | }; | ||
117 | |||
118 | /* From inspection of a few FAT filesystems - aeb */ | ||
119 | /* Unfortunately I find almost the same thing on an extended partition; | ||
120 | it looks like a primary has some directory entries where the extended | ||
121 | has a partition table: IO.SYS, MSDOS.SYS, WINBOOT.SYS */ | ||
122 | struct fat_super_block { | ||
123 | unsigned char s_dummy[3]; | ||
124 | unsigned char s_os[8]; /* "MSDOS5.0" or "MSWIN4.0" or "MSWIN4.1" */ | ||
125 | /* mtools-3.9.4 writes "MTOOL394" */ | ||
126 | unsigned char s_dummy2[32]; | ||
127 | unsigned char s_label[11]; /* for DOS? */ | ||
128 | unsigned char s_fs[8]; /* "FAT12 " or "FAT16 " or all zero */ | ||
129 | /* OS/2 BM has "FAT " here. */ | ||
130 | unsigned char s_dummy3[9]; | ||
131 | unsigned char s_label2[11]; /* for Windows? */ | ||
132 | unsigned char s_fs2[8]; /* garbage or "FAT32 " */ | ||
133 | }; | ||
134 | |||
135 | #define XFS_SUPER_MAGIC "XFSB" | ||
136 | struct xfs_super_block { | ||
137 | unsigned char s_magic[4]; | ||
138 | unsigned char s_dummy[28]; | ||
139 | unsigned char s_uuid[16]; | ||
140 | unsigned char s_dummy2[60]; | ||
141 | unsigned char s_fname[12]; | ||
142 | }; | ||
143 | |||
144 | #define CRAMFS_SUPER_MAGIC 0x28cd3d45 | ||
145 | struct cramfs_super_block { | ||
146 | unsigned char s_magic[4]; | ||
147 | unsigned char s_dummy[12]; | ||
148 | unsigned char s_id[16]; | ||
149 | }; | ||
150 | #define cramfsmagic(s) ((unsigned int) s.s_magic[0] + (((unsigned int) s.s_magic[1]) << 8) + \ | ||
151 | (((unsigned int) s.s_magic[2]) << 16) + \ | ||
152 | (((unsigned int) s.s_magic[3]) << 24)) | ||
153 | |||
154 | #define HFS_SUPER_MAGIC 0x4244 | ||
155 | struct hfs_super_block { | ||
156 | unsigned char s_magic[2]; | ||
157 | unsigned char s_dummy[18]; | ||
158 | unsigned char s_blksize[4]; | ||
159 | }; | ||
160 | #define hfsmagic(s) ((unsigned int) s.s_magic[0] + (((unsigned int) s.s_magic[1]) << 8)) | ||
161 | #define hfsblksize(s) ((unsigned int) s.s_blksize[0] + \ | ||
162 | (((unsigned int) s.s_blksize[1]) << 8) + \ | ||
163 | (((unsigned int) s.s_blksize[2]) << 16) + \ | ||
164 | (((unsigned int) s.s_blksize[3]) << 24)) | ||
165 | |||
166 | #define HPFS_SUPER_MAGIC 0xf995e849 | ||
167 | struct hpfs_super_block { | ||
168 | unsigned char s_magic[4]; | ||
169 | unsigned char s_magic2[4]; | ||
170 | }; | ||
171 | #define hpfsmagic(s) ((unsigned int) s.s_magic[0] + (((unsigned int) s.s_magic[1]) << 8) + \ | ||
172 | (((unsigned int) s.s_magic[2]) << 16) + \ | ||
173 | (((unsigned int) s.s_magic[3]) << 24)) | ||
174 | |||
175 | struct adfs_super_block { | ||
176 | unsigned char s_dummy[448]; | ||
177 | unsigned char s_blksize[1]; | ||
178 | unsigned char s_dummy2[62]; | ||
179 | unsigned char s_checksum[1]; | ||
180 | }; | ||
181 | #define adfsblksize(s) ((unsigned int) s.s_blksize[0]) |