2
0

504-yaffs-3.16-new-fops.patch 1.0 KB

1234567891011121314151617181920212223242526272829
  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. -#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 22))
  6. +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0))
  7. +static const struct file_operations yaffs_file_operations = {
  8. +#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 1, 0))
  9. + .read = new_sync_read,
  10. +#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 1, 0) */
  11. + .read_iter = generic_file_read_iter,
  12. +#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 1, 0))
  13. + .write = new_sync_write,
  14. +#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 1, 0) */
  15. + .write_iter = generic_file_write_iter,
  16. + .mmap = generic_file_mmap,
  17. + .flush = yaffs_file_flush,
  18. + .fsync = yaffs_sync_object,
  19. + .splice_read = generic_file_splice_read,
  20. + .splice_write = iter_file_splice_write,
  21. + .llseek = generic_file_llseek,
  22. +};
  23. +
  24. +#elif (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 22))
  25. static const struct file_operations yaffs_file_operations = {
  26. .read = do_sync_read,
  27. .write = do_sync_write,