summaryrefslogtreecommitdiffstats
path: root/mm/swapfile.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-01-27 23:45:22 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-01-27 23:45:22 +0000
commit5b35aa5cd29bb111d847b2a2ed18110acbfb1f44 (patch)
treec7bbaa1137528330d3c74d14056ef7016a52be72 /mm/swapfile.c
parent511bcd7c5924ce9e98ad1cb851988f7448dfef0f (diff)
Merge with Linux 2.3.24.
Diffstat (limited to 'mm/swapfile.c')
-rw-r--r--mm/swapfile.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 76aea7b7e..bcd7b4587 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -779,23 +779,26 @@ out:
void si_swapinfo(struct sysinfo *val)
{
- unsigned int i, j;
+ unsigned int i;
+ unsigned long freeswap = 0;
+ unsigned long totalswap = 0;
- val->freeswap = val->totalswap = 0;
for (i = 0; i < nr_swapfiles; i++) {
+ unsigned int j;
if ((swap_info[i].flags & SWP_WRITEOK) != SWP_WRITEOK)
continue;
- for (j = 0; j < swap_info[i].max; ++j)
+ for (j = 0; j < swap_info[i].max; ++j) {
switch (swap_info[i].swap_map[j]) {
case SWAP_MAP_BAD:
continue;
case 0:
- ++val->freeswap;
+ freeswap++;
default:
- ++val->totalswap;
+ totalswap++;
}
+ }
}
- val->freeswap <<= PAGE_SHIFT;
- val->totalswap <<= PAGE_SHIFT;
+ val->freeswap = freeswap;
+ val->totalswap = totalswap;
return;
}