summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2007-02-07 17:43:11 +0000
committerjhb <jhb@FreeBSD.org>2007-02-07 17:43:11 +0000
commit9c764c7fc306e18397030217602494b6937d91ed (patch)
treea754087b619a680335a655d98e288052176274c4 /sys/vm
parent61cc2fad7da1e9e31379d361767b26486acda39f (diff)
downloadFreeBSD-src-9c764c7fc306e18397030217602494b6937d91ed.zip
FreeBSD-src-9c764c7fc306e18397030217602494b6937d91ed.tar.gz
- Move 'struct swdevt' back into swap_pager.h and expose it to userland.
- Restore support for fetching swap information from crash dumps via kvm_get_swapinfo(3) to fix pstat -T/-s on crash dumps. Reviewed by: arch@, phk MFC after: 1 week
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/swap_pager.c31
-rw-r--r--sys/vm/swap_pager.h32
2 files changed, 32 insertions, 31 deletions
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c
index 46f49d2..4167c6b 100644
--- a/sys/vm/swap_pager.c
+++ b/sys/vm/swap_pager.c
@@ -138,37 +138,6 @@ __FBSDID("$FreeBSD$");
#define SWAP_META_PAGES (SWB_NPAGES * 2)
#define SWAP_META_MASK (SWAP_META_PAGES - 1)
-typedef int32_t swblk_t; /*
- * swap offset. This is the type used to
- * address the "virtual swap device" and
- * therefore the maximum swap space is
- * 2^32 pages.
- */
-
-struct swdevt;
-typedef void sw_strategy_t(struct buf *bp, struct swdevt *sw);
-typedef void sw_close_t(struct thread *td, struct swdevt *sw);
-
-/*
- * Swap device table
- */
-struct swdevt {
- int sw_flags;
- int sw_nblks;
- int sw_used;
- dev_t sw_dev;
- struct vnode *sw_vp;
- void *sw_id;
- swblk_t sw_first;
- swblk_t sw_end;
- struct blist *sw_blist;
- TAILQ_ENTRY(swdevt) sw_list;
- sw_strategy_t *sw_strategy;
- sw_close_t *sw_close;
-};
-
-#define SW_CLOSING 0x04
-
struct swblock {
struct swblock *swb_hnext;
vm_object_t swb_object;
diff --git a/sys/vm/swap_pager.h b/sys/vm/swap_pager.h
index a254cc7..c3366e8 100644
--- a/sys/vm/swap_pager.h
+++ b/sys/vm/swap_pager.h
@@ -38,6 +38,38 @@
#ifndef _VM_SWAP_PAGER_H_
#define _VM_SWAP_PAGER_H_ 1
+typedef int32_t swblk_t; /*
+ * swap offset. This is the type used to
+ * address the "virtual swap device" and
+ * therefore the maximum swap space is
+ * 2^32 pages.
+ */
+
+struct buf;
+struct swdevt;
+typedef void sw_strategy_t(struct buf *, struct swdevt *);
+typedef void sw_close_t(struct thread *, struct swdevt *);
+
+/*
+ * Swap device table
+ */
+struct swdevt {
+ int sw_flags;
+ int sw_nblks;
+ int sw_used;
+ dev_t sw_dev;
+ struct vnode *sw_vp;
+ void *sw_id;
+ swblk_t sw_first;
+ swblk_t sw_end;
+ struct blist *sw_blist;
+ TAILQ_ENTRY(swdevt) sw_list;
+ sw_strategy_t *sw_strategy;
+ sw_close_t *sw_close;
+};
+
+#define SW_CLOSING 0x04
+
#ifdef _KERNEL
extern int swap_pager_full;
OpenPOWER on IntegriCloud