[Libsysio-commit] HEAD: libsysio/drivers/native fs_native.c
Brought to you by:
lward
From: Lee W. <lw...@us...> - 2007-04-30 23:24:16
|
Update of /cvsroot/libsysio/libsysio/drivers/native In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv2987/drivers/native Modified Files: fs_native.c Log Message: Restore support of statvfs{,64}. Index: fs_native.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/native/fs_native.c,v retrieving revision 1.59 retrieving revision 1.60 diff -u -w -b -B -p -r1.59 -r1.60 --- fs_native.c 10 Apr 2006 23:21:24 -0000 1.59 +++ fs_native.c 30 Apr 2007 23:24:12 -0000 1.60 @@ -61,13 +61,8 @@ #include <sys/types.h> #include <sys/stat.h> #include <sys/fcntl.h> -#if 0 -#include <sys/vfs.h> -#endif -#ifdef _HAVE_STATVFS -#include <sys/statvfs.h> #include <sys/statfs.h> -#endif +#include <sys/statvfs.h> #include <utime.h> #include <sys/uio.h> #include <sys/queue.h> @@ -200,11 +195,9 @@ static int native_inop_ioctl(struct inod unsigned long int request, va_list ap); static int native_inop_mknod(struct pnode *pno, mode_t mode, dev_t dev); -#ifdef _HAVE_STATVFS static int native_inop_statvfs(struct pnode *pno, struct inode *ino, struct intnl_statvfs *buf); -#endif static void native_inop_gone(struct inode *ino); static struct inode_ops native_i_ops = { @@ -230,9 +223,7 @@ static struct inode_ops native_i_ops = { native_inop_datasync, native_inop_ioctl, native_inop_mknod, -#ifdef _HAVE_STATVFS native_inop_statvfs, -#endif native_inop_gone }; @@ -1662,7 +1653,6 @@ native_inop_mknod(struct pnode *pno __IS return -ENOSYS; } -#ifdef _HAVE_STATVFS static int native_inop_statvfs(struct pnode *pno, struct inode *ino, @@ -1702,13 +1692,14 @@ native_inop_statvfs(struct pnode *pno, buf->f_bavail = fs.f_bavail; buf->f_files = fs.f_files; /* Total number serial numbers */ buf->f_ffree = fs.f_ffree; /* Number free serial numbers */ - buf->f_favail = fs.f_ffree; /* Number free ser num for non-privileged*/ - buf->f_fsid = fs.f_fsid.__val[1]; - buf->f_flag = 0; /* No equiv in statfs; maybe use type? */ + buf->f_favail = fs.f_ffree; /* Ditto, for non-privileged though */ + buf->f_fsid = ino->i_fs->fs_id; + buf->f_flag = 0; + if (pno) + buf->f_flag = pno->p_mount->mnt_flags; buf->f_namemax = fs.f_namelen; return 0; } -#endif static int native_inop_sync(struct inode *ino) |