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