summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux/linux_misc.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-07-18 10:26:09 +0000
committerphk <phk@FreeBSD.org>2003-07-18 10:26:09 +0000
commit5fa40a32657fa0c3bd8a986099bb65516d11e97b (patch)
treef65e135aef6b67bb4e1d27be159856b438db243f /sys/compat/linux/linux_misc.c
parent84f9cb2fa862e169a92c4dc14584dda3a33c2a89 (diff)
downloadFreeBSD-src-5fa40a32657fa0c3bd8a986099bb65516d11e97b.zip
FreeBSD-src-5fa40a32657fa0c3bd8a986099bb65516d11e97b.tar.gz
Add a new function swap_pager_status() which reports the total size of the
paging space and how much of it is in use (in pages). Use this interface from the Linuxolator instead of groping around in the internals of the swap_pager.
Diffstat (limited to 'sys/compat/linux/linux_misc.c')
-rw-r--r--sys/compat/linux/linux_misc.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c
index cf113ea..8ccc5cf 100644
--- a/sys/compat/linux/linux_misc.c
+++ b/sys/compat/linux/linux_misc.c
@@ -108,7 +108,7 @@ linux_sysinfo(struct thread *td, struct linux_sysinfo_args *args)
{
struct l_sysinfo sysinfo;
vm_object_t object;
- int i;
+ int i, j;
struct timespec ts;
/* Uptime is copied out of print_uptime() in kern_shutdown.c */
@@ -144,13 +144,9 @@ linux_sysinfo(struct thread *td, struct linux_sysinfo_args *args)
sysinfo.sharedram *= PAGE_SIZE;
sysinfo.bufferram = 0;
- if (swapblist == NULL) {
- sysinfo.totalswap= 0;
- sysinfo.freeswap = 0;
- } else {
- sysinfo.totalswap = swapblist->bl_blocks * 1024;
- sysinfo.freeswap = swapblist->bl_root->u.bmu_avail * PAGE_SIZE;
- }
+ swap_pager_status(&i, &j);
+ sysinfo.totalswap= i * PAGE_SIZE;
+ sysinfo.freeswap = (i - j) * PAGE_SIZE;
sysinfo.procs = 20; /* Hack */
OpenPOWER on IntegriCloud