diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 1999-02-26 03:44:17 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 1999-02-26 03:44:17 +0000 |
commit | 8261e1939fa8e3e4035f9769b34d582828538d03 (patch) | |
tree | 7f5f9abf732603fccb96f134c5edc14db51eefda /sys/miscfs | |
parent | f5b9be5d1e51cdd1bf89d3ae5c5639246e5425db (diff) |
cnt is called uvmexp in uvm and the members have different names
Diffstat (limited to 'sys/miscfs')
-rw-r--r-- | sys/miscfs/kernfs/kernfs_vfsops.c | 16 | ||||
-rw-r--r-- | sys/miscfs/kernfs/kernfs_vnops.c | 18 |
2 files changed, 30 insertions, 4 deletions
diff --git a/sys/miscfs/kernfs/kernfs_vfsops.c b/sys/miscfs/kernfs/kernfs_vfsops.c index 584d15dca30..7a74578173f 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.10 1998/12/24 01:40:27 millert Exp $ */ +/* $OpenBSD: kernfs_vfsops.c,v 1.11 1999/02/26 03:44:16 art Exp $ */ /* $NetBSD: kernfs_vfsops.c,v 1.26 1996/04/22 01:42:27 christos Exp $ */ /* @@ -52,7 +52,13 @@ #include <sys/mount.h> #include <sys/namei.h> #include <sys/malloc.h> + +#if defined(UVM) +#include <vm/vm.h> +#include <uvm/uvm_extern.h> /* for uvmexp */ +#else #include <sys/vmmeter.h> /* for cnt */ +#endif #include <miscfs/specfs/specdev.h> #include <miscfs/kernfs/kernfs.h> @@ -248,10 +254,16 @@ kernfs_statfs(mp, sbp, p) sbp->f_type = 7; #endif sbp->f_flags = 0; +#if defined(UVM) + sbp->f_bsize = uvmexp.pagesize; + sbp->f_iosize = uvmexp.pagesize; + sbp->f_bfree = physmem - uvmexp.wired; +#else 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; +#endif + sbp->f_blocks = physmem; sbp->f_bavail = 0; sbp->f_files = desiredvnodes; sbp->f_ffree = desiredvnodes - numvnodes; diff --git a/sys/miscfs/kernfs/kernfs_vnops.c b/sys/miscfs/kernfs/kernfs_vnops.c index 5f5f7acbe6e..ecddfa4871e 100644 --- a/sys/miscfs/kernfs/kernfs_vnops.c +++ b/sys/miscfs/kernfs/kernfs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kernfs_vnops.c,v 1.15 1998/08/06 19:34:36 csapuntz Exp $ */ +/* $OpenBSD: kernfs_vnops.c,v 1.16 1999/02/26 03:44:16 art Exp $ */ /* $NetBSD: kernfs_vnops.c,v 1.43 1996/03/16 23:52:47 christos Exp $ */ /* @@ -46,7 +46,6 @@ #include <sys/param.h> #include <sys/systm.h> #include <sys/kernel.h> -#include <sys/vmmeter.h> #include <sys/types.h> #include <sys/time.h> #include <sys/proc.h> @@ -61,6 +60,13 @@ #include <sys/msgbuf.h> #include <miscfs/kernfs/kernfs.h> +#if defined(UVM) +#include <vm/vm.h> +#include <uvm/uvm_extern.h> +#else +#include <sys/vmmeter.h> +#endif + #define KSTRING 256 /* Largest I/O available via this filesystem */ #define UIO_MX 32 @@ -99,7 +105,11 @@ struct kern_target kern_targets[] = { { DT_REG, N("ostype"), &ostype, KTT_STRING, VREG, READ_MODE }, { DT_REG, N("osrelease"), &osrelease, KTT_STRING, VREG, READ_MODE }, { DT_REG, N("osrev"), &osrev, KTT_INT, VREG, READ_MODE }, +#if defined(UVM) + { DT_REG, N("pagesize"), &uvmexp.pagesize, KTT_INT, VREG, READ_MODE }, +#else { DT_REG, N("pagesize"), &cnt.v_page_size, KTT_INT, VREG, READ_MODE }, +#endif { DT_REG, N("physmem"), &physmem, KTT_INT, VREG, READ_MODE }, { DT_REG, N("posix"), &posix, KTT_INT, VREG, READ_MODE }, #if 0 @@ -291,7 +301,11 @@ kernfs_xread(kt, off, bufp, len) break; case KTT_USERMEM: +#if defined(UVM) + sprintf(*bufp, "%u\n", physmem - uvmexp.wired); +#else sprintf(*bufp, "%u\n", physmem - cnt.v_wire_count); +#endif break; #ifdef IPSEC case KTT_IPSECSPI: |