| 1 | #ifndef _LINUX_MINIX_FS_H |
|---|
| 2 | #define _LINUX_MINIX_FS_H |
|---|
| 3 | |
|---|
| 4 | /* |
|---|
| 5 | * The minix filesystem constants/structures |
|---|
| 6 | */ |
|---|
| 7 | |
|---|
| 8 | /* |
|---|
| 9 | * Thanks to Kees J Bot for sending me the definitions of the new |
|---|
| 10 | * minix filesystem (aka V2) with bigger inodes and 32-bit block |
|---|
| 11 | * pointers. |
|---|
| 12 | */ |
|---|
| 13 | |
|---|
| 14 | #include <asm/types.h> |
|---|
| 15 | |
|---|
| 16 | #define MINIX_ROOT_INO 1 |
|---|
| 17 | |
|---|
| 18 | /* Not the same as the bogus LINK_MAX in <linux/limits.h>. Oh well. */ |
|---|
| 19 | #define MINIX_LINK_MAX 250 |
|---|
| 20 | #define MINIX2_LINK_MAX 65530 |
|---|
| 21 | |
|---|
| 22 | #define MINIX_I_MAP_SLOTS 8 |
|---|
| 23 | #define MINIX_Z_MAP_SLOTS 64 |
|---|
| 24 | #define MINIX_SUPER_MAGIC 0x137F /* original minix fs */ |
|---|
| 25 | #define MINIX_SUPER_MAGIC2 0x138F /* minix fs, 30 char names */ |
|---|
| 26 | #define MINIX2_SUPER_MAGIC 0x2468 /* minix V2 fs */ |
|---|
| 27 | #define MINIX2_SUPER_MAGIC2 0x2478 /* minix V2 fs, 30 char names */ |
|---|
| 28 | #define MINIX_VALID_FS 0x0001 /* Clean fs. */ |
|---|
| 29 | #define MINIX_ERROR_FS 0x0002 /* fs has errors. */ |
|---|
| 30 | |
|---|
| 31 | #define MINIX_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct minix_inode))) |
|---|
| 32 | #define MINIX2_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct minix2_inode))) |
|---|
| 33 | |
|---|
| 34 | /* |
|---|
| 35 | * This is the original minix inode layout on disk. |
|---|
| 36 | * Note the 8-bit gid and atime and ctime. |
|---|
| 37 | */ |
|---|
| 38 | struct minix_inode { |
|---|
| 39 | __u16 i_mode; |
|---|
| 40 | __u16 i_uid; |
|---|
| 41 | __u32 i_size; |
|---|
| 42 | __u32 i_time; |
|---|
| 43 | __u8 i_gid; |
|---|
| 44 | __u8 i_nlinks; |
|---|
| 45 | __u16 i_zone[9]; |
|---|
| 46 | }; |
|---|
| 47 | |
|---|
| 48 | /* |
|---|
| 49 | * The new minix inode has all the time entries, as well as |
|---|
| 50 | * long block numbers and a third indirect block (7+1+1+1 |
|---|
| 51 | * instead of 7+1+1). Also, some previously 8-bit values are |
|---|
| 52 | * now 16-bit. The inode is now 64 bytes instead of 32. |
|---|
| 53 | */ |
|---|
| 54 | struct minix2_inode { |
|---|
| 55 | __u16 i_mode; |
|---|
| 56 | __u16 i_nlinks; |
|---|
| 57 | __u16 i_uid; |
|---|
| 58 | __u16 i_gid; |
|---|
| 59 | __u32 i_size; |
|---|
| 60 | __u32 i_atime; |
|---|
| 61 | __u32 i_mtime; |
|---|
| 62 | __u32 i_ctime; |
|---|
| 63 | __u32 i_zone[10]; |
|---|
| 64 | }; |
|---|
| 65 | |
|---|
| 66 | /* |
|---|
| 67 | * minix super-block data on disk |
|---|
| 68 | */ |
|---|
| 69 | struct minix_super_block { |
|---|
| 70 | __u16 s_ninodes; |
|---|
| 71 | __u16 s_nzones; |
|---|
| 72 | __u16 s_imap_blocks; |
|---|
| 73 | __u16 s_zmap_blocks; |
|---|
| 74 | __u16 s_firstdatazone; |
|---|
| 75 | __u16 s_log_zone_size; |
|---|
| 76 | __u32 s_max_size; |
|---|
| 77 | __u16 s_magic; |
|---|
| 78 | __u16 s_state; |
|---|
| 79 | __u32 s_zones; |
|---|
| 80 | }; |
|---|
| 81 | |
|---|
| 82 | struct minix_dir_entry { |
|---|
| 83 | __u16 inode; |
|---|
| 84 | char name[0]; |
|---|
| 85 | }; |
|---|
| 86 | |
|---|
| 87 | #endif |
|---|