summaryrefslogtreecommitdiffstats
path: root/sys/vm/swap_pager.h
diff options
context:
space:
mode:
authordillon <dillon@FreeBSD.org>1999-09-17 05:09:24 +0000
committerdillon <dillon@FreeBSD.org>1999-09-17 05:09:24 +0000
commit7a0052d268ee8736620e4c44ba2fd3149196391d (patch)
tree6c2168f8ca0cc78688aa99b55ef65a87f46aef72 /sys/vm/swap_pager.h
parent6c2a557edd099560a5d4a4c3cb01ca87f8ff1a87 (diff)
downloadFreeBSD-src-7a0052d268ee8736620e4c44ba2fd3149196391d.zip
FreeBSD-src-7a0052d268ee8736620e4c44ba2fd3149196391d.tar.gz
Fix a number of spl bugs related to reserving and freeing swap space.
Swap space can be freed from an interrupt and so swap reservation and freeing must occur at splvm. Add swap_pager_reserve() code to support a new swap pre-reservation capability for the VN device. Generally cleanup the swap code by simplifying the swp_pager_meta_build() static function and consolidating the SWAPBLK_NONE test from a bit test to an absolute compare. The bit test was left over from a rejected swap allocation scheme that was not ultimately committed. A few other minor cleanups were also made. Reorganize the swap strategy code, again for VN support, to not reallocate swap when writing as this messes up pre-reservation and can fragment I/O unnecessarily as VN-baesd disk is messed around with. Reviewed by: Alan Cox <alc@cs.rice.edu>, David Greenman <dg@root.com>
Diffstat (limited to 'sys/vm/swap_pager.h')
-rw-r--r--sys/vm/swap_pager.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/vm/swap_pager.h b/sys/vm/swap_pager.h
index 4557036..69bdbd1 100644
--- a/sys/vm/swap_pager.h
+++ b/sys/vm/swap_pager.h
@@ -78,7 +78,7 @@
struct swblock {
struct swblock *swb_hnext;
vm_object_t swb_object;
- int swb_index;
+ vm_pindex_t swb_index;
int swb_count;
daddr_t swb_pages[SWAP_META_PAGES];
};
@@ -96,6 +96,7 @@ void swap_pager_copy __P((vm_object_t, vm_object_t, vm_pindex_t, int));
void swap_pager_freespace __P((vm_object_t, vm_pindex_t, vm_size_t));
void swap_pager_dmzspace __P((vm_object_t, vm_pindex_t, vm_size_t));
void swap_pager_swap_init __P((void));
+int swap_pager_reserve __P((vm_object_t, vm_pindex_t, vm_size_t));
/*
* newswap functions
OpenPOWER on IntegriCloud