xref: /minix3/minix/lib/libvtreefs/proto.h (revision 52be5c0afb313c0a55ebc7e73a7d987d503157a0)
1433d6423SLionel Sambuc #ifndef _VTREEFS_PROTO_H
2433d6423SLionel Sambuc #define _VTREEFS_PROTO_H
3433d6423SLionel Sambuc 
4*52be5c0aSDavid van Moolenbroek /* extra.c */
5*52be5c0aSDavid van Moolenbroek int init_extra(unsigned int inodes, size_t inode_extra);
6*52be5c0aSDavid van Moolenbroek void clear_inode_extra(struct inode *node);
7*52be5c0aSDavid van Moolenbroek 
85eefd0feSDavid van Moolenbroek /* file.c */
95eefd0feSDavid van Moolenbroek int init_buf(size_t size);
105eefd0feSDavid van Moolenbroek void cleanup_buf(void);
115eefd0feSDavid van Moolenbroek ssize_t fs_read(ino_t ino_nr, struct fsdriver_data *data, size_t bytes,
125eefd0feSDavid van Moolenbroek 	off_t pos, int call);
135eefd0feSDavid van Moolenbroek ssize_t fs_write(ino_t ino_nr, struct fsdriver_data *data, size_t bytes,
145eefd0feSDavid van Moolenbroek 	off_t pos, int call);
155eefd0feSDavid van Moolenbroek int fs_trunc(ino_t ino_nr, off_t start_pos, off_t end_pos);
165eefd0feSDavid van Moolenbroek ssize_t fs_getdents(ino_t ino_nr, struct fsdriver_data *data, size_t bytes,
175eefd0feSDavid van Moolenbroek 	off_t *pos);
185eefd0feSDavid van Moolenbroek 
19433d6423SLionel Sambuc /* inode.c */
205eefd0feSDavid van Moolenbroek int init_inodes(unsigned int inodes, struct inode_stat *stat,
215eefd0feSDavid van Moolenbroek 	index_t nr_indexed_entries);
22433d6423SLionel Sambuc void cleanup_inodes(void);
23433d6423SLionel Sambuc struct inode *find_inode(ino_t num);
24433d6423SLionel Sambuc struct inode *get_inode(ino_t num);
25433d6423SLionel Sambuc void put_inode(struct inode *node);
26433d6423SLionel Sambuc void ref_inode(struct inode *node);
27693ad767SDavid van Moolenbroek int get_inode_number(const struct inode *node);
28693ad767SDavid van Moolenbroek int is_inode_deleted(const struct inode *node);
290dc5c83eSDavid van Moolenbroek int fs_putnode(ino_t ino_nr, unsigned int count);
30433d6423SLionel Sambuc 
31433d6423SLionel Sambuc /* link.c */
320dc5c83eSDavid van Moolenbroek ssize_t fs_rdlink(ino_t ino_nr, struct fsdriver_data *data, size_t bytes);
335eefd0feSDavid van Moolenbroek int fs_slink(ino_t dir_nr, char *name, uid_t uid, gid_t gid,
345eefd0feSDavid van Moolenbroek 	struct fsdriver_data *data, size_t bytes);
355eefd0feSDavid van Moolenbroek int fs_mknod(ino_t dir_nr, char *name, mode_t mode, uid_t uid, gid_t gid,
365eefd0feSDavid van Moolenbroek 	dev_t rdev);
375eefd0feSDavid van Moolenbroek int fs_unlink(ino_t dir_nr, char *name, int call);
38433d6423SLionel Sambuc 
39433d6423SLionel Sambuc /* mount.c */
400dc5c83eSDavid van Moolenbroek int fs_mount(dev_t dev, unsigned int flags, struct fsdriver_node *root_node,
410dc5c83eSDavid van Moolenbroek 	unsigned int *res_flags);
420dc5c83eSDavid van Moolenbroek void fs_unmount(void);
430dc5c83eSDavid van Moolenbroek 
440dc5c83eSDavid van Moolenbroek /* main.c */
450dc5c83eSDavid van Moolenbroek void fs_other(const message *m_ptr, int ipc_status);
46433d6423SLionel Sambuc 
47433d6423SLionel Sambuc /* path.c */
480dc5c83eSDavid van Moolenbroek int fs_lookup(ino_t dir_nr, char *name, struct fsdriver_node *node,
490dc5c83eSDavid van Moolenbroek 	int *is_mountpt);
50433d6423SLionel Sambuc 
51433d6423SLionel Sambuc /* sdbm.c */
52693ad767SDavid van Moolenbroek long sdbm_hash(const char *str, int len);
53433d6423SLionel Sambuc 
54433d6423SLionel Sambuc /* stadir.c */
550dc5c83eSDavid van Moolenbroek int fs_stat(ino_t ino_nr, struct stat *buf);
565eefd0feSDavid van Moolenbroek int fs_chmod(ino_t ino_nr, mode_t *mode);
575eefd0feSDavid van Moolenbroek int fs_chown(ino_t ino_nr, uid_t uid, gid_t gid, mode_t *mode);
580dc5c83eSDavid van Moolenbroek int fs_statvfs(struct statvfs *buf);
59433d6423SLionel Sambuc 
60433d6423SLionel Sambuc #endif /* _VTREEFS_PROTO_H */
61