diff options
| author | vda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2007-01-03 00:47:47 +0000 |
|---|---|---|
| committer | vda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2007-01-03 00:47:47 +0000 |
| commit | 8569a72502c8ab12155e8505bf267ed57a926344 (patch) | |
| tree | 64c58a55d4b4bc416d4428fd63983934f6f4dfc2 /util-linux | |
| parent | 17156d6a253831ceac587a82e43c2d854b39eca8 (diff) | |
| download | busybox-w32-8569a72502c8ab12155e8505bf267ed57a926344.tar.gz busybox-w32-8569a72502c8ab12155e8505bf267ed57a926344.tar.bz2 busybox-w32-8569a72502c8ab12155e8505bf267ed57a926344.zip | |
forgot to svn add util-linux/minix.h :(
git-svn-id: svn://busybox.net/trunk/busybox@17137 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'util-linux')
| -rw-r--r-- | util-linux/fsck_minix.c | 2 | ||||
| -rw-r--r-- | util-linux/minix.h | 76 |
2 files changed, 77 insertions, 1 deletions
diff --git a/util-linux/fsck_minix.c b/util-linux/fsck_minix.c index 2d5562e87..de04a8003 100644 --- a/util-linux/fsck_minix.c +++ b/util-linux/fsck_minix.c | |||
| @@ -176,7 +176,7 @@ static unsigned char *zone_count; | |||
| 176 | 176 | ||
| 177 | static int bit(char *a, unsigned i) | 177 | static int bit(char *a, unsigned i) |
| 178 | { | 178 | { |
| 179 | return (a[i >> 3] & (1<<(i & 7))) != 0; | 179 | return (a[i >> 3] & (1<<(i & 7))) != 0; |
| 180 | } | 180 | } |
| 181 | 181 | ||
| 182 | #define inode_in_use(x) (bit(inode_map,(x))) | 182 | #define inode_in_use(x) (bit(inode_map,(x))) |
diff --git a/util-linux/minix.h b/util-linux/minix.h new file mode 100644 index 000000000..476f32735 --- /dev/null +++ b/util-linux/minix.h | |||
| @@ -0,0 +1,76 @@ | |||
| 1 | /* | ||
| 2 | * This is the original minix inode layout on disk. | ||
| 3 | * Note the 8-bit gid and atime and ctime. | ||
| 4 | */ | ||
| 5 | struct minix1_inode { | ||
| 6 | uint16_t i_mode; | ||
| 7 | uint16_t i_uid; | ||
| 8 | uint32_t i_size; | ||
| 9 | uint32_t i_time; | ||
| 10 | uint8_t i_gid; | ||
| 11 | uint8_t i_nlinks; | ||
| 12 | uint16_t i_zone[9]; | ||
| 13 | }; | ||
| 14 | |||
| 15 | /* | ||
| 16 | * The new minix inode has all the time entries, as well as | ||
| 17 | * long block numbers and a third indirect block (7+1+1+1 | ||
| 18 | * instead of 7+1+1). Also, some previously 8-bit values are | ||
| 19 | * now 16-bit. The inode is now 64 bytes instead of 32. | ||
| 20 | */ | ||
| 21 | struct minix2_inode { | ||
| 22 | uint16_t i_mode; | ||
| 23 | uint16_t i_nlinks; | ||
| 24 | uint16_t i_uid; | ||
| 25 | uint16_t i_gid; | ||
| 26 | uint32_t i_size; | ||
| 27 | uint32_t i_atime; | ||
| 28 | uint32_t i_mtime; | ||
| 29 | uint32_t i_ctime; | ||
| 30 | uint32_t i_zone[10]; | ||
| 31 | }; | ||
| 32 | |||
| 33 | /* | ||
| 34 | * minix super-block data on disk | ||
| 35 | */ | ||
| 36 | struct minix_super_block { | ||
| 37 | uint16_t s_ninodes; | ||
| 38 | uint16_t s_nzones; | ||
| 39 | uint16_t s_imap_blocks; | ||
| 40 | uint16_t s_zmap_blocks; | ||
| 41 | uint16_t s_firstdatazone; | ||
| 42 | uint16_t s_log_zone_size; | ||
| 43 | uint32_t s_max_size; | ||
| 44 | uint16_t s_magic; | ||
| 45 | uint16_t s_state; | ||
| 46 | uint32_t s_zones; | ||
| 47 | }; | ||
| 48 | |||
| 49 | struct minix_dir_entry { | ||
| 50 | uint16_t inode; | ||
| 51 | char name[0]; | ||
| 52 | }; | ||
| 53 | |||
| 54 | /* Believe it or not, but mount.h has this one #defined */ | ||
| 55 | #undef BLOCK_SIZE | ||
| 56 | |||
| 57 | enum { | ||
| 58 | BLOCK_SIZE = 1024, | ||
| 59 | BITS_PER_BLOCK = BLOCK_SIZE << 3, | ||
| 60 | |||
| 61 | MINIX_ROOT_INO = 1, | ||
| 62 | MINIX_BAD_INO = 2, | ||
| 63 | |||
| 64 | MINIX1_SUPER_MAGIC = 0x137F, /* original minix fs */ | ||
| 65 | MINIX1_SUPER_MAGIC2 = 0x138F, /* minix fs, 30 char names */ | ||
| 66 | MINIX2_SUPER_MAGIC = 0x2468, /* minix V2 fs */ | ||
| 67 | MINIX2_SUPER_MAGIC2 = 0x2478, /* minix V2 fs, 30 char names */ | ||
| 68 | MINIX_VALID_FS = 0x0001, /* clean fs */ | ||
| 69 | MINIX_ERROR_FS = 0x0002, /* fs has errors */ | ||
| 70 | |||
| 71 | INODE_SIZE1 = sizeof(struct minix1_inode), | ||
| 72 | INODE_SIZE2 = sizeof(struct minix2_inode), | ||
| 73 | MINIX1_INODES_PER_BLOCK = BLOCK_SIZE / sizeof(struct minix1_inode), | ||
| 74 | MINIX2_INODES_PER_BLOCK = BLOCK_SIZE / sizeof(struct minix2_inode), | ||
| 75 | }; | ||
| 76 | |||
