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. */
18 zone_t
alloc_zone(dev_t dev
, zone_t z
);
19 void free_zone(dev_t dev
, zone_t numb
);
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
);
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
);
38 int truncate_inode(struct inode
*rip
, off_t len
);
43 int fs_new_driver(void);
47 int fs_mountpoint(void);
48 int fs_readsuper(void);
53 int fs_inhibread(void);
60 struct inode
*advance(struct inode
*dirp
, char string
[MFS_NAME_MAX
], int
62 int search_dir(struct inode
*ldir_ptr
, char string
[MFS_NAME_MAX
], ino_t
63 *numb
, int flag
, int check_permissions
);
69 int fs_getdents(void);
70 int forbidden(struct inode
*rip
, mode_t access_desired
);
71 int read_only(struct inode
*ip
);
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
);
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
);
96 bit_t
count_free_bits(struct super_block
*sp
, int map
);
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
);
109 void sanitycheck(char *file
, int line
);
110 #define SANITYCHECK sanitycheck(__FILE__, __LINE__)
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);