1 #ifndef __MFS_PROTO_H__
2 #define __MFS_PROTO_H__
4 /* Some shortcuts to functions in -lminixfs */
5 #define put_block(b) lmfs_put_block(b)
7 /* Function prototypes. */
9 /* Structs used in prototypes must be declared as such first. */
16 zone_t
alloc_zone(dev_t dev
, zone_t z
);
17 void free_zone(dev_t dev
, zone_t numb
);
18 struct buf
*get_block(dev_t dev
, block_t block
, int how
);
21 struct inode
*alloc_inode(dev_t dev
, mode_t bits
, uid_t uid
, gid_t gid
);
22 void dup_inode(struct inode
*ip
);
23 struct inode
*find_inode(dev_t dev
, ino_t numb
);
24 int fs_putnode(ino_t ino_nr
, unsigned int count
);
25 void init_inode_cache(void);
26 struct inode
*get_inode(dev_t dev
, ino_t numb
);
27 void put_inode(struct inode
*rip
);
28 void update_times(struct inode
*rip
);
29 void rw_inode(struct inode
*rip
, int rw_flag
);
32 int fs_trunc(ino_t ino_nr
, off_t start
, off_t end
);
33 int fs_link(ino_t dir_nr
, char *name
, ino_t ino_nr
);
34 ssize_t
fs_rdlink(ino_t ino_nr
, struct fsdriver_data
*data
, size_t bytes
);
35 int fs_rename(ino_t old_dir_nr
, char *old_name
, ino_t new_dir_nr
,
37 int fs_unlink(ino_t dir_nr
, char *name
, int call
);
38 int truncate_inode(struct inode
*rip
, off_t len
);
44 int fs_mount(dev_t dev
, unsigned int flags
, struct fsdriver_node
*root_node
,
45 unsigned int *res_flags
);
46 void fs_unmount(void);
47 int fs_mountpt(ino_t ino_nr
);
50 int fs_create(ino_t dir_nr
, char *name
, mode_t mode
, uid_t uid
, gid_t gid
,
51 struct fsdriver_node
*node
);
52 int fs_mkdir(ino_t dir_nr
, char *name
, mode_t mode
, uid_t uid
, gid_t gid
);
53 int fs_mknod(ino_t dir_nr
, char *name
, mode_t mode
, uid_t uid
, gid_t gid
,
55 int fs_slink(ino_t dir_nr
, char *name
, uid_t uid
, gid_t gid
,
56 struct fsdriver_data
*data
, size_t bytes
);
57 void fs_seek(ino_t ino_nr
);
60 int fs_lookup(ino_t dir_nr
, char *name
, struct fsdriver_node
*node
,
62 struct inode
*advance(struct inode
*dirp
, const char *string
);
63 int search_dir(struct inode
*ldir_ptr
, const char *string
, ino_t
*numb
,
67 int fs_chmod(ino_t ino
, mode_t
*mode
);
68 int fs_chown(ino_t ino
, uid_t uid
, gid_t gid
, mode_t
*mode
);
71 ssize_t
fs_readwrite(ino_t ino_nr
, struct fsdriver_data
*data
, size_t bytes
,
73 block_t
read_map(struct inode
*rip
, off_t pos
, int opportunistic
);
74 struct buf
*get_block_map(register struct inode
*rip
, u64_t position
);
75 zone_t
rd_indir(struct buf
*bp
, int index
);
76 ssize_t
fs_getdents(ino_t ino_nr
, struct fsdriver_data
*data
, size_t bytes
,
80 int fs_stat(ino_t ino_nr
, struct stat
*statbuf
);
81 int fs_statvfs(struct statvfs
*st
);
84 bit_t
alloc_bit(struct super_block
*sp
, int map
, bit_t origin
);
85 void free_bit(struct super_block
*sp
, int map
, bit_t bit_returned
);
86 unsigned int get_block_size(dev_t dev
);
87 int read_super(struct super_block
*sp
);
88 int write_super(struct super_block
*sp
);
91 bit_t
count_free_bits(struct super_block
*sp
, int map
);
94 int fs_utime(ino_t ino_t
, struct timespec
*atime
, struct timespec
*mtime
);
97 unsigned conv2(int norm
, int w
);
98 long conv4(int norm
, long x
);
101 void clear_zone(struct inode
*rip
, off_t pos
, int flag
);
102 struct buf
*new_block(struct inode
*rip
, off_t position
);
103 void zero_block(struct buf
*bp
);
104 int write_map(struct inode
*, off_t
, zone_t
, int);