git: d25ed6504383 - main - uma: Fix improper uses of UMA_MD_SMALL_ALLOC

From: Bojan Novković <bnovkov_at_FreeBSD.org>
Date: Sun, 26 May 2024 14:28:00 UTC
The branch main has been updated by bnovkov:

URL: https://cgit.FreeBSD.org/src/commit/?id=d25ed6504383e15b7eb6d04876b70548fffc9690

commit d25ed6504383e15b7eb6d04876b70548fffc9690
Author:     Bojan Novković <bnovkov@FreeBSD.org>
AuthorDate: 2024-05-26 07:54:45 +0000
Commit:     Bojan Novković <bnovkov@FreeBSD.org>
CommitDate: 2024-05-26 05:27:37 +0000

    uma: Fix improper uses of UMA_MD_SMALL_ALLOC
    
    UMA_MD_SMALL_ALLOC was recently replaced by UMA_USE_DMAP, but
    da76d349b6b1 missed some improper uses of the old symbol.
    This change makes sure that UMA_USE_DMAP is used properly in
    code that selects uma_small_alloc.
    
    Fixes: da76d349b6b1
    Reported by: eduardo, rlibby
    Approved by: markj (mentor)
    Differential Revision:  https://reviews.freebsd.org/D45368
---
 sys/vm/uma_core.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c
index 59066eb96ae9..516ac2c2965a 100644
--- a/sys/vm/uma_core.c
+++ b/sys/vm/uma_core.c
@@ -2523,7 +2523,7 @@ keg_ctor(void *mem, int size, void *udata, int flags)
 	 * If we haven't booted yet we need allocations to go through the
 	 * startup cache until the vm is ready.
 	 */
-#ifdef UMA_MD_SMALL_ALLOC
+#ifdef UMA_USE_DMAP
 	if (keg->uk_ppera == 1)
 		keg->uk_allocf = uma_small_alloc;
 	else
@@ -2536,7 +2536,7 @@ keg_ctor(void *mem, int size, void *udata, int flags)
 		keg->uk_allocf = contig_alloc;
 	else
 		keg->uk_allocf = page_alloc;
-#ifdef UMA_MD_SMALL_ALLOC
+#ifdef UMA_USE_DMAP
 	if (keg->uk_ppera == 1)
 		keg->uk_freef = uma_small_free;
 	else
@@ -5221,7 +5221,7 @@ uma_zone_reserve_kva(uma_zone_t zone, int count)
 	keg->uk_kva = kva;
 	keg->uk_offset = 0;
 	zone->uz_max_items = pages * keg->uk_ipers;
-#ifdef UMA_MD_SMALL_ALLOC
+#ifdef UMA_USE_DMAP
 	keg->uk_allocf = (keg->uk_ppera > 1) ? noobj_alloc : uma_small_alloc;
 #else
 	keg->uk_allocf = noobj_alloc;