]> 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)
committerMark Johnston <markj@FreeBSD.org>
Thu, 2 Nov 2023 13:30:03 +0000 (09:30 -0400)
commitdc8f7692fd1de628814f4eaf4a233dccf4c92199
tree194d453459575a8e8f2b04f8156efe6586da549c
parenteac624207ccf3a16225368d226861b06e3631d0d
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
MFC after:              2 weeks
Sponsored by:           The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D42258
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