1 #ifndef _LINUX_MINIX_FS_H
2 #define _LINUX_MINIX_FS_H
3
4
5
6
7
8
9
10
11
12
13
14 #define MINIX_ROOT_INO 1
15
16
17 #define MINIX_LINK_MAX 250
18
19 #define MINIX_I_MAP_SLOTS 8
20 #define MINIX_Z_MAP_SLOTS 64
21 #define MINIX_SUPER_MAGIC 0x137F
22 #define MINIX_SUPER_MAGIC2 0x138F
23 #define MINIX2_SUPER_MAGIC 0x2468
24 #define MINIX2_SUPER_MAGIC2 0x2478
25 #define MINIX_VALID_FS 0x0001
26 #define MINIX_ERROR_FS 0x0002
27
28 #define MINIX_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct minix_inode)))
29 #define MINIX2_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct minix2_inode)))
30
31 #define MINIX_V1 0x0001
32 #define MINIX_V2 0x0002
33
34 #define INODE_VERSION(inode) inode->i_sb->u.minix_sb.s_version
35
36
37
38
39
40 struct minix_inode {
41 __u16 i_mode;
42 __u16 i_uid;
43 __u32 i_size;
44 __u32 i_time;
45 __u8 i_gid;
46 __u8 i_nlinks;
47 __u16 i_zone[9];
48 };
49
50
51
52
53
54
55
56 struct minix2_inode {
57 __u16 i_mode;
58 __u16 i_nlinks;
59 __u16 i_uid;
60 __u16 i_gid;
61 __u32 i_size;
62 __u32 i_atime;
63 __u32 i_mtime;
64 __u32 i_ctime;
65 __u32 i_zone[10];
66 };
67
68
69
70
71 struct minix_super_block {
72 __u16 s_ninodes;
73 __u16 s_nzones;
74 __u16 s_imap_blocks;
75 __u16 s_zmap_blocks;
76 __u16 s_firstdatazone;
77 __u16 s_log_zone_size;
78 __u32 s_max_size;
79 __u16 s_magic;
80 __u16 s_state;
81 __u32 s_zones;
82 };
83
84 struct minix_dir_entry {
85 __u16 inode;
86 char name[0];
87 };
88
89 #ifdef __KERNEL__
90
91 extern int minix_lookup(struct inode * dir,const char * name, int len,
92 struct inode ** result);
93 extern int minix_create(struct inode * dir,const char * name, int len, int mode,
94 struct inode ** result);
95 extern int minix_mkdir(struct inode * dir, const char * name, int len, int mode);
96 extern int minix_rmdir(struct inode * dir, const char * name, int len);
97 extern int minix_unlink(struct inode * dir, const char * name, int len);
98 extern int minix_symlink(struct inode * inode, const char * name, int len,
99 const char * symname);
100 extern int minix_link(struct inode * oldinode, struct inode * dir, const char * name, int len);
101 extern int minix_mknod(struct inode * dir, const char * name, int len, int mode, int rdev);
102 extern int minix_rename(struct inode * old_dir, const char * old_name, int old_len,
103 struct inode * new_dir, const char * new_name, int new_len);
104 extern struct inode * minix_new_inode(const struct inode * dir);
105 extern void minix_free_inode(struct inode * inode);
106 extern unsigned long minix_count_free_inodes(struct super_block *sb);
107 extern int minix_new_block(struct super_block * sb);
108 extern void minix_free_block(struct super_block * sb, int block);
109 extern unsigned long minix_count_free_blocks(struct super_block *sb);
110
111 extern int minix_bmap(struct inode *,int);
112
113 extern struct buffer_head * minix_getblk(struct inode *, int, int);
114 extern struct buffer_head * minix_bread(struct inode *, int, int);
115
116 extern void minix_truncate(struct inode *);
117 extern void minix_put_super(struct super_block *);
118 extern struct super_block *minix_read_super(struct super_block *,void *,int);
119 extern int init_minix_fs(void);
120 extern void minix_write_super(struct super_block *);
121 extern int minix_remount (struct super_block * sb, int * flags, char * data);
122 extern void minix_read_inode(struct inode *);
123 extern void minix_write_inode(struct inode *);
124 extern void minix_put_inode(struct inode *);
125 extern void minix_statfs(struct super_block *, struct statfs *, int);
126 extern int minix_sync_inode(struct inode *);
127 extern int minix_sync_file(struct inode *, struct file *);
128
129 extern struct inode_operations minix_file_inode_operations;
130 extern struct inode_operations minix_dir_inode_operations;
131 extern struct inode_operations minix_symlink_inode_operations;
132
133 #endif
134
135 #endif