blob: 13fe09e0576a3c30064a3f81f785d97dd13c3155 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef _LINUX_MINIX_FS_H
2#define _LINUX_MINIX_FS_H
3
Jaswinder Singh Rajput4b7ae342009-01-30 21:54:23 +05304#include <linux/types.h>
Jeff Garzike18fa702006-09-24 11:13:19 -04005#include <linux/magic.h>
6
Linus Torvalds1da177e2005-04-16 15:20:36 -07007/*
8 * The minix filesystem constants/structures
9 */
10
11/*
12 * Thanks to Kees J Bot for sending me the definitions of the new
13 * minix filesystem (aka V2) with bigger inodes and 32-bit block
14 * pointers.
15 */
16
17#define MINIX_ROOT_INO 1
18
19/* Not the same as the bogus LINK_MAX in <linux/limits.h>. Oh well. */
20#define MINIX_LINK_MAX 250
21#define MINIX2_LINK_MAX 65530
22
23#define MINIX_I_MAP_SLOTS 8
24#define MINIX_Z_MAP_SLOTS 64
Linus Torvalds1da177e2005-04-16 15:20:36 -070025#define MINIX_VALID_FS 0x0001 /* Clean fs. */
26#define MINIX_ERROR_FS 0x0002 /* fs has errors. */
27
28#define MINIX_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct minix_inode)))
Linus Torvalds1da177e2005-04-16 15:20:36 -070029
30/*
31 * This is the original minix inode layout on disk.
32 * Note the 8-bit gid and atime and ctime.
33 */
34struct minix_inode {
35 __u16 i_mode;
36 __u16 i_uid;
37 __u32 i_size;
38 __u32 i_time;
39 __u8 i_gid;
40 __u8 i_nlinks;
41 __u16 i_zone[9];
42};
43
44/*
45 * The new minix inode has all the time entries, as well as
46 * long block numbers and a third indirect block (7+1+1+1
47 * instead of 7+1+1). Also, some previously 8-bit values are
48 * now 16-bit. The inode is now 64 bytes instead of 32.
49 */
50struct minix2_inode {
51 __u16 i_mode;
52 __u16 i_nlinks;
53 __u16 i_uid;
54 __u16 i_gid;
55 __u32 i_size;
56 __u32 i_atime;
57 __u32 i_mtime;
58 __u32 i_ctime;
59 __u32 i_zone[10];
60};
61
62/*
63 * minix super-block data on disk
64 */
65struct minix_super_block {
66 __u16 s_ninodes;
67 __u16 s_nzones;
68 __u16 s_imap_blocks;
69 __u16 s_zmap_blocks;
70 __u16 s_firstdatazone;
71 __u16 s_log_zone_size;
72 __u32 s_max_size;
73 __u16 s_magic;
74 __u16 s_state;
75 __u32 s_zones;
76};
77
Andries Brouwer939b00d2007-02-12 00:52:49 -080078/*
79 * V3 minix super-block data on disk
80 */
81struct minix3_super_block {
Andries Brouwerf4fa27c2007-02-20 13:57:47 -080082 __u32 s_ninodes;
Andries Brouwer939b00d2007-02-12 00:52:49 -080083 __u16 s_pad0;
84 __u16 s_imap_blocks;
85 __u16 s_zmap_blocks;
86 __u16 s_firstdatazone;
87 __u16 s_log_zone_size;
88 __u16 s_pad1;
89 __u32 s_max_size;
90 __u32 s_zones;
91 __u16 s_magic;
92 __u16 s_pad2;
93 __u16 s_blocksize;
94 __u8 s_disk_version;
95};
96
Linus Torvalds1da177e2005-04-16 15:20:36 -070097struct minix_dir_entry {
98 __u16 inode;
99 char name[0];
100};
101
Andries Brouwer939b00d2007-02-12 00:52:49 -0800102struct minix3_dir_entry {
103 __u32 inode;
104 char name[0];
105};
Linus Torvalds1da177e2005-04-16 15:20:36 -0700106#endif