From 77156d695f0698914a3683e457c21b89a5225370 Mon Sep 17 00:00:00 2001 From: Auke Kok Date: Thu, 20 Nov 2025 11:20:16 -0800 Subject: [PATCH] Remove list_lru_walk_* el7 compat. The original patch added compat for both el7 and higher kernels, so this just drops the el7 parts. Signed-off-by: Auke Kok --- kmod/src/Makefile.kernelcompat | 9 --------- kmod/src/kernelcompat.c | 32 -------------------------------- kmod/src/kernelcompat.h | 11 +---------- 3 files changed, 1 insertion(+), 51 deletions(-) diff --git a/kmod/src/Makefile.kernelcompat b/kmod/src/Makefile.kernelcompat index 2ba4c986..0c6fd598 100644 --- a/kmod/src/Makefile.kernelcompat +++ b/kmod/src/Makefile.kernelcompat @@ -187,15 +187,6 @@ ifneq (,$(shell grep 'typedef.*__bitwise unsigned.*int vm_fault_t' include/linux ccflags-y += -DKC_MM_VM_FAULT_T endif -# -# v3.19-4757-g3f97b163207c -# -# lru_list_walk_cb lru arg added -# -ifneq (,$(shell grep 'struct list_head \*item, spinlock_t \*lock, void \*cb_arg' include/linux/list_lru.h)) -ccflags-y += -DKC_LIST_LRU_WALK_CB_ITEM_LOCK -endif - # # v6.7-rc4-153-g0a97c01cd20b # diff --git a/kmod/src/kernelcompat.c b/kmod/src/kernelcompat.c index 561dcad1..6457728f 100644 --- a/kmod/src/kernelcompat.c +++ b/kmod/src/kernelcompat.c @@ -5,38 +5,6 @@ #include -#ifdef KC_LIST_LRU_WALK_CB_ITEM_LOCK -static enum lru_status kc_isolate(struct list_head *item, spinlock_t *lock, void *cb_arg) -{ - struct kc_isolate_args *args = cb_arg; - - /* isolate doesn't use list, nr_items updated in caller */ - return args->isolate(item, NULL, args->cb_arg); -} - -unsigned long kc_list_lru_walk(struct list_lru *lru, kc_list_lru_walk_cb_t isolate, void *cb_arg, - unsigned long nr_to_walk) -{ - struct kc_isolate_args args = { - .isolate = isolate, - .cb_arg = cb_arg, - }; - - return list_lru_walk(lru, kc_isolate, &args, nr_to_walk); -} - -unsigned long kc_list_lru_shrink_walk(struct list_lru *lru, struct shrink_control *sc, - kc_list_lru_walk_cb_t isolate, void *cb_arg) -{ - struct kc_isolate_args args = { - .isolate = isolate, - .cb_arg = cb_arg, - }; - - return list_lru_shrink_walk(lru, sc, kc_isolate, &args); -} -#endif - #ifdef KC_LIST_LRU_WALK_CB_LIST_LOCK static enum lru_status kc_isolate(struct list_head *item, struct list_lru_one *list, spinlock_t *lock, void *cb_arg) diff --git a/kmod/src/kernelcompat.h b/kmod/src/kernelcompat.h index 55eb3d4c..685f380f 100644 --- a/kmod/src/kernelcompat.h +++ b/kmod/src/kernelcompat.h @@ -201,7 +201,7 @@ static inline vm_fault_t vmf_error(int err) #define list_lru_del_obj list_lru_del #endif -#if defined(KC_LIST_LRU_WALK_CB_LIST_LOCK) || defined(KC_LIST_LRU_WALK_CB_ITEM_LOCK) +#if defined(KC_LIST_LRU_WALK_CB_LIST_LOCK) struct list_lru_one; typedef enum lru_status (*kc_list_lru_walk_cb_t)(struct list_head *item, struct list_lru_one *list, void *cb_arg); @@ -217,15 +217,6 @@ unsigned long kc_list_lru_shrink_walk(struct list_lru *lru, struct shrink_contro #define kc_list_lru_shrink_walk list_lru_shrink_walk #endif -#if defined(KC_LIST_LRU_WALK_CB_ITEM_LOCK) -/* isolate moved by hand, nr_items updated in walk as _REMOVE returned */ -static inline void list_lru_isolate_move(struct list_lru_one *list, struct list_head *item, - struct list_head *head) -{ - list_move(item, head); -} -#endif - #ifndef KC_STACK_TRACE_SAVE #include static inline unsigned int stack_trace_save(unsigned long *store, unsigned int size,