diff options
author | Jason Wessel <jason.wessel@windriver.com> | 2010-01-09 05:49:44 -0600 |
---|---|---|
committer | Jason Wessel <jason.wessel@windriver.com> | 2010-01-09 05:49:44 -0600 |
commit | b5cfb6f8bd0081f631ad670e10198b481de9e443 (patch) | |
tree | 27261413efec8e9f36e767ce99e361a213031251 /mm/swapfile.c | |
parent | ab4b105cd5b084bafaf4e2ede5b8db5ad7f1c14a (diff) |
kdb: core for kgdb back end (2 of 2)
This patch contains the hooks and instrumentation into kernel which
live outside the kernel/debug directory, which the kdb core
will call to run commands like lsmod, dmesg, bt etc...
CC: mort@sgi.com
CC: linux-arch@vger.kernel.org
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Diffstat (limited to 'mm/swapfile.c')
-rw-r--r-- | mm/swapfile.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/mm/swapfile.c b/mm/swapfile.c index 6c0585b16418..dc2039edef00 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -13,6 +13,7 @@ #include <linux/swap.h> #include <linux/vmalloc.h> #include <linux/pagemap.h> +#include <linux/kdb.h> #include <linux/namei.h> #include <linux/shm.h> #include <linux/blkdev.h> @@ -2056,12 +2057,11 @@ out: return error; } -void si_swapinfo(struct sysinfo *val) +void __si_swapinfo(struct sysinfo *val) { unsigned int type; unsigned long nr_to_be_unused = 0; - spin_lock(&swap_lock); for (type = 0; type < nr_swapfiles; type++) { struct swap_info_struct *si = swap_info[type]; @@ -2070,6 +2070,12 @@ void si_swapinfo(struct sysinfo *val) } val->freeswap = nr_swap_pages + nr_to_be_unused; val->totalswap = total_swap_pages + nr_to_be_unused; +} + +void si_swapinfo(struct sysinfo *val) +{ + spin_lock(&swap_lock); + __si_swapinfo(val); spin_unlock(&swap_lock); } |