diff --git a/exfat_fs.h b/exfat_fs.h index 00f3cd631bac..89ea4942f88f 100644 --- a/exfat_fs.h +++ b/exfat_fs.h @@ -11,7 +11,7 @@ #include #include -#define EXFAT_VERSION "5.10.1" +#define EXFAT_VERSION "5.11.1" #define EXFAT_SUPER_MAGIC 0x2011BAB0UL #define EXFAT_ROOT_INO 1 diff --git a/file.c b/file.c index db10146c53b1..44c41c9b5308 100644 --- a/file.c +++ b/file.c @@ -244,7 +244,11 @@ void exfat_truncate(struct inode *inode, loff_t size) { struct super_block *sb = inode->i_sb; struct exfat_sb_info *sbi = EXFAT_SB(sb); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0) unsigned int blocksize = i_blocksize(inode); +#else + unsigned int blocksize = 1 << inode->i_blkbits; +#endif loff_t aligned_size; int err; diff --git a/nls.c b/nls.c index 675d0e7058c5..58e434a5c330 100644 --- a/nls.c +++ b/nls.c @@ -3,9 +3,13 @@ * Copyright (C) 2012-2013 Samsung Electronics Co., Ltd. */ +#include #include #include #include +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 18, 0) +#include +#endif #include #include "exfat_raw.h" @@ -659,7 +663,11 @@ static int exfat_load_upcase_table(struct super_block *sb, unsigned char skip = false; unsigned short *upcase_table; - upcase_table = kcalloc(UTBL_COUNT, sizeof(unsigned short), GFP_KERNEL); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 18, 0) + upcase_table = kvcalloc(UTBL_COUNT, sizeof(unsigned short), GFP_KERNEL); +#else + upcase_table = vzalloc(UTBL_COUNT * sizeof(unsigned short)); +#endif if (!upcase_table) return -ENOMEM; @@ -715,7 +723,11 @@ static int exfat_load_default_upcase_table(struct super_block *sb) unsigned short uni = 0, *upcase_table; unsigned int index = 0; - upcase_table = kcalloc(UTBL_COUNT, sizeof(unsigned short), GFP_KERNEL); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 18, 0) + upcase_table = kvcalloc(UTBL_COUNT, sizeof(unsigned short), GFP_KERNEL); +#else + upcase_table = vzalloc(UTBL_COUNT * sizeof(unsigned short)); +#endif if (!upcase_table) return -ENOMEM; @@ -803,5 +815,9 @@ load_default: void exfat_free_upcase_table(struct exfat_sb_info *sbi) { - kfree(sbi->vol_utbl); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 18, 0) + kvfree(sbi->vol_utbl); +#else + vfree(sbi->vol_utbl); +#endif }