From 9c71694aea35fa50224dbcf58912306dc4752aa7 Mon Sep 17 00:00:00 2001 From: Elmer Miroslav Mosher Golovin Date: Wed, 11 Mar 2026 00:55:39 +0300 Subject: [PATCH] fix for RHEL 10.1 --- binder/binder_alloc.c | 4 +++- binder/compat_version.h | 10 ++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 binder/compat_version.h diff --git a/binder/binder_alloc.c b/binder/binder_alloc.c index 36941d3..6e43eca 100644 --- a/binder/binder_alloc.c +++ b/binder/binder_alloc.c @@ -26,6 +26,7 @@ #include #include "binder_alloc.h" #include "binder_trace.h" +#include "compat_version.h" struct list_lru binder_alloc_lru; @@ -1073,7 +1074,8 @@ static unsigned long binder_shrink_scan(struct shrinker *shrink, struct shrink_control *sc) { unsigned long ret; -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0) || \ + defined(RHEL_10_1_BACKPORTS)) ret = list_lru_walk(&binder_alloc_lru, binder_alloc_free_page_no_lock, NULL, sc->nr_to_scan); #else diff --git a/binder/compat_version.h b/binder/compat_version.h new file mode 100644 index 0000000..3de03ef --- /dev/null +++ b/binder/compat_version.h @@ -0,0 +1,10 @@ +#ifndef __COMPAT_VERSION_H__ +# define __COMPAT_VERSION_H__ + +#if defined(RHEL_RELEASE_CODE) && defined(RHEL_RELEASE_VERSION) +# if RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(10, 1) +# define RHEL_10_1_BACKPORTS 1 +# endif +#endif + +#endif /* __COMPAT_VERSION_H__ */ \ No newline at end of file