From 95f4e56546afa7f4cbe928658b2f2ad27817dc7d Mon Sep 17 00:00:00 2001 From: Auke Kok Date: Fri, 17 May 2024 14:20:47 -0700 Subject: [PATCH] Introduce blk_mode_t instead of abuse of fmode_t v6.4-rc2-198-g05bdb9965305 adds a new type for passing flags instead of abusing fmode_t flags. They are essentially the same flags just in a new type. Signed-off-by: Auke Kok --- kmod/src/Makefile.kernelcompat | 8 ++++++++ kmod/src/super.h | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/kmod/src/Makefile.kernelcompat b/kmod/src/Makefile.kernelcompat index 7e3235b5..ee3de8f9 100644 --- a/kmod/src/Makefile.kernelcompat +++ b/kmod/src/Makefile.kernelcompat @@ -396,3 +396,11 @@ endif ifneq (,$(shell grep 'extern void d_tmpfile.struct dentry' include/linux/dcache.h)) ccflags-y += -DKC_D_TMPFILE_DENTRY endif + +# +# v6.4-rc2-201-g0733ad800291 +# +# New blk_mode_t replaces abuse of fmode_t +ifneq (,$(shell grep 'typedef unsigned int __bitwise blk_mode_t' include/linux/blkdev.h)) +ccflags-y += -DKC_HAVE_BLK_MODE_T +endif diff --git a/kmod/src/super.h b/kmod/src/super.h index 03c6a6ea..45ec8450 100644 --- a/kmod/src/super.h +++ b/kmod/src/super.h @@ -101,7 +101,11 @@ static inline bool SCOUTFS_IS_META_BDEV(struct scoutfs_super_block *super_block) return !!(le64_to_cpu(super_block->flags) & SCOUTFS_FLAG_IS_META_BDEV); } +#ifdef KC_HAVE_BLK_MODE_T +#define SCOUTFS_META_BDEV_MODE (BLK_OPEN_READ | BLK_OPEN_WRITE | BLK_OPEN_EXCL) +#else #define SCOUTFS_META_BDEV_MODE (FMODE_READ | FMODE_WRITE | FMODE_EXCL) +#endif static inline bool scoutfs_forcing_unmount(struct super_block *sb) {