git: 4c89b333808a - main - linuxkpi: Add `radix_tree_deref_slot()`

From: Jean-Sébastien Pédron <dumbbell_at_FreeBSD.org>
Date: Mon, 05 Jan 2026 20:09:33 UTC
The branch main has been updated by dumbbell:

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

commit 4c89b333808a7eae0dad595b13686e9cf60bd4e6
Author:     Jean-Sébastien Pédron <dumbbell@FreeBSD.org>
AuthorDate: 2025-09-07 13:45:10 +0000
Commit:     Jean-Sébastien Pédron <dumbbell@FreeBSD.org>
CommitDate: 2026-01-05 19:32:50 +0000

    linuxkpi: Add `radix_tree_deref_slot()`
    
    We don't do reference counting, we only dereference the pointer and
    retunr the value.
    
    The amdgpu DRM driver started to use it in Linux 6.10.
    
    Reviewed by:    bz
    Sponsored by:   The FreeBSD Foundation
    Differential Revision: https://reviews.freebsd.org/D54502
---
 sys/compat/linuxkpi/common/include/linux/radix-tree.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/sys/compat/linuxkpi/common/include/linux/radix-tree.h b/sys/compat/linuxkpi/common/include/linux/radix-tree.h
index 1019697303db..55f0fc949807 100644
--- a/sys/compat/linuxkpi/common/include/linux/radix-tree.h
+++ b/sys/compat/linuxkpi/common/include/linux/radix-tree.h
@@ -68,6 +68,12 @@ struct radix_tree_iter {
 	for ((iter)->index = (start);			  \
 	     radix_tree_iter_find(root, iter, &(slot)); (iter)->index++)
 
+static inline void *
+radix_tree_deref_slot(void **slot)
+{
+	return (*slot);
+}
+
 static inline int
 radix_tree_exception(void *arg)
 {