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 #ifdef __KERNEL__
66
67 extern int xiafs_lookup(struct inode * dir,const char * name, int len,
68 struct inode ** result);
69 extern int xiafs_create(struct inode * dir,const char * name, int len, int mode,
70 struct inode ** result);
71 extern int xiafs_mkdir(struct inode * dir, const char * name, int len, int mode);
72 extern int xiafs_rmdir(struct inode * dir, const char * name, int len);
73 extern int xiafs_unlink(struct inode * dir, const char * name, int len);
74 extern int xiafs_symlink(struct inode * inode, const char * name, int len,
75 const char * symname);
76 extern int xiafs_link(struct inode * oldinode, struct inode * dir,
77 const char * name, int len);
78 extern int xiafs_mknod(struct inode * dir, const char * name, int len,
79 int mode, int rdev);
80 extern int xiafs_rename(struct inode * old_dir, const char * old_name,
81 int old_len, struct inode * new_dir,
82 const char * new_name, int new_len);
83 extern struct inode * xiafs_new_inode(struct inode * dir);
84 extern void xiafs_free_inode(struct inode * inode);
85 extern unsigned long xiafs_count_free_inodes(struct super_block *sb);
86 extern int xiafs_new_zone(struct super_block * sb, u_long prev_addr);
87 extern void xiafs_free_zone(struct super_block * sb, int block);
88 extern unsigned long xiafs_count_free_zones(struct super_block *sb);
89
90 extern int xiafs_bmap(struct inode *,int);
91
92 extern struct buffer_head * xiafs_getblk(struct inode *, int, int);
93 extern struct buffer_head * xiafs_bread(struct inode *, int, int);
94
95 extern void xiafs_truncate(struct inode *);
96 extern void xiafs_put_super(struct super_block *);
97 extern struct super_block *xiafs_read_super(struct super_block *,void *,int);
98 extern void xiafs_read_inode(struct inode *);
99 extern void xiafs_write_inode(struct inode *);
100 extern void xiafs_put_inode(struct inode *);
101 extern void xiafs_statfs(struct super_block *, struct statfs *, int);
102 extern int xiafs_sync_inode(struct inode *);
103 extern int xiafs_sync_file(struct inode *, struct file *);
104
105 extern struct inode_operations xiafs_file_inode_operations;
106 extern struct inode_operations xiafs_dir_inode_operations;
107 extern struct inode_operations xiafs_symlink_inode_operations;
108
109 #endif
110
111 #endif
112
113
114
115
116
117
118
119