diff --git a/kmod/src/Makefile.kernelcompat b/kmod/src/Makefile.kernelcompat index 896b7117..1880905e 100644 --- a/kmod/src/Makefile.kernelcompat +++ b/kmod/src/Makefile.kernelcompat @@ -63,3 +63,13 @@ endif ifneq (,$(shell grep 'static inline bool RBNAME.*_compute_max' include/linux/rbtree_augmented.h)) ccflags-y += -DKC_RB_TREE_AUGMENTED_COMPUTE_MAX endif + +# +# v4.15-rc3-4-gae5e165d855d +# +# linux/iversion.h needs to manually be included for code that +# manipulates this field. +# +ifneq (,$(shell grep -s 'define _LINUX_IVERSION_H' include/linux/iversion.h)) +ccflags-y += -DKC_NEED_LINUX_IVERSION_H=1 +endif diff --git a/kmod/src/kernelcompat.h b/kmod/src/kernelcompat.h index cd5ff1de..0a1b8d56 100644 --- a/kmod/src/kernelcompat.h +++ b/kmod/src/kernelcompat.h @@ -4,6 +4,17 @@ #include #include +/* + * v4.15-rc3-4-gae5e165d855d + * + * new API for handling inode->i_version. This forces us to + * include this API where we need. We include it here for + * convenience instead of where it's needed. + */ +#ifdef KC_NEED_LINUX_IVERSION_H +#include +#endif + #ifndef KC_ITERATE_DIR_CONTEXT typedef filldir_t kc_readdir_ctx_t; #define KC_DECLARE_READDIR(name, file, dirent, ctx) name(file, dirent, ctx)