2 #include <linux/pagemap.h>
3 #include <linux/minix_fs.h>
6 * change the define below to 0 if you want names > info->s_namelen chars to be
7 * truncated. Else they will be disallowed (ENAMETOOLONG).
10 #define INODE_VERSION(inode) minix_sb(inode->i_sb)->s_version
11 #define MINIX_V1 0x0001 /* original minix fs */
12 #define MINIX_V2 0x0002 /* minix V2 fs */
13 #define MINIX_V3 0x0003 /* minix V3 fs */
16 * minix fs inode data in memory
18 struct minix_inode_info
{
23 struct inode vfs_inode
;
27 * minix super-block data in memory
29 struct minix_sb_info
{
30 unsigned long s_ninodes
;
31 unsigned long s_nzones
;
32 unsigned long s_imap_blocks
;
33 unsigned long s_zmap_blocks
;
34 unsigned long s_firstdatazone
;
35 unsigned long s_log_zone_size
;
36 unsigned long s_max_size
;
40 struct buffer_head
** s_imap
;
41 struct buffer_head
** s_zmap
;
42 struct buffer_head
* s_sbh
;
43 struct minix_super_block
* s_ms
;
44 unsigned short s_mount_state
;
45 unsigned short s_version
;
48 extern struct minix_inode
* minix_V1_raw_inode(struct super_block
*, ino_t
, struct buffer_head
**);
49 extern struct minix2_inode
* minix_V2_raw_inode(struct super_block
*, ino_t
, struct buffer_head
**);
50 extern struct inode
* minix_new_inode(const struct inode
* dir
, int * error
);
51 extern void minix_free_inode(struct inode
* inode
);
52 extern unsigned long minix_count_free_inodes(struct minix_sb_info
*sbi
);
53 extern int minix_new_block(struct inode
* inode
);
54 extern void minix_free_block(struct inode
*inode
, unsigned long block
);
55 extern unsigned long minix_count_free_blocks(struct minix_sb_info
*sbi
);
56 extern int minix_getattr(struct vfsmount
*, struct dentry
*, struct kstat
*);
58 extern void V1_minix_truncate(struct inode
*);
59 extern void V2_minix_truncate(struct inode
*);
60 extern void minix_truncate(struct inode
*);
61 extern int minix_sync_inode(struct inode
*);
62 extern void minix_set_inode(struct inode
*, dev_t
);
63 extern int V1_minix_get_block(struct inode
*, long, struct buffer_head
*, int);
64 extern int V2_minix_get_block(struct inode
*, long, struct buffer_head
*, int);
65 extern unsigned V1_minix_blocks(loff_t
, struct super_block
*);
66 extern unsigned V2_minix_blocks(loff_t
, struct super_block
*);
68 extern struct minix_dir_entry
*minix_find_entry(struct dentry
*, struct page
**);
69 extern int minix_add_link(struct dentry
*, struct inode
*);
70 extern int minix_delete_entry(struct minix_dir_entry
*, struct page
*);
71 extern int minix_make_empty(struct inode
*, struct inode
*);
72 extern int minix_empty_dir(struct inode
*);
73 extern void minix_set_link(struct minix_dir_entry
*, struct page
*, struct inode
*);
74 extern struct minix_dir_entry
*minix_dotdot(struct inode
*, struct page
**);
75 extern ino_t
minix_inode_by_name(struct dentry
*);
76 extern int minix_sync_file(struct file
*, struct dentry
*, int);
78 extern const struct inode_operations minix_file_inode_operations
;
79 extern const struct inode_operations minix_dir_inode_operations
;
80 extern const struct file_operations minix_file_operations
;
81 extern const struct file_operations minix_dir_operations
;
82 extern struct dentry_operations minix_dentry_operations
;
84 static inline struct minix_sb_info
*minix_sb(struct super_block
*sb
)
89 static inline struct minix_inode_info
*minix_i(struct inode
*inode
)
91 return list_entry(inode
, struct minix_inode_info
, vfs_inode
);