]> Zhao Yanbai Git Server - minix.git/commitdiff
iso9660fs - statvfs call, by Buccapatnam Tirumala, Gautam.
authorBen Gras <ben@minix3.org>
Wed, 23 Jun 2010 23:57:26 +0000 (23:57 +0000)
committerBen Gras <ben@minix3.org>
Wed, 23 Jun 2010 23:57:26 +0000 (23:57 +0000)
servers/iso9660fs/proto.h
servers/iso9660fs/stadir.c
servers/iso9660fs/table.c

index 1302f72d11afa23bc68188ded64b68e89267d7fc..dcf37f240cf5e02ac09e2813417479b81e067474 100644 (file)
@@ -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)           );
index d29d18fb3e2bd01069271e69dd46429983d04bff..a637ae1f4b170cfa7a3349e80b6a4be9b074283f 100644 (file)
@@ -1,6 +1,7 @@
 #include "inc.h"
 #include <sys/stat.h>
 #include <sys/statfs.h>
+#include <sys/statvfs.h>
 #include <minix/com.h>
 #include <string.h>
 #include <time.h>
@@ -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);
+}
index 8767c31495d743dc6cd984b2c28eca6fd93c223e..2bc05669270da0ba9b40c2dc65440f1471691405 100644 (file)
@@ -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 */
 };