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) {