1 #ifndef _EXT_FS_H
2 #define _EXT_FS_H
3
4
5
6
7
8
9
10
11
12
13
14
15 #define EXTFS_FREELIST
16
17 #define EXT_NAME_LEN 255
18 #define EXT_ROOT_INO 1
19
20 #define EXT_I_MAP_SLOTS 8
21 #define EXT_Z_MAP_SLOTS 8
22 #define EXT_SUPER_MAGIC 0x137D
23
24 #define EXT_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct ext_inode)))
25
26
27 struct ext_inode {
28 unsigned short i_mode;
29 unsigned short i_uid;
30 unsigned long i_size;
31 unsigned long i_time;
32 unsigned short i_gid;
33 unsigned short i_nlinks;
34 unsigned long i_zone[12];
35 };
36
37 struct ext_free_inode {
38 unsigned long count;
39 unsigned long free[14];
40 unsigned long next;
41 };
42
43 struct ext_free_block {
44 unsigned long count;
45 unsigned long free[254];
46 unsigned long next;
47 };
48
49 struct ext_super_block {
50 unsigned long s_ninodes;
51 unsigned long s_nzones;
52 #ifdef EXTFS_BITMAP
53 unsigned long s_imap_blocks;
54 unsigned long s_zmap_blocks;
55 #endif
56 #ifdef EXTFS_FREELIST
57 unsigned long s_firstfreeblock;
58 unsigned long s_freeblockscount;
59 unsigned long s_firstfreeinode;
60 unsigned long s_freeinodescount;
61 #endif
62 unsigned long s_firstdatazone;
63 unsigned long s_log_zone_size;
64 unsigned long s_max_size;
65 unsigned long s_reserved1;
66 unsigned long s_reserved2;
67 unsigned long s_reserved3;
68 unsigned long s_reserved4;
69 unsigned long s_reserved5;
70 unsigned short s_magic;
71 };
72
73 struct ext_dir_entry {
74 unsigned long inode;
75 unsigned short rec_len;
76 unsigned short name_len;
77 char name[EXT_NAME_LEN];
78 };
79
80 extern int ext_open(struct inode * inode, struct file * filp);
81 extern void ext_release(struct inode * inode, struct file * filp);
82 extern int ext_lookup(struct inode * dir,const char * name, int len,
83 struct inode ** result);
84 extern int ext_create(struct inode * dir,const char * name, int len, int mode,
85 struct inode ** result);
86 extern int ext_mkdir(struct inode * dir, const char * name, int len, int mode);
87 extern int ext_rmdir(struct inode * dir, const char * name, int len);
88 extern int ext_unlink(struct inode * dir, const char * name, int len);
89 extern int ext_symlink(struct inode * inode, const char * name, int len,
90 const char * symname);
91 extern int ext_link(struct inode * oldinode, struct inode * dir, const char * name, int len);
92 extern int ext_mknod(struct inode * dir, const char * name, int len, int mode, int rdev);
93 extern int ext_rename(struct inode * old_dir, const char * old_name, int old_len,
94 struct inode * new_dir, const char * new_name, int new_len);
95 extern struct inode * ext_new_inode(int dev);
96 extern void ext_free_inode(struct inode * inode);
97 extern unsigned long ext_count_free_inodes(struct super_block *sb);
98 extern int ext_new_block(int dev);
99 extern int ext_free_block(int dev, int block);
100 extern unsigned long ext_count_free_blocks(struct super_block *sb);
101
102 extern int ext_create_block(struct inode *, int);
103 extern int ext_bmap(struct inode *,int);
104
105 extern void ext_truncate(struct inode *);
106 extern void ext_put_super(struct super_block *);
107 extern void ext_write_super(struct super_block *);
108 extern struct super_block *ext_read_super(struct super_block *,void *);
109 extern void ext_read_inode(struct inode *);
110 extern void ext_write_inode(struct inode *);
111 extern void ext_put_inode(struct inode *);
112 extern void ext_statfs(struct super_block *, struct statfs *);
113
114 extern int ext_lseek(struct inode *, struct file *, off_t, int);
115 extern int ext_read(struct inode *, struct file *, char *, int);
116 extern int ext_write(struct inode *, struct file *, char *, int);
117
118 extern struct inode_operations ext_file_inode_operations;
119 extern struct inode_operations ext_dir_inode_operations;
120 extern struct inode_operations ext_symlink_inode_operations;
121 extern struct inode_operations ext_chrdev_inode_operations;
122 extern struct inode_operations ext_blkdev_inode_operations;
123 extern struct inode_operations ext_fifo_inode_operations;
124
125 extern struct file_operations ext_file_operations;
126 extern struct file_operations ext_dir_operations;
127
128 #endif