]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
uma: Hide 'uma_align_cache'; Create/rename accessors
authorOlivier Certner <olce.freebsd@certner.fr>
Fri, 13 Oct 2023 09:52:28 +0000 (11:52 +0200)
committerOlivier Certner <olce@FreeBSD.org>
Thu, 21 Dec 2023 13:39:26 +0000 (14:39 +0100)
commit56c53cc8fb3edaed82678440da5cf8e0dc482d03
tree40fdf35c479b5dcb6e277062087863c06e264624
parent037c104ca4a71b7510799c6fff5fa031c070319f
uma: Hide 'uma_align_cache'; Create/rename accessors

Create the uma_get_cache_align_mask() accessor and put it in a separate
private header so as to minimize namespace pollution in header/source
files that need only this function and not the whole 'uma.h' header.

Make sure the accessors have '_mask' as a suffix, so that callers are
aware that the real alignment is the power of two that is the mask plus
one.  Rename the stem to something more explicit.  Rename
uma_set_cache_align_mask()'s single parameter to 'mask'.

Hide 'uma_align_cache' to ensure that it cannot be set in any other way
then by a call to uma_set_cache_align_mask(), which will perform sanity
checks in a further commit.  While here, rename it to
'uma_cache_align_mask'.

This is also in preparation for some further changes, such as improving
the sanity checks, eliminating internal resolving of UMA_ALIGN_CACHE and
changing the type of the 'uma_cache_align_mask' variable.

Reviewed by:            markj, kib
Sponsored by:           The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D42258

(cherry picked from commit dc8f7692fd1de628814f4eaf4a233dccf4c92199)

Approved by:    markj (mentor)
sys/arm/arm/cpufunc.c
sys/compat/linuxkpi/common/include/linux/dma-mapping.h
sys/vm/uma.h
sys/vm/uma_align_mask.h [new file with mode: 0644]
sys/vm/uma_core.c