From 81a29a1a1d5b6a303a9f53f82302506af58be7bd Mon Sep 17 00:00:00 2001 From: Mike Larkin Date: Wed, 11 Jul 2012 16:00:16 +0000 Subject: #ifdef the uvm swap checker fn for hibernate only, to save space in kernels that don't use hibernate requested by and ok deraadt@ --- sys/uvm/uvm_swap.c | 4 +++- sys/uvm/uvm_swap.h | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'sys/uvm') diff --git a/sys/uvm/uvm_swap.c b/sys/uvm/uvm_swap.c index 2c117da8805..7b3d90f9e07 100644 --- a/sys/uvm/uvm_swap.c +++ b/sys/uvm/uvm_swap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_swap.c,v 1.107 2012/07/11 12:31:28 mlarkin Exp $ */ +/* $OpenBSD: uvm_swap.c,v 1.108 2012/07/11 16:00:15 mlarkin Exp $ */ /* $NetBSD: uvm_swap.c,v 1.40 2000/11/17 11:39:39 mrg Exp $ */ /* @@ -2081,6 +2081,7 @@ swapmount(void) VOP_UNLOCK(vp, 0, curproc); } +#ifdef HIBERNATE /* * Check if free swap available at end of swap dev swdev. * Used by hibernate to check for usable swap area before writing the image @@ -2127,3 +2128,4 @@ uvm_swap_check_range(dev_t swdev, size_t size) return (r); } +#endif /* HIBERNATE */ diff --git a/sys/uvm/uvm_swap.h b/sys/uvm/uvm_swap.h index c0dc9e68e12..0dbcf23c60f 100644 --- a/sys/uvm/uvm_swap.h +++ b/sys/uvm/uvm_swap.h @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_swap.h,v 1.14 2012/07/11 10:07:40 mlarkin Exp $ */ +/* $OpenBSD: uvm_swap.h,v 1.15 2012/07/11 16:00:15 mlarkin Exp $ */ /* $NetBSD: uvm_swap.h,v 1.5 2000/01/11 06:57:51 chs Exp $ */ /* @@ -44,7 +44,9 @@ int uvm_swap_alloc(int *, boolean_t); void uvm_swap_free(int, int); void uvm_swap_markbad(int, int); void uvm_swap_freepages(struct vm_page **, int); +#ifdef HIBERNATE int uvm_swap_check_range(dev_t, size_t); +#endif /* HIBERNATE */ #ifdef UVM_SWAP_ENCRYPT void uvm_swap_initcrypt_all(void); void uvm_swap_finicrypt_all(void); -- cgit v1.2.3