Sync to trunk head(r38096)
[reactos.git] / rosapps / drivers / ramdrv / minix / minix_fs.h
1 #define MINIX_ROOT_INO 1
2
3 /* Not the same as the bogus LINK_MAX in <linux/limits.h>. Oh well. */
4 #define MINIX_LINK_MAX 250
5
6 #define MINIX_I_MAP_SLOTS 8
7 #define MINIX_Z_MAP_SLOTS 64
8 #define MINIX_SUPER_MAGIC 0x137F /* original minix fs */
9 #define MINIX_SUPER_MAGIC2 0x138F /* minix fs, 30 char names */
10 #define MINIX2_SUPER_MAGIC 0x2468 /* minix V2 fs */
11 #define MINIX2_SUPER_MAGIC2 0x2478 /* minix V2 fs, 30 char names */
12 #define MINIX_VALID_FS 0x0001 /* Clean fs. */
13 #define MINIX_ERROR_FS 0x0002 /* fs has errors. */
14
15 #define MINIX_INODES_PER_BLOCK ((BLOCKSIZE)/(sizeof (struct minix_inode)))
16 #define MINIX2_INODES_PER_BLOCK ((BLOCKSIZE)/(sizeof (struct minix2_inode)))
17
18 #define MINIX_V1 0x0001 /* original minix fs */
19 #define MINIX_V2 0x0002 /* minix V2 fs */
20
21
22 /*
23 * This is the original minix inode layout on disk.
24 * Note the 8-bit gid and atime and ctime.
25 */
26 struct minix_inode {
27 unsigned short int i_mode;
28 unsigned short int i_uid;
29 unsigned long i_size;
30 unsigned long i_time;
31 unsigned char i_gid;
32 unsigned char i_nlinks;
33 unsigned short int i_zone[9];
34 };
35
36 /*
37 * The new minix inode has all the time entries, as well as
38 * long block numbers and a third indirect block (7+1+1+1
39 * instead of 7+1+1). Also, some previously 8-bit values are
40 * now 16-bit. The inode is now 64 bytes instead of 32.
41 */
42 struct minix2_inode {
43 unsigned short int i_mode;
44 unsigned short int i_nlinks;
45 unsigned short int i_uid;
46 unsigned short int i_gid;
47 unsigned long i_size;
48 unsigned long i_atime;
49 unsigned long i_mtime;
50 unsigned long i_ctime;
51 unsigned long i_zone[10];
52 };
53
54 /*
55 * minix super-block data on disk
56 */
57 struct minix_super_block {
58 unsigned short int s_ninodes;
59 unsigned short int s_nzones;
60 unsigned short int s_imap_blocks;
61 unsigned short int s_zmap_blocks;
62 unsigned short int s_firstdatazone;
63 unsigned short int s_log_zone_size;
64 unsigned long s_max_size;
65 unsigned short int s_magic;
66 unsigned short int s_state;
67 unsigned long s_zones;
68 };
69
70 struct minix_dir_entry {
71 unsigned short int inode;
72 char name[0];
73 };
74 #define MINIX_DIR_ENTRY_SIZE (sizeof(struct minix_dir_entry)+30)
75
76 BOOLEAN MinixReadSector(IN PDEVICE_OBJECT pDeviceObject,
77 IN ULONG DiskSector,
78 IN UCHAR* Buffer);
79
80 #define BLOCKSIZE (1024)