1#ifndef FS_MINIX_H
2#define FS_MINIX_H
3
4#include <linux/fs.h>
5#include <linux/pagemap.h>
6#include <linux/minix_fs.h>
7
8#define INODE_VERSION(inode) minix_sb(inode->i_sb)->s_version
9#define MINIX_V1 0x0001
10#define MINIX_V2 0x0002
11#define MINIX_V3 0x0003
12
13
14
15
16struct minix_inode_info {
17 union {
18 __u16 i1_data[16];
19 __u32 i2_data[16];
20 } u;
21 struct inode vfs_inode;
22};
23
24
25
26
27struct minix_sb_info {
28 unsigned long s_ninodes;
29 unsigned long s_nzones;
30 unsigned long s_imap_blocks;
31 unsigned long s_zmap_blocks;
32 unsigned long s_firstdatazone;
33 unsigned long s_log_zone_size;
34 unsigned long s_max_size;
35 int s_dirsize;
36 int s_namelen;
37 int s_link_max;
38 struct buffer_head ** s_imap;
39 struct buffer_head ** s_zmap;
40 struct buffer_head * s_sbh;
41 struct minix_super_block * s_ms;
42 unsigned short s_mount_state;
43 unsigned short s_version;
44};
45
46extern struct inode *minix_iget(struct super_block *, unsigned long);
47extern struct minix_inode * minix_V1_raw_inode(struct super_block *, ino_t, struct buffer_head **);
48extern struct minix2_inode * minix_V2_raw_inode(struct super_block *, ino_t, struct buffer_head **);
49extern struct inode * minix_new_inode(const struct inode * dir, int * error);
50extern void minix_free_inode(struct inode * inode);
51extern unsigned long minix_count_free_inodes(struct minix_sb_info *sbi);
52extern int minix_new_block(struct inode * inode);
53extern void minix_free_block(struct inode *inode, unsigned long block);
54extern unsigned long minix_count_free_blocks(struct minix_sb_info *sbi);
55extern int minix_getattr(struct vfsmount *, struct dentry *, struct kstat *);
56extern int __minix_write_begin(struct file *file, struct address_space *mapping,
57 loff_t pos, unsigned len, unsigned flags,
58 struct page **pagep, void **fsdata);
59
60extern void V1_minix_truncate(struct inode *);
61extern void V2_minix_truncate(struct inode *);
62extern void minix_truncate(struct inode *);
63extern void minix_set_inode(struct inode *, dev_t);
64extern int V1_minix_get_block(struct inode *, long, struct buffer_head *, int);
65extern int V2_minix_get_block(struct inode *, long, struct buffer_head *, int);
66extern unsigned V1_minix_blocks(loff_t, struct super_block *);
67extern unsigned V2_minix_blocks(loff_t, struct super_block *);
68
69extern struct minix_dir_entry *minix_find_entry(struct dentry*, struct page**);
70extern int minix_add_link(struct dentry*, struct inode*);
71extern int minix_delete_entry(struct minix_dir_entry*, struct page*);
72extern int minix_make_empty(struct inode*, struct inode*);
73extern int minix_empty_dir(struct inode*);
74extern void minix_set_link(struct minix_dir_entry*, struct page*, struct inode*);
75extern struct minix_dir_entry *minix_dotdot(struct inode*, struct page**);
76extern ino_t minix_inode_by_name(struct dentry*);
77
78extern const struct inode_operations minix_file_inode_operations;
79extern const struct inode_operations minix_dir_inode_operations;
80extern const struct file_operations minix_file_operations;
81extern const struct file_operations minix_dir_operations;
82
83static inline struct minix_sb_info *minix_sb(struct super_block *sb)
84{
85 return sb->s_fs_info;
86}
87
88static inline struct minix_inode_info *minix_i(struct inode *inode)
89{
90 return list_entry(inode, struct minix_inode_info, vfs_inode);
91}
92
93#endif
94