From de8180fa852610ea8c47ba66e1a7b07c9d667755 Mon Sep 17 00:00:00 2001 From: Namjae Jeon Date: Wed, 27 Nov 2024 15:46:22 +0900 Subject: [PATCH] exfat: fix build error with linux-5.15 kernel Signed-off-by: Namjae Jeon --- file.c | 4 ++++ super.c | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/file.c b/file.c index c9d0b4f..092bc87 100644 --- a/file.c +++ b/file.c @@ -769,7 +769,11 @@ static vm_fault_t exfat_page_mkwrite(struct vm_fault *vmf) err = exfat_extend_valid_size(file, end); if (err < 0) { inode_unlock(inode); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 6, 0) return vmf_fs_error(err); +#else + return block_page_mkwrite_return(err); +#endif } } diff --git a/super.c b/super.c index 560f287..bbf72db 100644 --- a/super.c +++ b/super.c @@ -177,7 +177,9 @@ static int exfat_show_options(struct seq_file *m, struct dentry *root) int exfat_force_shutdown(struct super_block *sb, u32 flags) { +#if LINUX_VERSION_CODE > KERNEL_VERSION(6, 9, 0) int ret; +#endif struct exfat_sb_info *sbi = sb->s_fs_info; struct exfat_mount_options *opts = &sbi->options; @@ -187,10 +189,12 @@ int exfat_force_shutdown(struct super_block *sb, u32 flags) switch (flags) { case EXFAT_GOING_DOWN_DEFAULT: case EXFAT_GOING_DOWN_FULLSYNC: +#if LINUX_VERSION_CODE > KERNEL_VERSION(6, 9, 0) ret = bdev_freeze(sb->s_bdev); if (ret) return ret; bdev_thaw(sb->s_bdev); +#endif set_bit(EXFAT_FLAGS_SHUTDOWN, &sbi->s_exfat_flags); break; case EXFAT_GOING_DOWN_NOSYNC: @@ -240,7 +244,9 @@ static const struct super_operations exfat_sops = { .sync_fs = exfat_sync_fs, .statfs = exfat_statfs, .show_options = exfat_show_options, +#if LINUX_VERSION_CODE > KERNEL_VERSION(5, 16, 0) .shutdown = exfat_shutdown, +#endif }; enum {