From eafb8621da64aab47b4ffc79534ddf275ff56099 Mon Sep 17 00:00:00 2001 From: Auke Kok Date: Mon, 15 May 2023 18:24:30 -0400 Subject: [PATCH] d_materialise_unique replaced with d_splice_alias. Note argument order reversal. Signed-off-by: Auke Kok --- kmod/src/Makefile.kernelcompat | 10 ++++++++++ kmod/src/kernelcompat.h | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/kmod/src/Makefile.kernelcompat b/kmod/src/Makefile.kernelcompat index d7995cc5..fab13456 100644 --- a/kmod/src/Makefile.kernelcompat +++ b/kmod/src/Makefile.kernelcompat @@ -26,6 +26,16 @@ ifneq (,$(shell grep 'dir_emit_dots' include/linux/fs.h)) ccflags-y += -DKC_DIR_EMIT_DOTS endif +# +# v3.18-rc2-19-gb5ae6b15bd73 +# +# Folds d_materialise_unique into d_splice_alias. Note reversal +# of arguments (Also note Documentation/filesystems/porting.rst) +# +ifneq (,$(shell grep 'd_materialise_unique' include/linux/dcache.h)) +ccflags-y += -DKC_D_MATERIALISE_UNIQUE=1 +endif + # # RHEL extended the fop struct so to use it we have to set # a flag to indicate that the struct is large enough and diff --git a/kmod/src/kernelcompat.h b/kmod/src/kernelcompat.h index 7aed2d5a..1514a6f0 100644 --- a/kmod/src/kernelcompat.h +++ b/kmod/src/kernelcompat.h @@ -54,4 +54,14 @@ static inline int dir_emit_dots(struct file *file, void *dirent, #define kc_posix_acl_valid(user_ns, acl) posix_acl_valid(acl) #endif +/* + * v3.18-rc2-19-gb5ae6b15bd73 + * + * Folds d_materialise_unique into d_splice_alias. Note reversal + * of arguments (Also note Documentation/filesystems/porting.rst) + */ +#ifndef KC_D_MATERIALISE_UNIQUE +#define d_materialise_unique(dentry, inode) d_splice_alias(inode, dentry) +#endif + #endif