Date: Wed, 4 Dec 2019 18:40:06 +0000 (UTC) From: Andrew Turner <andrew@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355398 - head/sys/vm Message-ID: <201912041840.xB4Ie6c4012113@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: andrew Date: Wed Dec 4 18:40:05 2019 New Revision: 355398 URL: https://svnweb.freebsd.org/changeset/base/355398 Log: Fix the signature for zone_import and zone_release These are cast to uma_import and uma_release functions. Use the signature for these in the zone functions. This was found with an experimental Kernel CFI. It will complain if the signature is different than what a function pointer expects. The simplest way to fix these is to correct the signature. Reviewed by: rlibby Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D22671 Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Wed Dec 4 18:38:50 2019 (r355397) +++ head/sys/vm/uma_core.c Wed Dec 4 18:40:05 2019 (r355398) @@ -279,8 +279,8 @@ static void *slab_alloc_item(uma_keg_t keg, uma_slab_t static void slab_free_item(uma_zone_t zone, uma_slab_t slab, void *item); static uma_keg_t uma_kcreate(uma_zone_t zone, size_t size, uma_init uminit, uma_fini fini, int align, uint32_t flags); -static int zone_import(uma_zone_t, void **, int, int, int); -static void zone_release(uma_zone_t, void **, int); +static int zone_import(void *, void **, int, int, int); +static void zone_release(void *, void **, int); static void uma_zero_item(void *, uma_zone_t); static bool cache_alloc(uma_zone_t, uma_cache_t, void *, int); static bool cache_free(uma_zone_t, uma_cache_t, void *, void *, int); @@ -2094,8 +2094,8 @@ zone_ctor(void *mem, int size, void *udata, int flags) /* * Use the regular zone/keg/slab allocator. */ - zone->uz_import = (uma_import)zone_import; - zone->uz_release = (uma_release)zone_release; + zone->uz_import = zone_import; + zone->uz_release = zone_release; zone->uz_arg = zone; keg = arg->keg; @@ -3112,8 +3112,9 @@ slab_alloc_item(uma_keg_t keg, uma_slab_t slab) } static int -zone_import(uma_zone_t zone, void **bucket, int max, int domain, int flags) +zone_import(void *arg, void **bucket, int max, int domain, int flags) { + uma_zone_t zone; uma_slab_t slab; uma_keg_t keg; #ifdef NUMA @@ -3121,6 +3122,7 @@ zone_import(uma_zone_t zone, void **bucket, int max, i #endif int i; + zone = arg; slab = NULL; keg = zone->uz_keg; KEG_LOCK(keg); @@ -3616,14 +3618,16 @@ slab_free_item(uma_zone_t zone, uma_slab_t slab, void } static void -zone_release(uma_zone_t zone, void **bucket, int cnt) +zone_release(void *arg, void **bucket, int cnt) { + uma_zone_t zone; void *item; uma_slab_t slab; uma_keg_t keg; uint8_t *mem; int i; + zone = arg; keg = zone->uz_keg; KEG_LOCK(keg); for (i = 0; i < cnt; i++) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201912041840.xB4Ie6c4012113>