diff options
| author | Poul-Henning Kamp <phk@FreeBSD.org> | 2003-07-18 10:26:09 +0000 |
|---|---|---|
| committer | Poul-Henning Kamp <phk@FreeBSD.org> | 2003-07-18 10:26:09 +0000 |
| commit | 567104a1485ba7e76069976c365b6938aa83fe91 (patch) | |
| tree | f65e135aef6b67bb4e1d27be159856b438db243f /sys/compat/linux/linux_misc.c | |
| parent | e9c0cc157b4a98fe537e0df8cc9c51674b5cb00a (diff) | |
Notes
Diffstat (limited to 'sys/compat/linux/linux_misc.c')
| -rw-r--r-- | sys/compat/linux/linux_misc.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index cf113ea236df..8ccc5cf0c212 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 */ |
