Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef _LINUX_MINIX_FS_H |
| 2 | #define _LINUX_MINIX_FS_H |
| 3 | |
Jeff Garzik | e18fa70 | 2006-09-24 11:13:19 -0400 | [diff] [blame] | 4 | #include <linux/magic.h> |
| 5 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 6 | /* |
| 7 | * The minix filesystem constants/structures |
| 8 | */ |
| 9 | |
| 10 | /* |
| 11 | * Thanks to Kees J Bot for sending me the definitions of the new |
| 12 | * minix filesystem (aka V2) with bigger inodes and 32-bit block |
| 13 | * pointers. |
| 14 | */ |
| 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 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 24 | #define MINIX_VALID_FS 0x0001 /* Clean fs. */ |
| 25 | #define MINIX_ERROR_FS 0x0002 /* fs has errors. */ |
| 26 | |
| 27 | #define MINIX_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct minix_inode))) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 28 | |
| 29 | /* |
| 30 | * This is the original minix inode layout on disk. |
| 31 | * Note the 8-bit gid and atime and ctime. |
| 32 | */ |
| 33 | struct minix_inode { |
| 34 | __u16 i_mode; |
| 35 | __u16 i_uid; |
| 36 | __u32 i_size; |
| 37 | __u32 i_time; |
| 38 | __u8 i_gid; |
| 39 | __u8 i_nlinks; |
| 40 | __u16 i_zone[9]; |
| 41 | }; |
| 42 | |
| 43 | /* |
| 44 | * The new minix inode has all the time entries, as well as |
| 45 | * long block numbers and a third indirect block (7+1+1+1 |
| 46 | * instead of 7+1+1). Also, some previously 8-bit values are |
| 47 | * now 16-bit. The inode is now 64 bytes instead of 32. |
| 48 | */ |
| 49 | struct minix2_inode { |
| 50 | __u16 i_mode; |
| 51 | __u16 i_nlinks; |
| 52 | __u16 i_uid; |
| 53 | __u16 i_gid; |
| 54 | __u32 i_size; |
| 55 | __u32 i_atime; |
| 56 | __u32 i_mtime; |
| 57 | __u32 i_ctime; |
| 58 | __u32 i_zone[10]; |
| 59 | }; |
| 60 | |
| 61 | /* |
| 62 | * minix super-block data on disk |
| 63 | */ |
| 64 | struct minix_super_block { |
| 65 | __u16 s_ninodes; |
| 66 | __u16 s_nzones; |
| 67 | __u16 s_imap_blocks; |
| 68 | __u16 s_zmap_blocks; |
| 69 | __u16 s_firstdatazone; |
| 70 | __u16 s_log_zone_size; |
| 71 | __u32 s_max_size; |
| 72 | __u16 s_magic; |
| 73 | __u16 s_state; |
| 74 | __u32 s_zones; |
| 75 | }; |
| 76 | |
Andries Brouwer | 939b00d | 2007-02-12 00:52:49 -0800 | [diff] [blame] | 77 | /* |
| 78 | * V3 minix super-block data on disk |
| 79 | */ |
| 80 | struct minix3_super_block { |
Andries Brouwer | f4fa27c | 2007-02-20 13:57:47 -0800 | [diff] [blame] | 81 | __u32 s_ninodes; |
Andries Brouwer | 939b00d | 2007-02-12 00:52:49 -0800 | [diff] [blame] | 82 | __u16 s_pad0; |
| 83 | __u16 s_imap_blocks; |
| 84 | __u16 s_zmap_blocks; |
| 85 | __u16 s_firstdatazone; |
| 86 | __u16 s_log_zone_size; |
| 87 | __u16 s_pad1; |
| 88 | __u32 s_max_size; |
| 89 | __u32 s_zones; |
| 90 | __u16 s_magic; |
| 91 | __u16 s_pad2; |
| 92 | __u16 s_blocksize; |
| 93 | __u8 s_disk_version; |
| 94 | }; |
| 95 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 96 | struct minix_dir_entry { |
| 97 | __u16 inode; |
| 98 | char name[0]; |
| 99 | }; |
| 100 | |
Andries Brouwer | 939b00d | 2007-02-12 00:52:49 -0800 | [diff] [blame] | 101 | struct minix3_dir_entry { |
| 102 | __u32 inode; |
| 103 | char name[0]; |
| 104 | }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 105 | #endif |