1 #ifndef _LINUX_MINIX_FS_H
2 #define _LINUX_MINIX_FS_H
3
4
5
6
7
8
9
10
11
12
13
14
15 #define MINIX_ROOT_INO 1
16
17
18 #define MINIX_LINK_MAX 250
19
20 #define MINIX_I_MAP_SLOTS 8
21 #define MINIX_Z_MAP_SLOTS 8
22 #define MINIX_SUPER_MAGIC 0x137F
23 #define MINIX_SUPER_MAGIC2 0x138F
24 #define NEW_MINIX_SUPER_MAGIC 0x2468
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
30
31
32
33
34 struct 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
46
47
48
49
50 struct new_minix_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
64
65 struct 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 };
76
77 struct minix_dir_entry {
78 __u16 inode;
79 char name[0];
80 };
81
82 #ifdef __KERNEL__
83
84 extern int minix_lookup(struct inode * dir,const char * name, int len,
85 struct inode ** result);
86 extern int minix_create(struct inode * dir,const char * name, int len, int mode,
87 struct inode ** result);
88 extern int minix_mkdir(struct inode * dir, const char * name, int len, int mode);
89 extern int minix_rmdir(struct inode * dir, const char * name, int len);
90 extern int minix_unlink(struct inode * dir, const char * name, int len);
91 extern int minix_symlink(struct inode * inode, const char * name, int len,
92 const char * symname);
93 extern int minix_link(struct inode * oldinode, struct inode * dir, const char * name, int len);
94 extern int minix_mknod(struct inode * dir, const char * name, int len, int mode, int rdev);
95 extern int minix_rename(struct inode * old_dir, const char * old_name, int old_len,
96 struct inode * new_dir, const char * new_name, int new_len);
97 extern struct inode * minix_new_inode(const struct inode * dir);
98 extern void minix_free_inode(struct inode * inode);
99 extern unsigned long minix_count_free_inodes(struct super_block *sb);
100 extern int minix_new_block(struct super_block * sb);
101 extern void minix_free_block(struct super_block * sb, int block);
102 extern unsigned long minix_count_free_blocks(struct super_block *sb);
103
104 extern int minix_bmap(struct inode *,int);
105
106 extern struct buffer_head * minix_getblk(struct inode *, int, int);
107 extern struct buffer_head * minix_bread(struct inode *, int, int);
108
109 extern void minix_truncate(struct inode *);
110 extern void minix_put_super(struct super_block *);
111 extern struct super_block *minix_read_super(struct super_block *,void *,int);
112 extern void minix_write_super(struct super_block *);
113 extern int minix_remount (struct super_block * sb, int * flags, char * data);
114 extern void minix_read_inode(struct inode *);
115 extern void minix_write_inode(struct inode *);
116 extern void minix_put_inode(struct inode *);
117 extern void minix_statfs(struct super_block *, struct statfs *, int);
118 extern int minix_sync_inode(struct inode *);
119 extern int minix_sync_file(struct inode *, struct file *);
120
121 extern struct inode_operations minix_file_inode_operations;
122 extern struct inode_operations minix_dir_inode_operations;
123 extern struct inode_operations minix_symlink_inode_operations;
124
125 #endif
126
127 #endif