blob: 0e39745f5111b90d930998aae2caadade96c99e8 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef _LINUX_MINIX_FS_H
2#define _LINUX_MINIX_FS_H
3
Jeff Garzike18fa702006-09-24 11:13:19 -04004#include <linux/magic.h>
5
Linus Torvalds1da177e2005-04-16 15:20:36 -07006/*
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 Torvalds1da177e2005-04-16 15:20:36 -070024#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 Torvalds1da177e2005-04-16 15:20:36 -070028
29/*
30 * This is the original minix inode layout on disk.
31 * Note the 8-bit gid and atime and ctime.
32 */
33struct 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 */
49struct 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 */
64struct 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 Brouwer939b00d2007-02-12 00:52:49 -080077/*
78 * V3 minix super-block data on disk
79 */
80struct minix3_super_block {
Andries Brouwerf4fa27c2007-02-20 13:57:47 -080081 __u32 s_ninodes;
Andries Brouwer939b00d2007-02-12 00:52:49 -080082 __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 Torvalds1da177e2005-04-16 15:20:36 -070096struct minix_dir_entry {
97 __u16 inode;
98 char name[0];
99};
100
Andries Brouwer939b00d2007-02-12 00:52:49 -0800101struct minix3_dir_entry {
102 __u32 inode;
103 char name[0];
104};
Linus Torvalds1da177e2005-04-16 15:20:36 -0700105#endif