diff options
author | Eric Andersen <andersen@codepoet.org> | 2000-07-10 22:46:55 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2000-07-10 22:46:55 +0000 |
commit | 85c552035e4c5199d1cbef6058eb365c6150f33d (patch) | |
tree | 584b12b4e895373b7635f49b2f5e51fb2f47c4f2 /util-linux | |
parent | 9b2297a34e35be143155769a470331af2f2b9330 (diff) | |
download | busybox-w32-85c552035e4c5199d1cbef6058eb365c6150f33d.tar.gz busybox-w32-85c552035e4c5199d1cbef6058eb365c6150f33d.tar.bz2 busybox-w32-85c552035e4c5199d1cbef6058eb365c6150f33d.zip |
More linux kernel header file removal.
-Erik
Diffstat (limited to 'util-linux')
-rw-r--r-- | util-linux/fsck_minix.c | 99 | ||||
-rw-r--r-- | util-linux/mkfs_minix.c | 99 |
2 files changed, 194 insertions, 4 deletions
diff --git a/util-linux/fsck_minix.c b/util-linux/fsck_minix.c index 2119baead..9533f40db 100644 --- a/util-linux/fsck_minix.c +++ b/util-linux/fsck_minix.c | |||
@@ -98,8 +98,103 @@ | |||
98 | #include <mntent.h> | 98 | #include <mntent.h> |
99 | #include <sys/stat.h> | 99 | #include <sys/stat.h> |
100 | #include <sys/param.h> | 100 | #include <sys/param.h> |
101 | #include <linux/fs.h> | 101 | |
102 | #include <linux/minix_fs.h> | 102 | |
103 | typedef unsigned char u8; | ||
104 | typedef unsigned short u16; | ||
105 | typedef unsigned int u32; | ||
106 | |||
107 | |||
108 | #define MINIX_ROOT_INO 1 | ||
109 | #define MINIX_LINK_MAX 250 | ||
110 | #define MINIX2_LINK_MAX 65530 | ||
111 | |||
112 | #define MINIX_I_MAP_SLOTS 8 | ||
113 | #define MINIX_Z_MAP_SLOTS 64 | ||
114 | #define MINIX_SUPER_MAGIC 0x137F /* original minix fs */ | ||
115 | #define MINIX_SUPER_MAGIC2 0x138F /* minix fs, 30 char names */ | ||
116 | #define MINIX2_SUPER_MAGIC 0x2468 /* minix V2 fs */ | ||
117 | #define MINIX2_SUPER_MAGIC2 0x2478 /* minix V2 fs, 30 char names */ | ||
118 | #define MINIX_VALID_FS 0x0001 /* Clean fs. */ | ||
119 | #define MINIX_ERROR_FS 0x0002 /* fs has errors. */ | ||
120 | |||
121 | #define MINIX_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct minix_inode))) | ||
122 | #define MINIX2_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct minix2_inode))) | ||
123 | |||
124 | #define MINIX_V1 0x0001 /* original minix fs */ | ||
125 | #define MINIX_V2 0x0002 /* minix V2 fs */ | ||
126 | |||
127 | #define INODE_VERSION(inode) inode->i_sb->u.minix_sb.s_version | ||
128 | |||
129 | /* | ||
130 | * This is the original minix inode layout on disk. | ||
131 | * Note the 8-bit gid and atime and ctime. | ||
132 | */ | ||
133 | struct minix_inode { | ||
134 | u16 i_mode; | ||
135 | u16 i_uid; | ||
136 | u32 i_size; | ||
137 | u32 i_time; | ||
138 | u8 i_gid; | ||
139 | u8 i_nlinks; | ||
140 | u16 i_zone[9]; | ||
141 | }; | ||
142 | |||
143 | /* | ||
144 | * The new minix inode has all the time entries, as well as | ||
145 | * long block numbers and a third indirect block (7+1+1+1 | ||
146 | * instead of 7+1+1). Also, some previously 8-bit values are | ||
147 | * now 16-bit. The inode is now 64 bytes instead of 32. | ||
148 | */ | ||
149 | struct minix2_inode { | ||
150 | u16 i_mode; | ||
151 | u16 i_nlinks; | ||
152 | u16 i_uid; | ||
153 | u16 i_gid; | ||
154 | u32 i_size; | ||
155 | u32 i_atime; | ||
156 | u32 i_mtime; | ||
157 | u32 i_ctime; | ||
158 | u32 i_zone[10]; | ||
159 | }; | ||
160 | |||
161 | /* | ||
162 | * minix super-block data on disk | ||
163 | */ | ||
164 | struct minix_super_block { | ||
165 | u16 s_ninodes; | ||
166 | u16 s_nzones; | ||
167 | u16 s_imap_blocks; | ||
168 | u16 s_zmap_blocks; | ||
169 | u16 s_firstdatazone; | ||
170 | u16 s_log_zone_size; | ||
171 | u32 s_max_size; | ||
172 | u16 s_magic; | ||
173 | u16 s_state; | ||
174 | u32 s_zones; | ||
175 | }; | ||
176 | |||
177 | struct minix_dir_entry { | ||
178 | u16 inode; | ||
179 | char name[0]; | ||
180 | }; | ||
181 | |||
182 | #define BLOCK_SIZE_BITS 10 | ||
183 | #define BLOCK_SIZE (1<<BLOCK_SIZE_BITS) | ||
184 | |||
185 | #define NAME_MAX 255 /* # chars in a file name */ | ||
186 | |||
187 | #define MINIX_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct minix_inode))) | ||
188 | |||
189 | #define MINIX_VALID_FS 0x0001 /* Clean fs. */ | ||
190 | #define MINIX_ERROR_FS 0x0002 /* fs has errors. */ | ||
191 | |||
192 | #define MINIX_SUPER_MAGIC 0x137F /* original minix fs */ | ||
193 | #define MINIX_SUPER_MAGIC2 0x138F /* minix fs, 30 char names */ | ||
194 | |||
195 | #ifndef BLKGETSIZE | ||
196 | #define BLKGETSIZE _IO(0x12,96) /* return device size */ | ||
197 | #endif | ||
103 | 198 | ||
104 | #ifdef MINIX2_SUPER_MAGIC2 | 199 | #ifdef MINIX2_SUPER_MAGIC2 |
105 | #define HAVE_MINIX2 1 | 200 | #define HAVE_MINIX2 1 |
diff --git a/util-linux/mkfs_minix.c b/util-linux/mkfs_minix.c index 9493f2b2b..c8c91123b 100644 --- a/util-linux/mkfs_minix.c +++ b/util-linux/mkfs_minix.c | |||
@@ -77,8 +77,103 @@ | |||
77 | #include <sys/param.h> | 77 | #include <sys/param.h> |
78 | #include <mntent.h> | 78 | #include <mntent.h> |
79 | 79 | ||
80 | #include <linux/fs.h> | 80 | |
81 | #include <linux/minix_fs.h> | 81 | typedef unsigned char u8; |
82 | typedef unsigned short u16; | ||
83 | typedef unsigned int u32; | ||
84 | |||
85 | |||
86 | #define MINIX_ROOT_INO 1 | ||
87 | #define MINIX_LINK_MAX 250 | ||
88 | #define MINIX2_LINK_MAX 65530 | ||
89 | |||
90 | #define MINIX_I_MAP_SLOTS 8 | ||
91 | #define MINIX_Z_MAP_SLOTS 64 | ||
92 | #define MINIX_SUPER_MAGIC 0x137F /* original minix fs */ | ||
93 | #define MINIX_SUPER_MAGIC2 0x138F /* minix fs, 30 char names */ | ||
94 | #define MINIX2_SUPER_MAGIC 0x2468 /* minix V2 fs */ | ||
95 | #define MINIX2_SUPER_MAGIC2 0x2478 /* minix V2 fs, 30 char names */ | ||
96 | #define MINIX_VALID_FS 0x0001 /* Clean fs. */ | ||
97 | #define MINIX_ERROR_FS 0x0002 /* fs has errors. */ | ||
98 | |||
99 | #define MINIX_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct minix_inode))) | ||
100 | #define MINIX2_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct minix2_inode))) | ||
101 | |||
102 | #define MINIX_V1 0x0001 /* original minix fs */ | ||
103 | #define MINIX_V2 0x0002 /* minix V2 fs */ | ||
104 | |||
105 | #define INODE_VERSION(inode) inode->i_sb->u.minix_sb.s_version | ||
106 | |||
107 | /* | ||
108 | * This is the original minix inode layout on disk. | ||
109 | * Note the 8-bit gid and atime and ctime. | ||
110 | */ | ||
111 | struct minix_inode { | ||
112 | u16 i_mode; | ||
113 | u16 i_uid; | ||
114 | u32 i_size; | ||
115 | u32 i_time; | ||
116 | u8 i_gid; | ||
117 | u8 i_nlinks; | ||
118 | u16 i_zone[9]; | ||
119 | }; | ||
120 | |||
121 | /* | ||
122 | * The new minix inode has all the time entries, as well as | ||
123 | * long block numbers and a third indirect block (7+1+1+1 | ||
124 | * instead of 7+1+1). Also, some previously 8-bit values are | ||
125 | * now 16-bit. The inode is now 64 bytes instead of 32. | ||
126 | */ | ||
127 | struct minix2_inode { | ||
128 | u16 i_mode; | ||
129 | u16 i_nlinks; | ||
130 | u16 i_uid; | ||
131 | u16 i_gid; | ||
132 | u32 i_size; | ||
133 | u32 i_atime; | ||
134 | u32 i_mtime; | ||
135 | u32 i_ctime; | ||
136 | u32 i_zone[10]; | ||
137 | }; | ||
138 | |||
139 | /* | ||
140 | * minix super-block data on disk | ||
141 | */ | ||
142 | struct minix_super_block { | ||
143 | u16 s_ninodes; | ||
144 | u16 s_nzones; | ||
145 | u16 s_imap_blocks; | ||
146 | u16 s_zmap_blocks; | ||
147 | u16 s_firstdatazone; | ||
148 | u16 s_log_zone_size; | ||
149 | u32 s_max_size; | ||
150 | u16 s_magic; | ||
151 | u16 s_state; | ||
152 | u32 s_zones; | ||
153 | }; | ||
154 | |||
155 | struct minix_dir_entry { | ||
156 | u16 inode; | ||
157 | char name[0]; | ||
158 | }; | ||
159 | |||
160 | #define BLOCK_SIZE_BITS 10 | ||
161 | #define BLOCK_SIZE (1<<BLOCK_SIZE_BITS) | ||
162 | |||
163 | #define NAME_MAX 255 /* # chars in a file name */ | ||
164 | |||
165 | #define MINIX_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct minix_inode))) | ||
166 | |||
167 | #define MINIX_VALID_FS 0x0001 /* Clean fs. */ | ||
168 | #define MINIX_ERROR_FS 0x0002 /* fs has errors. */ | ||
169 | |||
170 | #define MINIX_SUPER_MAGIC 0x137F /* original minix fs */ | ||
171 | #define MINIX_SUPER_MAGIC2 0x138F /* minix fs, 30 char names */ | ||
172 | |||
173 | #ifndef BLKGETSIZE | ||
174 | #define BLKGETSIZE _IO(0x12,96) /* return device size */ | ||
175 | #endif | ||
176 | |||
82 | 177 | ||
83 | #ifdef MINIX2_SUPER_MAGIC2 | 178 | #ifdef MINIX2_SUPER_MAGIC2 |
84 | #define HAVE_MINIX2 1 | 179 | #define HAVE_MINIX2 1 |