xref: /minix/minix/fs/isofs/stadir.c (revision 83133719)
1 #include "inc.h"
2 #include <sys/stat.h>
3 #include <sys/statvfs.h>
4 
5 int fs_stat(ino_t ino_nr, struct stat *statbuf)
6 {
7 	struct inode *rip;
8 
9 	if ((rip = find_inode(ino_nr)) == NULL)
10 		return EINVAL;
11 
12 	*statbuf = rip->i_stat;
13 
14 	return OK;
15 }
16 
17 int fs_statvfs(struct statvfs *st)
18 {
19 	st->f_flag = ST_NOTRUNC;
20 	st->f_bsize =  v_pri.logical_block_size_l;
21 	st->f_frsize = st->f_bsize;
22 	st->f_iosize = st->f_bsize;
23 	st->f_blocks = v_pri.volume_space_size_l;
24 	st->f_namemax = NAME_MAX;
25 
26 	return OK;
27 }
28 
29 void fs_blockstats(u64_t *blocks, u64_t *free, u64_t *used)
30 {
31 	*used = *blocks = v_pri.volume_space_size_l;
32 	*free = 0;
33 }
34