dorimanx / exfat-nofuse

Android ARM Linux non-fuse read/write kernel driver for exFat and VFat Android file systems
GNU General Public License v2.0
707 stars 326 forks source link

Error compiling on CentOS 7, kernel 3.10.0 #134

Open Dimensional opened 6 years ago

Dimensional commented 6 years ago

I'm unable to compile the source on the system, with it's kernel being 3.10.0. The error appears to be due to exfat_super.c's calling of truncate_pagecache with 3 arguments, while the kernel source file mm.h only has the function with 2 arguments.

//exfat-nofuse/exfat_super.c: In function ‘exfat_write_failed’: //exfat-nofuse/exfat_super.c:1653:3: error: too many arguments to function ‘truncate_pagecache’ truncate_pagecache(inode, to, i_size_read(inode)); ^ In file included from include/linux/pagemap.h:7:0, from //exfat-nofuse/exfat_super.c:57: include/linux/mm.h:1236:13: note: declared here extern void truncate_pagecache(struct inode *inode, loff_t new); ^ make[2]: [//exfat-nofuse/exfat_super.o] Error 1 make[1]: [module//exfat-nofuse] Error 2

haklein commented 5 years ago

quick and dirty fix for CentOS/RHEL 7:

--- a/exfat_super.c
+++ b/exfat_super.c
@@ -1647,7 +1647,7 @@ static void exfat_write_failed(struct address_space *mapping, loff_t to)
 {
        struct inode *inode = mapping->host;
        if (to > i_size_read(inode)) {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
                truncate_pagecache(inode, i_size_read(inode));
 #else
                truncate_pagecache(inode, to, i_size_read(inode));