1 #ifndef _XIA_FS_H
2 #define _XIA_FS_H
3
4
5
6
7
8
9
10
11
12
13 #define _XIAFS_SUPER_MAGIC 0x012FD16D
14 #define _XIAFS_ROOT_INO 1
15 #define _XIAFS_BAD_INO 2
16
17 #define _XIAFS_NAME_LEN 248
18
19 #define _XIAFS_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof(struct xiafs_inode)))
20
21 struct xiafs_inode {
22 mode_t i_mode;
23 nlink_t i_nlinks;
24 uid_t i_uid;
25 gid_t i_gid;
26 size_t i_size;
27 time_t i_ctime;
28 time_t i_atime;
29 time_t i_mtime;
30 daddr_t i_zone[8];
31 daddr_t i_ind_zone;
32 daddr_t i_dind_zone;
33 };
34
35
36
37
38 struct xiafs_super_block {
39 u_char s_boot_segment[512];
40 u_long s_zone_size;
41 u_long s_nzones;
42 u_long s_ninodes;
43 u_long s_ndatazones;
44 u_long s_imap_zones;
45 u_long s_zmap_zones;
46 u_long s_firstdatazone;
47 u_long s_zone_shift;
48 u_long s_max_size;
49 u_long s_reserved0;
50 u_long s_reserved1;
51 u_long s_reserved2;
52 u_long s_reserved3;
53 u_long s_firstkernzone;
54 u_long s_kernzones;
55 u_long s_magic;
56 };
57
58 struct xiafs_direct {
59 ino_t d_ino;
60 u_short d_rec_len;
61 u_char d_name_len;
62 char d_name[_XIAFS_NAME_LEN+1];
63 };
64
65 extern int xiafs_lookup(struct inode * dir,const char * name, int len,
66 struct inode ** result);
67 extern int xiafs_create(struct inode * dir,const char * name, int len, int mode,
68 struct inode ** result);
69 extern int xiafs_mkdir(struct inode * dir, const char * name, int len, int mode);
70 extern int xiafs_rmdir(struct inode * dir, const char * name, int len);
71 extern int xiafs_unlink(struct inode * dir, const char * name, int len);
72 extern int xiafs_symlink(struct inode * inode, const char * name, int len,
73 const char * symname);
74 extern int xiafs_link(struct inode * oldinode, struct inode * dir,
75 const char * name, int len);
76 extern int xiafs_mknod(struct inode * dir, const char * name, int len,
77 int mode, int rdev);
78 extern int xiafs_rename(struct inode * old_dir, const char * old_name,
79 int old_len, struct inode * new_dir,
80 const char * new_name, int new_len);
81 extern struct inode * xiafs_new_inode(struct inode * dir);
82 extern void xiafs_free_inode(struct inode * inode);
83 extern unsigned long xiafs_count_free_inodes(struct super_block *sb);
84 extern int xiafs_new_zone(struct super_block * sb, u_long prev_addr);
85 extern void xiafs_free_zone(struct super_block * sb, int block);
86 extern unsigned long xiafs_count_free_zones(struct super_block *sb);
87
88 extern int xiafs_bmap(struct inode *,int);
89
90 extern struct buffer_head * xiafs_getblk(struct inode *, int, int);
91 extern struct buffer_head * xiafs_bread(struct inode *, int, int);
92
93 extern void xiafs_truncate(struct inode *);
94 extern void xiafs_put_super(struct super_block *);
95 extern struct super_block *xiafs_read_super(struct super_block *,void *,int);
96 extern void xiafs_read_inode(struct inode *);
97 extern void xiafs_write_inode(struct inode *);
98 extern void xiafs_put_inode(struct inode *);
99 extern void xiafs_statfs(struct super_block *, struct statfs *);
100
101 extern struct inode_operations xiafs_file_inode_operations;
102 extern struct inode_operations xiafs_dir_inode_operations;
103 extern struct inode_operations xiafs_symlink_inode_operations;
104
105 extern struct file_operations xiafs_file_operations;
106 extern struct file_operations xiafs_dir_operations;
107
108 #endif
109
110
111
112
113
114
115
116