generic: 4.4: refresh patches
[openwrt.git] / target / linux / generic / patches-4.1 / 504-yaffs-3.16-new-fops.patch
1 --- a/fs/yaffs2/yaffs_vfs.c
2 +++ b/fs/yaffs2/yaffs_vfs.c
3 @@ -774,7 +774,25 @@ static int yaffs_sync_object(struct file
4  }
5  
6  
7 -#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 22))
8 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0))
9 +static const struct file_operations yaffs_file_operations = {
10 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 1, 0))
11 +       .read = new_sync_read,
12 +#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 1, 0) */
13 +       .read_iter = generic_file_read_iter,
14 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 1, 0))
15 +       .write = new_sync_write,
16 +#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 1, 0) */
17 +       .write_iter = generic_file_write_iter,
18 +       .mmap = generic_file_mmap,
19 +       .flush = yaffs_file_flush,
20 +       .fsync = yaffs_sync_object,
21 +       .splice_read = generic_file_splice_read,
22 +       .splice_write = iter_file_splice_write,
23 +       .llseek = generic_file_llseek,
24 +};
25 +
26 +#elif (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 22))
27  static const struct file_operations yaffs_file_operations = {
28         .read = do_sync_read,
29         .write = do_sync_write,