Deleted Added
full compact
opensolaris_kmem.c (270759) opensolaris_kmem.c (270861)
1/*-
2 * Copyright (c) 2006-2007 Pawel Jakub Dawidek <pjd@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2006-2007 Pawel Jakub Dawidek <pjd@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c 270759 2014-08-28 19:50:08Z smh $");
28__FBSDID("$FreeBSD: head/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c 270861 2014-08-30 21:44:32Z smh $");
29
30#include <sys/param.h>
31#include <sys/kernel.h>
32#include <sys/systm.h>
33#include <sys/malloc.h>
34#include <sys/kmem.h>
35#include <sys/debug.h>
36#include <sys/mutex.h>

--- 110 unchanged lines hidden (view full) ---

147
148 return (vm_cnt.v_free_min);
149}
150
151u_int
152kmem_free_count(void)
153{
154
29
30#include <sys/param.h>
31#include <sys/kernel.h>
32#include <sys/systm.h>
33#include <sys/malloc.h>
34#include <sys/kmem.h>
35#include <sys/debug.h>
36#include <sys/mutex.h>

--- 110 unchanged lines hidden (view full) ---

147
148 return (vm_cnt.v_free_min);
149}
150
151u_int
152kmem_free_count(void)
153{
154
155 return (vm_cnt.v_free_count);
155 return (vm_cnt.v_free_count + vm_cnt.v_cache_count);
156}
157
158u_int
159kmem_page_count(void)
160{
161
162 return (vm_cnt.v_page_count);
163}
164
165uint64_t
166kmem_size(void)
167{
168
169 return (kmem_size_val);
170}
171
156}
157
158u_int
159kmem_page_count(void)
160{
161
162 return (vm_cnt.v_page_count);
163}
164
165uint64_t
166kmem_size(void)
167{
168
169 return (kmem_size_val);
170}
171
172uint64_t
173kmem_used(void)
174{
175
176 return (vmem_size(kmem_arena, VMEM_ALLOC));
177}
178
172static int
173kmem_std_constructor(void *mem, int size __unused, void *private, int flags)
174{
175 struct kmem_cache *cache = private;
176
177 return (cache->kc_constructor(mem, cache->kc_private, flags));
178}
179

--- 131 unchanged lines hidden ---
179static int
180kmem_std_constructor(void *mem, int size __unused, void *private, int flags)
181{
182 struct kmem_cache *cache = private;
183
184 return (cache->kc_constructor(mem, cache->kc_private, flags));
185}
186

--- 131 unchanged lines hidden ---