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/fsck_minix.c | |
| 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/fsck_minix.c')
| -rw-r--r-- | util-linux/fsck_minix.c | 99 |
1 files changed, 97 insertions, 2 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 |
