retire 64-bit conversion functions
[minix3.git] / servers / mfs / proto.h
blob142c6f125720929d2655ee468734e179b1fbb7a7
1 #ifndef __MFS_PROTO_H__
2 #define __MFS_PROTO_H__
4 /* Some shortcuts to functions in -lminixfs */
5 #define get_block(d, b, t) lmfs_get_block(d, b, t)
6 #define put_block(b, t) lmfs_put_block(b, t)
8 /* Function prototypes. */
10 /* Structs used in prototypes must be declared as such first. */
11 struct buf;
12 struct filp;
13 struct inode;
14 struct super_block;
17 /* cache.c */
18 zone_t alloc_zone(dev_t dev, zone_t z);
19 void free_zone(dev_t dev, zone_t numb);
21 /* inode.c */
22 struct inode *alloc_inode(dev_t dev, mode_t bits);
23 void dup_inode(struct inode *ip);
24 struct inode *find_inode(dev_t dev, ino_t numb);
25 int fs_putnode(void);
26 void init_inode_cache(void);
27 struct inode *get_inode(dev_t dev, ino_t numb);
28 void put_inode(struct inode *rip);
29 void update_times(struct inode *rip);
30 void rw_inode(struct inode *rip, int rw_flag);
32 /* link.c */
33 int fs_ftrunc(void);
34 int fs_link(void);
35 int fs_rdlink(void);
36 int fs_rename(void);
37 int fs_unlink(void);
38 int truncate_inode(struct inode *rip, off_t len);
40 /* misc.c */
41 int fs_flush(void);
42 int fs_sync(void);
43 int fs_new_driver(void);
44 int fs_bpeek(void);
46 /* mount.c */
47 int fs_mountpoint(void);
48 int fs_readsuper(void);
49 int fs_unmount(void);
51 /* open.c */
52 int fs_create(void);
53 int fs_inhibread(void);
54 int fs_mkdir(void);
55 int fs_mknod(void);
56 int fs_slink(void);
58 /* path.c */
59 int fs_lookup(void);
60 struct inode *advance(struct inode *dirp, char string[MFS_NAME_MAX], int
61 chk_perm);
62 int search_dir(struct inode *ldir_ptr, char string [MFS_NAME_MAX], ino_t
63 *numb, int flag, int check_permissions);
66 /* protect.c */
67 int fs_chmod(void);
68 int fs_chown(void);
69 int fs_getdents(void);
70 int forbidden(struct inode *rip, mode_t access_desired);
71 int read_only(struct inode *ip);
73 /* read.c */
74 int fs_breadwrite(void);
75 int fs_readwrite(void);
76 void read_ahead(void);
77 block_t read_map(struct inode *rip, off_t pos, int opportunistic);
78 struct buf *get_block_map(register struct inode *rip, u64_t position);
79 zone_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 bit_t alloc_bit(struct super_block *sp, int map, bit_t origin);
88 void free_bit(struct super_block *sp, int map, bit_t bit_returned);
89 unsigned int get_block_size(dev_t dev);
90 struct super_block *get_super(dev_t dev);
91 int read_super(struct super_block *sp);
92 int write_super(struct super_block *sp);
93 u32_t get_used_blocks(struct super_block *sp);
95 /* stats.c */
96 bit_t count_free_bits(struct super_block *sp, int map);
98 /* time.c */
99 int fs_utime(void);
101 /* utility.c */
102 time_t clock_time(void);
103 unsigned conv2(int norm, int w);
104 long conv4(int norm, long x);
105 void mfs_nul_f(char *file, int line, char *str, unsigned int len,
106 unsigned int maxlen);
107 int min(unsigned int l, unsigned int r);
108 int no_sys(void);
109 void sanitycheck(char *file, int line);
110 #define SANITYCHECK sanitycheck(__FILE__, __LINE__)
112 /* write.c */
113 void clear_zone(struct inode *rip, off_t pos, int flag);
114 struct buf *new_block(struct inode *rip, off_t position);
115 void zero_block(struct buf *bp);
116 int write_map(struct inode *, off_t, zone_t, int);
118 #endif