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 struct minix_inode {
31 unsigned short i_mode;
32 unsigned short i_uid;
33 unsigned long i_size;
34 unsigned long i_time;
35 unsigned char i_gid;
36 unsigned char i_nlinks;
37 unsigned short i_zone[9];
38 };
39
40
41
42
43
44
45
46 struct new_minix_inode {
47 unsigned short i_mode;
48 unsigned short i_nlinks;
49 unsigned short i_uid;
50 unsigned short i_gid;
51 unsigned long i_size;
52 unsigned long i_atime;
53 unsigned long i_mtime;
54 unsigned long i_ctime;
55 unsigned long i_zone[10];
56 };
57
58
59
60
61 struct minix_super_block {
62 unsigned short s_ninodes;
63 unsigned short s_nzones;
64 unsigned short s_imap_blocks;
65 unsigned short s_zmap_blocks;
66 unsigned short s_firstdatazone;
67 unsigned short s_log_zone_size;
68 unsigned long s_max_size;
69 unsigned short s_magic;
70 unsigned short s_state;
71 };
72
73 struct minix_dir_entry {
74 unsigned short inode;
75 char name[0];
76 };
77
78 extern int minix_lookup(struct inode * dir,const char * name, int len,
79 struct inode ** result);
80 extern int minix_create(struct inode * dir,const char * name, int len, int mode,
81 struct inode ** result);
82 extern int minix_mkdir(struct inode * dir, const char * name, int len, int mode);
83 extern int minix_rmdir(struct inode * dir, const char * name, int len);
84 extern int minix_unlink(struct inode * dir, const char * name, int len);
85 extern int minix_symlink(struct inode * inode, const char * name, int len,
86 const char * symname);
87 extern int minix_link(struct inode * oldinode, struct inode * dir, const char * name, int len);
88 extern int minix_mknod(struct inode * dir, const char * name, int len, int mode, int rdev);
89 extern int minix_rename(struct inode * old_dir, const char * old_name, int old_len,
90 struct inode * new_dir, const char * new_name, int new_len);
91 extern struct inode * minix_new_inode(const struct inode * dir);
92 extern void minix_free_inode(struct inode * inode);
93 extern unsigned long minix_count_free_inodes(struct super_block *sb);
94 extern int minix_new_block(struct super_block * sb);
95 extern void minix_free_block(struct super_block * sb, int block);
96 extern unsigned long minix_count_free_blocks(struct super_block *sb);
97
98 extern int minix_bmap(struct inode *,int);
99
100 extern struct buffer_head * minix_getblk(struct inode *, int, int);
101 extern struct buffer_head * minix_bread(struct inode *, int, int);
102
103 extern void minix_truncate(struct inode *);
104 extern void minix_put_super(struct super_block *);
105 extern struct super_block *minix_read_super(struct super_block *,void *,int);
106 extern void minix_write_super(struct super_block *);
107 extern int minix_remount (struct super_block * sb, int * flags, char * data);
108 extern void minix_read_inode(struct inode *);
109 extern void minix_write_inode(struct inode *);
110 extern void minix_put_inode(struct inode *);
111 extern void minix_statfs(struct super_block *, struct statfs *);
112 extern int minix_sync_inode(struct inode *);
113 extern int minix_sync_file(struct inode *, struct file *);
114
115 extern struct inode_operations minix_file_inode_operations;
116 extern struct inode_operations minix_dir_inode_operations;
117 extern struct inode_operations minix_symlink_inode_operations;
118
119 #endif