From 345ebd08761927a95cd3f70a47d9b0561c71cad1 Mon Sep 17 00:00:00 2001 From: Auke Kok Date: Mon, 16 Oct 2023 16:36:22 -0700 Subject: [PATCH] fiemap_prep replaces fiemap_check_flags. v5.7-rc4-53-gcddf8a2c4a82 The prep helper replaces the sanity checks. Signed-off-by: Auke Kok --- kmod/src/Makefile.kernelcompat | 8 ++++++++ kmod/src/data.c | 2 +- kmod/src/kernelcompat.h | 4 ++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/kmod/src/Makefile.kernelcompat b/kmod/src/Makefile.kernelcompat index 1a9c0da1..5c8d519b 100644 --- a/kmod/src/Makefile.kernelcompat +++ b/kmod/src/Makefile.kernelcompat @@ -314,3 +314,11 @@ endif ifneq (,$(shell grep 'struct bio .bio_alloc.struct block_device .bdev' include/linux/bio.h)) ccflags-y += -DKC_BIO_ALLOC_DEV_OPF_ARGS endif + +# +# v5.7-rc4-53-gcddf8a2c4a82 +# +# fiemap_prep() replaces fiemap_check_flags() +ifneq (,$(shell grep -s 'int fiemap_prep.struct inode' include/linux/fiemap.h)) +ccflags-y += -DKC_FIEMAP_PREP +endif diff --git a/kmod/src/data.c b/kmod/src/data.c index 49ab801d..8a1c65e0 100644 --- a/kmod/src/data.c +++ b/kmod/src/data.c @@ -1544,7 +1544,7 @@ int scoutfs_data_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, goto out; } - ret = fiemap_check_flags(fieinfo, FIEMAP_FLAG_SYNC); + ret = fiemap_prep(inode, fieinfo, start, &len, FIEMAP_FLAG_SYNC); if (ret) goto out; diff --git a/kmod/src/kernelcompat.h b/kmod/src/kernelcompat.h index 247aa4e1..665d28fa 100644 --- a/kmod/src/kernelcompat.h +++ b/kmod/src/kernelcompat.h @@ -316,4 +316,8 @@ static inline struct bio *kc_bio_alloc(struct block_device *bdev, unsigned short } #endif +#ifndef KC_FIEMAP_PREP +#define fiemap_prep(inode, fieinfo, start, len, flags) fiemap_check_flags(fieinfo, flags) +#endif + #endif