summaryrefslogtreecommitdiff
path: root/sys/miscfs/kernfs/kernfs_vfsops.c
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>1996-06-20 14:30:10 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>1996-06-20 14:30:10 +0000
commitb616b3bafb6c964e4269531c338a69e8367d4322 (patch)
tree15ece746a2c0faa39fe0d2d455930c3b08d99768 /sys/miscfs/kernfs/kernfs_vfsops.c
parent48f748f3e396a96cbdb1e932b25a60c3c52cea02 (diff)
add more kernel variables. calculate used/free physmem and vnodes.
Diffstat (limited to 'sys/miscfs/kernfs/kernfs_vfsops.c')
-rw-r--r--sys/miscfs/kernfs/kernfs_vfsops.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/sys/miscfs/kernfs/kernfs_vfsops.c b/sys/miscfs/kernfs/kernfs_vfsops.c
index 6bde34415f3..147b75eeb65 100644
--- a/sys/miscfs/kernfs/kernfs_vfsops.c
+++ b/sys/miscfs/kernfs/kernfs_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kernfs_vfsops.c,v 1.3 1996/05/02 13:20:16 deraadt Exp $ */
+/* $OpenBSD: kernfs_vfsops.c,v 1.4 1996/06/20 14:30:08 mickey Exp $ */
/* $NetBSD: kernfs_vfsops.c,v 1.26 1996/04/22 01:42:27 christos Exp $ */
/*
@@ -52,6 +52,7 @@
#include <sys/mount.h>
#include <sys/namei.h>
#include <sys/malloc.h>
+#include <sys/vmmeter.h> /* for cnt */
#include <miscfs/specfs/specdev.h>
#include <miscfs/kernfs/kernfs.h>
@@ -257,6 +258,7 @@ kernfs_statfs(mp, sbp, p)
struct statfs *sbp;
struct proc *p;
{
+ extern long numvnodes; /* XXX */
#ifdef KERNFS_DIAGNOSTIC
printf("kernfs_statfs(mp = %x)\n", mp);
@@ -267,13 +269,13 @@ kernfs_statfs(mp, sbp, p)
#else
sbp->f_type = 0;
#endif
- sbp->f_bsize = DEV_BSIZE;
- sbp->f_iosize = DEV_BSIZE;
- sbp->f_blocks = 2; /* 1K to keep df happy */
- sbp->f_bfree = 0;
+ sbp->f_bsize = cnt.v_page_size;
+ sbp->f_iosize = cnt.v_page_size;
+ sbp->f_blocks = physmem;
+ sbp->f_bfree = physmem - cnt.v_wire_count;
sbp->f_bavail = 0;
- sbp->f_files = 0;
- sbp->f_ffree = 0;
+ sbp->f_files = desiredvnodes;
+ sbp->f_ffree = desiredvnodes - numvnodes;
if (sbp != &mp->mnt_stat) {
bcopy(&mp->mnt_stat.f_fsid, &sbp->f_fsid, sizeof(sbp->f_fsid));
bcopy(mp->mnt_stat.f_mntonname, sbp->f_mntonname, MNAMELEN);