diff --git a/kmod/src/Makefile.kernelcompat b/kmod/src/Makefile.kernelcompat index bd236c43..fca82d4f 100644 --- a/kmod/src/Makefile.kernelcompat +++ b/kmod/src/Makefile.kernelcompat @@ -34,3 +34,13 @@ endif ifneq (,$(shell grep 'FMODE_KABI_ITERATE' include/linux/fs.h)) ccflags-y += -DKC_FMODE_KABI_ITERATE endif + +# +# v4.11-12447-g104b4e5139fe +# +# Renamed __percpu_counter_add to percpu_counter_add_batch to clarify +# that the __ wasn't less safe, just took an extra parameter. +# +ifneq (,$(shell grep 'percpu_counter_add_batch' include/linux/percpu_counter.h)) +ccflags-y += -DKC_PERCPU_COUNTER_ADD_BATCH +endif diff --git a/kmod/src/counters.h b/kmod/src/counters.h index a7eccb60..79978510 100644 --- a/kmod/src/counters.h +++ b/kmod/src/counters.h @@ -235,12 +235,12 @@ struct scoutfs_counters { #define SCOUTFS_PCPU_COUNTER_BATCH (1 << 30) #define scoutfs_inc_counter(sb, which) \ - __percpu_counter_add(&SCOUTFS_SB(sb)->counters->which, 1, \ - SCOUTFS_PCPU_COUNTER_BATCH) + percpu_counter_add_batch(&SCOUTFS_SB(sb)->counters->which, 1, \ + SCOUTFS_PCPU_COUNTER_BATCH) #define scoutfs_add_counter(sb, which, cnt) \ - __percpu_counter_add(&SCOUTFS_SB(sb)->counters->which, cnt, \ - SCOUTFS_PCPU_COUNTER_BATCH) + percpu_counter_add_batch(&SCOUTFS_SB(sb)->counters->which, cnt, \ + SCOUTFS_PCPU_COUNTER_BATCH) void __init scoutfs_init_counters(void); int scoutfs_setup_counters(struct super_block *sb); diff --git a/kmod/src/kernelcompat.h b/kmod/src/kernelcompat.h index 6899f684..aba96e13 100644 --- a/kmod/src/kernelcompat.h +++ b/kmod/src/kernelcompat.h @@ -46,4 +46,8 @@ static inline int dir_emit_dots(struct file *file, void *dirent, } #endif +#ifndef KC_DIR_EMIT_DOTS +#define percpu_counter_add_batch __percpu_counter_add +#endif + #endif