vm: fix potential null deref
[minix.git] / servers / ext2 / proto.h
blob0a9f93ca19b7eefd3be6bfb3085de88b1004d1b9
1 #ifndef EXT2_PROTO_H
2 #define EXT2_PROTO_H
4 #define get_block(d, n, t) lmfs_get_block(d, n, t)
5 #define put_block(n, t) lmfs_put_block(n, t)
7 /* Function prototypes. */
9 /* Structs used in prototypes must be declared as such first. */
10 struct buf;
11 struct filp;
12 struct inode;
13 struct super_block;
16 /* balloc.c */
17 void discard_preallocated_blocks(struct inode *rip);
18 block_t alloc_block(struct inode *rip, block_t goal);
19 void free_block(struct super_block *sp, bit_t bit);
21 /* ialloc.c */
22 struct inode *alloc_inode(struct inode *parent, mode_t bits);
23 void free_inode(struct inode *rip);
25 /* inode.c */
26 void dup_inode(struct inode *ip);
27 struct inode *find_inode(dev_t dev, ino_t numb);
28 int fs_putnode(void);
29 void init_inode_cache(void);
30 struct inode *get_inode(dev_t dev, ino_t numb);
31 void put_inode(struct inode *rip);
32 void update_times(struct inode *rip);
33 void rw_inode(struct inode *rip, int rw_flag);
35 /* link.c */
36 int fs_ftrunc(void);
37 int fs_link(void);
38 int fs_rdlink(void);
39 int fs_rename(void);
40 int fs_unlink(void);
41 int truncate_inode(struct inode *rip, off_t len);
43 /* misc.c */
44 int fs_flush(void);
45 int fs_sync(void);
46 int fs_new_driver(void);
48 /* mount.c */
49 int fs_mountpoint(void);
50 int fs_readsuper(void);
51 int fs_unmount(void);
53 /* open.c */
54 int fs_create(void);
55 int fs_inhibread(void);
56 int fs_mkdir(void);
57 int fs_mknod(void);
58 int fs_slink(void);
60 /* path.c */
61 int fs_lookup(void);
62 struct inode *advance(struct inode *dirp, char string[NAME_MAX + 1], int
63 chk_perm);
64 int search_dir(struct inode *ldir_ptr, char string [NAME_MAX + 1], ino_t
65 *numb, int flag, int check_permissions, int ftype);
67 /* protect.c */
68 int fs_chmod(void);
69 int fs_chown(void);
70 int fs_getdents(void);
71 int forbidden(struct inode *rip, mode_t access_desired);
72 int read_only(struct inode *ip);
74 /* read.c */
75 int fs_breadwrite(void);
76 int fs_readwrite(void);
77 void read_ahead(void);
78 block_t read_map(struct inode *rip, off_t pos);
79 block_t rd_indir(struct buf *bp, int index);
81 /* stadir.c */
82 int fs_fstatfs(void);
83 int fs_stat(void);
84 int fs_statvfs(void);
86 /* super.c */
87 unsigned int get_block_size(dev_t dev);
88 struct super_block *get_super(dev_t dev);
89 int read_super(struct super_block *sp);
90 void write_super(struct super_block *sp);
91 struct group_desc* get_group_desc(unsigned int bnum);
93 /* time.c */
94 int fs_utime(void);
96 /* utility.c */
97 time_t clock_time(void);
98 unsigned conv2(int norm, int w);
99 long conv4(int norm, long x);
100 void mfs_nul_f(char *file, int line, char *str, unsigned int len,
101 unsigned int maxlen);
102 int min(unsigned int l, unsigned int r);
103 int no_sys(void);
104 void sanitycheck(char *file, int line);
105 #define SANITYCHECK sanitycheck(__FILE__, __LINE__)
106 int ansi_strcmp(register const char* ansi_s, register const char *s2,
107 register size_t ansi_s_length);
108 bit_t setbit(bitchunk_t *bitmap, bit_t max_bits, unsigned int word);
109 bit_t setbyte(bitchunk_t *bitmap, bit_t max_bits);
110 int unsetbit(bitchunk_t *bitmap, bit_t bit);
112 /* write.c */
113 struct buf *new_block(struct inode *rip, off_t position);
114 void zero_block(struct buf *bp);
115 int write_map(struct inode *, off_t, block_t, int);
117 #endif /* EXT2_PROTO_H */