Sun Dec 19 01:24:49 2021 UTC ()
Define kmem_cache_shrink = pool_cache_reclaim.


(riastradh)
diff -r1.1 -r1.2 src/sys/external/bsd/common/include/linux/slab.h

cvs diff -r1.1 -r1.2 src/sys/external/bsd/common/include/linux/slab.h (expand / switch to unified diff)

--- src/sys/external/bsd/common/include/linux/slab.h 2018/08/27 15:45:06 1.1
+++ src/sys/external/bsd/common/include/linux/slab.h 2021/12/19 01:24:49 1.2
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: slab.h,v 1.1 2018/08/27 15:45:06 riastradh Exp $ */ 1/* $NetBSD: slab.h,v 1.2 2021/12/19 01:24:49 riastradh Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2013 The NetBSD Foundation, Inc. 4 * Copyright (c) 2013 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Taylor R. Campbell. 8 * by Taylor R. Campbell.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -196,14 +196,21 @@ static inline void * @@ -196,14 +196,21 @@ static inline void *
196kmem_cache_zalloc(struct kmem_cache *kc, gfp_t gfp) 196kmem_cache_zalloc(struct kmem_cache *kc, gfp_t gfp)
197{ 197{
198 198
199 return kmem_cache_alloc(kc, (gfp | __GFP_ZERO)); 199 return kmem_cache_alloc(kc, (gfp | __GFP_ZERO));
200} 200}
201 201
202static inline void 202static inline void
203kmem_cache_free(struct kmem_cache *kc, void *ptr) 203kmem_cache_free(struct kmem_cache *kc, void *ptr)
204{ 204{
205 205
206 pool_cache_put(kc->kc_pool_cache, ptr); 206 pool_cache_put(kc->kc_pool_cache, ptr);
207} 207}
208 208
 209static inline void
 210kmem_cache_shrink(struct kmem_cache *kc)
 211{
 212
 213 pool_cache_reclaim(kc->kc_pool_cache);
 214}
 215
209#endif /* _LINUX_SLAB_H_ */ 216#endif /* _LINUX_SLAB_H_ */