1 #ifndef _LINUX_MINIX_FS_H
2 #define _LINUX_MINIX_FS_H
5 * The minix filesystem constants/structures
9 * Thanks to Kees J Bot for sending me the definitions of the new
10 * minix filesystem (aka V2) with bigger inodes and 32-bit block
14 #define MINIX_ROOT_INO 1
16 /* Not the same as the bogus LINK_MAX in <linux/limits.h>. Oh well. */
17 #define MINIX_LINK_MAX 250
18 #define MINIX2_LINK_MAX 65530
20 #define MINIX_I_MAP_SLOTS 8
21 #define MINIX_Z_MAP_SLOTS 64
22 #define MINIX_SUPER_MAGIC 0x137F /* original minix fs */
23 #define MINIX_SUPER_MAGIC2 0x138F /* minix fs, 30 char names */
24 #define MINIX2_SUPER_MAGIC 0x2468 /* minix V2 fs */
25 #define MINIX2_SUPER_MAGIC2 0x2478 /* minix V2 fs, 30 char names */
26 #define MINIX_VALID_FS 0x0001 /* Clean fs. */
27 #define MINIX_ERROR_FS 0x0002 /* fs has errors. */
29 #define MINIX_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct minix_inode)))
30 #define MINIX2_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct minix2_inode)))
32 #define MINIX_V1 0x0001 /* original minix fs */
33 #define MINIX_V2 0x0002 /* minix V2 fs */
35 #define INODE_VERSION(inode) inode->i_sb->u.minix_sb.s_version
38 * This is the original minix inode layout on disk.
39 * Note the 8-bit gid and atime and ctime.
52 * The new minix inode has all the time entries, as well as
53 * long block numbers and a third indirect block (7+1+1+1
54 * instead of 7+1+1). Also, some previously 8-bit values are
55 * now 16-bit. The inode is now 64 bytes instead of 32.
70 * minix super-block data on disk
72 struct minix_super_block
{
77 __u16 s_firstdatazone
;
78 __u16 s_log_zone_size
;
85 struct minix_dir_entry
{
92 extern struct dentry
*minix_lookup(struct inode
* dir
, struct dentry
*dentry
);
93 extern int minix_create(struct inode
* dir
, struct dentry
*dentry
, int mode
);
94 extern int minix_mkdir(struct inode
* dir
, struct dentry
*dentry
, int mode
);
95 extern int minix_rmdir(struct inode
* dir
, struct dentry
*dentry
);
96 extern int minix_unlink(struct inode
* dir
, struct dentry
*dentry
);
97 extern int minix_symlink(struct inode
* inode
, struct dentry
*dentry
,
98 const char * symname
);
99 extern int minix_link(struct dentry
* old_dentry
, struct inode
* dir
, struct dentry
*dentry
);
100 extern int minix_mknod(struct inode
* dir
, struct dentry
*dentry
, int mode
, int rdev
);
101 extern int minix_rename(struct inode
* old_dir
, struct dentry
*old_dentry
,
102 struct inode
* new_dir
, struct dentry
*new_dentry
);
103 extern struct inode
* minix_new_inode(const struct inode
* dir
);
104 extern void minix_free_inode(struct inode
* inode
);
105 extern unsigned long minix_count_free_inodes(struct super_block
*sb
);
106 extern int minix_new_block(struct super_block
* sb
);
107 extern void minix_free_block(struct super_block
* sb
, int block
);
108 extern unsigned long minix_count_free_blocks(struct super_block
*sb
);
110 extern int minix_bmap(struct inode
*,int);
112 extern struct buffer_head
* minix_getblk(struct inode
*, int, int);
113 extern struct buffer_head
* minix_bread(struct inode
*, int, int);
115 extern void minix_truncate(struct inode
*);
116 extern int init_minix_fs(void);
117 extern int minix_sync_inode(struct inode
*);
118 extern int minix_sync_file(struct file
*, struct dentry
*);
120 extern struct inode_operations minix_file_inode_operations
;
121 extern struct inode_operations minix_dir_inode_operations
;
122 extern struct inode_operations minix_symlink_inode_operations
;
123 extern struct dentry_operations minix_dentry_operations
;
125 #endif /* __KERNEL__ */