#19046: YAFFS2 filesystem does't compile after switching to 3.18 kernel
-----------------------------------+----------------------------------
Reporter: alexisgreen | Owner: developers
Type: defect | Status: new
Priority: normal | Milestone: Chaos Calmer (trunk)
Component: kernel | Version: Trunk
Keywords: yaffs2 mikrotik rb433 |
-----------------------------------+----------------------------------
At r44497 read/write functions need to be updated to use iter versions to
prevent build failure.
{{{
CC fs/yaffs2/yaffs_vfs.o
fs/yaffs2/yaffs_vfs.c:799:14: error: 'generic_file_aio_read' undeclared
here (not in a function)
.aio_read = generic_file_aio_read,
^
fs/yaffs2/yaffs_vfs.c:800:15: error: 'generic_file_aio_write' undeclared
here (not in a function)
.aio_write = generic_file_aio_write,
^
fs/yaffs2/yaffs_vfs.c:805:18: error: 'generic_file_splice_write'
undeclared here (not in a function)
.splice_write = generic_file_splice_write,
^
fs/yaffs2/yaffs_vfs.c: In function 'yaffs_readlink':
fs/yaffs2/yaffs_vfs.c:1053:2: error: implicit declaration of function
'vfs_readlink' [-Werror=implicit-function-declaration]
ret = vfs_readlink(dentry, buffer, buflen, alias);
^
cc1: some warnings being treated as errors
make[7]: *** [fs/yaffs2/yaffs_vfs.o] Error 1
make[6]: *** [fs/yaffs2] Error 2
}}}
Patch to make it compile (I've tested yaffs and it appears to behave
normally with 3.18 after this).
{{{
Index: target/linux/generic/files/fs/yaffs2/yaffs_vfs.c
===================================================================
--- target/linux/generic/files/fs/yaffs2/yaffs_vfs.c (revision 44497)
+++ target/linux/generic/files/fs/yaffs2/yaffs_vfs.c (working copy)
@@ -764,8 +764,22 @@
return 0;
}
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(3, 16, 0))
+static const struct file_operations yaffs_file_operations = {
+ .read = new_sync_read,
+ .write = new_sync_write,
+ .read_iter = generic_file_read_iter,
+ .write_iter = generic_file_write_iter,
+ .mmap = generic_file_mmap,
+ .flush = yaffs_file_flush,
+ .fsync = yaffs_sync_object,
+ .splice_read = generic_file_splice_read,
+ .splice_write = iter_file_splice_write,
+ .llseek = generic_file_llseek,
+};
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 22))
+
+#elif (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 22))
static const struct file_operations yaffs_file_operations = {
.read = do_sync_read,
.write = do_sync_write,
@@ -1023,7 +1037,11 @@
if (!alias)
return -ENOMEM;
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(3, 14, 99)
ret = vfs_readlink(dentry, buffer, buflen, alias);
+#else
+ ret = readlink_copy(buffer, buflen, alias);
+#endif
kfree(alias);
return ret;
}
}}}
--
Ticket URL: <https://dev.openwrt.org/ticket/19046>
OpenWrt <http://openwrt.org>
Opensource Wireless Router Technology
_______________________________________________
openwrt-tickets mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-tickets