From: Ben Gras Date: Wed, 23 Jun 2010 23:57:26 +0000 (+0000) Subject: iso9660fs - statvfs call, by Buccapatnam Tirumala, Gautam. X-Git-Tag: v3.1.8~373 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/Bv9ARM.html?a=commitdiff_plain;h=4b496e29bd01eaa5c8c273b623f5e8142d011e79;p=minix.git iso9660fs - statvfs call, by Buccapatnam Tirumala, Gautam. --- diff --git a/servers/iso9660fs/proto.h b/servers/iso9660fs/proto.h index 1302f72d1..dcf37f240 100644 --- a/servers/iso9660fs/proto.h +++ b/servers/iso9660fs/proto.h @@ -63,6 +63,7 @@ _PROTOTYPE( int read_chunk, (struct dir_record *rip, u64_t position, /* stadir.c */ _PROTOTYPE( int fs_stat, (void) ); _PROTOTYPE( int fs_fstatfs, (void) ); +_PROTOTYPE( int fs_statvfs, (void) ); /* super.c */ _PROTOTYPE(int release_v_pri, (struct iso9660_vd_pri *v_pri) ); diff --git a/servers/iso9660fs/stadir.c b/servers/iso9660fs/stadir.c index d29d18fb3..a637ae1f4 100644 --- a/servers/iso9660fs/stadir.c +++ b/servers/iso9660fs/stadir.c @@ -1,6 +1,7 @@ #include "inc.h" #include #include +#include #include #include #include @@ -98,3 +99,31 @@ PUBLIC int fs_fstatfs() return(r); } + +/*===========================================================================* + * fs_statvfs * + *===========================================================================*/ +PUBLIC int fs_statvfs() +{ + struct statvfs st; + int r; + + + st.f_bsize = v_pri.logical_block_size_l; + st.f_frsize = st.f_bsize; + st.f_blocks = v_pri.volume_space_size_l; + st.f_bfree = 0; + st.f_bavail = 0; + st.f_files = 0; + st.f_ffree = 0; + st.f_favail = 0; + st.f_fsid = fs_dev; + st.f_flag = ST_RDONLY; + st.f_namemax = NAME_MAX; + + /* Copy the struct to user space. */ + r = sys_safecopyto(fs_m_in.m_source, fs_m_in.REQ_GRANT, 0, (vir_bytes) &st, + (phys_bytes) sizeof(st), D); + + return(r); +} diff --git a/servers/iso9660fs/table.c b/servers/iso9660fs/table.c index 8767c3149..2bc056692 100644 --- a/servers/iso9660fs/table.c +++ b/servers/iso9660fs/table.c @@ -40,5 +40,5 @@ PUBLIC _PROTOTYPE (int (*fs_call_vec[]), (void) ) = { no_sys, /* 52: not used */ no_sys, /* 53: not used */ fs_getdents, /* 54 */ - no_sys, /* 32 */ + fs_statvfs, /* 32 */ };