diff --git a/kmod/src/Makefile.kernelcompat b/kmod/src/Makefile.kernelcompat index 81dc8a58..112b4c8b 100644 --- a/kmod/src/Makefile.kernelcompat +++ b/kmod/src/Makefile.kernelcompat @@ -496,3 +496,12 @@ endif ifneq (,$(shell grep 'struct posix_acl.*get_inode_acl' include/linux/fs.h)) ccflags-y += -DKC_GET_INODE_ACL endif + +# +# v6.15-13744-g41cb08555c41 +# +# from_timer renamed to timer_container_of. +# +ifneq (,$(shell grep 'define timer_container_of' include/linux/timer.h)) +ccflags-y += -DKC_TIMER_CONTAINER_OF +endif diff --git a/kmod/src/fence.c b/kmod/src/fence.c index 3669dc2d..c63f27b4 100644 --- a/kmod/src/fence.c +++ b/kmod/src/fence.c @@ -222,7 +222,7 @@ static struct attribute *fence_attrs[] = { static void fence_timeout(struct timer_list *timer) { - struct pending_fence *fence = from_timer(fence, timer, timer); + struct pending_fence *fence = timer_container_of(fence, timer, timer); struct super_block *sb = fence->sb; DECLARE_FENCE_INFO(sb, fi); diff --git a/kmod/src/kernelcompat.h b/kmod/src/kernelcompat.h index 5564a12a..06855bf6 100644 --- a/kmod/src/kernelcompat.h +++ b/kmod/src/kernelcompat.h @@ -489,4 +489,9 @@ static inline void stack_trace_print(unsigned long *entries, unsigned int nr_ent } #endif +#ifndef KC_TIMER_CONTAINER_OF +#define timer_container_of(var, callback_timer, timer_fieldname) \ + from_timer(var, callback_timer, timer_fieldname) +#endif + #endif diff --git a/kmod/src/recov.c b/kmod/src/recov.c index d77e39cf..25855069 100644 --- a/kmod/src/recov.c +++ b/kmod/src/recov.c @@ -134,7 +134,7 @@ static int recov_finished(struct recov_info *recinf) static void timer_callback(struct timer_list *timer) { - struct recov_info *recinf = from_timer(recinf, timer, timer); + struct recov_info *recinf = timer_container_of(recinf, timer, timer); recinf->timeout_fn(recinf->sb); }