From 4b496e29bd01eaa5c8c273b623f5e8142d011e79 Mon Sep 17 00:00:00 2001 From: Ben Gras Date: Wed, 23 Jun 2010 23:57:26 +0000 Subject: [PATCH] iso9660fs - statvfs call, by Buccapatnam Tirumala, Gautam. --- servers/iso9660fs/proto.h | 1 + servers/iso9660fs/stadir.c | 29 +++++++++++++++++++++++++++++ servers/iso9660fs/table.c | 2 +- 3 files changed, 31 insertions(+), 1 deletion(-) 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 */ }; -- 2.44.0