2009-10-01 16:00:27 +02:00
|
|
|
#include "inc.h"
|
|
|
|
#include <sys/stat.h>
|
2010-06-24 01:57:26 +02:00
|
|
|
#include <sys/statvfs.h>
|
2009-10-01 16:00:27 +02:00
|
|
|
|
2014-08-24 12:37:12 +02:00
|
|
|
int fs_stat(ino_t ino_nr, struct stat *statbuf)
|
2009-10-01 16:00:27 +02:00
|
|
|
{
|
2014-08-24 12:37:12 +02:00
|
|
|
struct inode *rip;
|
|
|
|
|
2015-09-16 14:36:11 +02:00
|
|
|
if ((rip = get_inode(ino_nr)) == NULL)
|
2014-08-24 12:37:12 +02:00
|
|
|
return EINVAL;
|
2009-10-01 16:00:27 +02:00
|
|
|
|
2014-08-24 12:37:12 +02:00
|
|
|
*statbuf = rip->i_stat;
|
2009-10-01 16:00:27 +02:00
|
|
|
|
2014-08-24 12:37:12 +02:00
|
|
|
return OK;
|
2009-10-01 16:00:27 +02:00
|
|
|
}
|
|
|
|
|
2014-08-24 12:37:12 +02:00
|
|
|
int fs_statvfs(struct statvfs *st)
|
2010-06-24 01:57:26 +02:00
|
|
|
{
|
2014-08-24 12:37:12 +02:00
|
|
|
st->f_flag = ST_NOTRUNC;
|
|
|
|
st->f_bsize = v_pri.logical_block_size_l;
|
|
|
|
st->f_frsize = st->f_bsize;
|
|
|
|
st->f_iosize = st->f_bsize;
|
|
|
|
st->f_blocks = v_pri.volume_space_size_l;
|
|
|
|
st->f_namemax = NAME_MAX;
|
|
|
|
|
|
|
|
return OK;
|
2010-06-24 01:57:26 +02:00
|
|
|
}
|