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
709 stars 324 forks source link

Does not compile with Kernel 4.5 (rc1) #81

Closed alexzeitgeist closed 8 years ago

alexzeitgeist commented 8 years ago

Tried to compile (git Nov 10, 2015) with Kernel 4.5-rc1.

DKMS make.log for exfat-1.2.9+20151110 for kernel 4.5.0-040500rc1-generic (x86_64) Fri Jan 29 19:12:27 CET 2016 make: Entering directory '/usr/src/linux-headers-4.5.0-040500rc1-generic' LD /var/lib/dkms/exfat/1.2.9+20151110/build/built-in.o CC [M] /var/lib/dkms/exfat/1.2.9+20151110/build/exfat_core.o CC [M] /var/lib/dkms/exfat/1.2.9+20151110/build/exfat_super.o /var/lib/dkms/exfat/1.2.9+20151110/build/exfat_super.c:1379:2: error: unknown field ‘follow_link’ specified in initializer .follow_link = exfat_follow_link, ^ /var/lib/dkms/exfat/1.2.9+20151110/build/exfat_super.c:1379:17: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types] .follow_link = exfat_follow_link, ^ /var/lib/dkms/exfat/1.2.9+20151110/build/exfat_super.c:1379:17: note: (near initialization for ‘exfat_symlink_inode_operations.create’) scripts/Makefile.build:258: recipe for target '/var/lib/dkms/exfat/1.2.9+20151110/build/exfat_super.o' failed make[1]: * [/var/lib/dkms/exfat/1.2.9+20151110/build/exfat_super.o] Error 1 Makefile:1391: recipe for target 'module/var/lib/dkms/exfat/1.2.9+20151110/build' failed make: * [module/var/lib/dkms/exfat/1.2.9+20151110/build] Error 2 make: Leaving directory '/usr/src/linux-headers-4.5.0-040500rc1-generic'

freswa commented 8 years ago

Same for me on rc2

ryleyangus commented 8 years ago

I got the same issue on rc3 as well. I had a go at a quick patch after looking at the changes in 4.5-rc1. I haven't tested it fully yet.

--- exfat_super.c       2016-02-09 09:55:17.809459213 +1100
+++ exfat_super.4.5.c   2016-02-09 09:54:17.606124077 +1100
@@ -1359,7 +1359,13 @@
 /*======================================================================*/
 /*  File Operations                                                     */
 /*======================================================================*/
-#if LINUX_VERSION_CODE > KERNEL_VERSION(4,1,0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0)
+static const char *exfat_get_link(struct dentry *dentry, struct inode *inode, void **cookie)
+{
+       struct exfat_inode_info *ei = EXFAT_I(dentry->d_inode);
+       return *cookie = (char *)(ei->target);
+}
+#elif LINUX_VERSION_CODE > KERNEL_VERSION(4,1,0)
 static const char *exfat_follow_link(struct dentry *dentry, void **cookie)
 {
        struct exfat_inode_info *ei = EXFAT_I(dentry->d_inode);
@@ -1376,7 +1382,10 @@

 const struct inode_operations exfat_symlink_inode_operations = {
        .readlink    = generic_readlink,
-       .follow_link = exfat_follow_link,
+       #if LINUX_VERSION_CODE < KERNEL_VERSION(4,5,0)
+               .follow_link = exfat_follow_link,
+       #endif
+       .get_link = exfat_get_link,
 };

 static int exfat_file_release(struct inode *inode, struct file *filp)
dorimanx commented 8 years ago

can you please submit pull request, so your name will be in contributors. Thanks for review. i am stuck with 3.4.110 so i cant help much.

dorimanx commented 8 years ago

Should be OK now after update by @ryleyangus