This source file includes following definitions.
- affs_sread
- affs_pread
1
2 #ifndef _AFFS_FS_H
3 #define _AFFS_FS_H
4
5 #include <linux/types.h>
6
7
8
9
10 #define AFFS_BLOCK_BITS 9
11 #define AFFS_BLOCK_SIZE 512
12
13 #define AFFS_BUFFER_BITS 9
14 #define AFFS_BUFFER_SIZE 512
15
16 #define AFFS_BLOCK_NUMBER(X) (X<<1)
17
18 #define AFFS_SUPER_MAGIC 0xadff
19
20
21 #define AFFS_I2BSIZE(inode) ((inode)->i_sb->u.affs_sb.s_block_size)
22
23
24
25 static inline struct buffer_head *affs_sread(int dev,int sector,void **start)
26 {
27 struct buffer_head *bh;
28 int mask;
29
30 bh = bread (dev, sector >> (BLOCK_SIZE_BITS - AFFS_BLOCK_BITS), 1024);
31 if (!bh)
32 return NULL;
33 mask = (1 << (BLOCK_SIZE_BITS - AFFS_BLOCK_BITS)) - 1;
34 *start = bh->b_data + ((sector & mask) << AFFS_BLOCK_BITS);
35 return bh;
36 }
37
38
39
40
41 static inline struct buffer_head *affs_pread(struct inode *inode,
42 int sector, void **start)
43 {
44 int offset = inode->i_sb->u.affs_sb.s_partition_offset;
45 return affs_sread (inode->i_dev, sector + offset, start);
46 }
47
48
49
50 extern int affs_get_key_entry (int bsize, void *data, int entry_pos);
51 extern int affs_find_next_hash_entry (int bsize, void *dir_data, int *hash_pos);
52 extern int affs_get_fh_hash_link (int bsize, void *fh_data);
53 extern int affs_get_file_name (int bsize, void *fh_data, char **name);
54 extern int affs_get_extension (int bsize, void *fh_data);
55 extern int affs_checksum_block (int bsize, void *data, int *ptype, int *stype);
56
57
58
59
60 extern int affs_open(struct inode * inode, struct file * filp);
61 extern void affs_release(struct inode * inode, struct file * filp);
62 extern int affs_lookup(struct inode * dir,const char * name, int len,
63 struct inode ** result);
64 extern unsigned long affs_count_free_inodes(struct super_block *sb);
65 extern int affs_new_block(int dev);
66 extern int affs_free_block(int dev, int block);
67 extern int affs_bmap(struct inode *,int);
68
69 extern void affs_put_super(struct super_block *);
70 extern struct super_block *affs_read_super(struct super_block *,void *,int);
71 extern void affs_read_inode(struct inode *);
72 extern void affs_put_inode(struct inode *);
73 extern void affs_statfs(struct super_block *, struct statfs *, int);
74 extern int affs_parent_ino(struct inode *dir);
75 extern int affs_lseek(struct inode *, struct file *, off_t, int);
76 extern int affs_read(struct inode *, struct file *, char *, int);
77 extern int affs_file_read(struct inode *, struct file *, char *, int);
78 extern int init_affs_fs(void);
79
80 extern struct inode_operations affs_file_inode_operations;
81 extern struct inode_operations affs_dir_inode_operations;
82 extern struct inode_operations affs_symlink_inode_operations;
83 extern struct inode_operations affs_chrdev_inode_operations;
84 extern struct inode_operations affs_blkdev_inode_operations;
85
86 extern struct file_operations affs_file_operations;
87 extern struct file_operations affs_dir_operations;
88
89
90 #ifdef LEAK_CHECK
91 #define free_s leak_check_free_s
92 #define malloc leak_check_malloc
93 #define bread leak_check_bread
94 #define brelse leak_check_brelse
95 extern void * leak_check_malloc(unsigned int size);
96 extern void leak_check_free_s(void * obj, int size);
97 extern struct buffer_head * leak_check_bread(int dev, int block, int size);
98 extern void leak_check_brelse(struct buffer_head * bh);
99 #endif
100
101 #endif