You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.1 KiB

  1. --- a/file.c
  2. +++ b/file.c
  3. @@ -625,6 +625,9 @@ static int antfs_readpages(struct file *
  4. unsigned page_idx = nr_pages;
  5. pgoff_t page_idx_to_init;
  6. bool do_init_page = false;
  7. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
  8. + DEFINE_READAHEAD(rac, file, mapping, 0);
  9. +#endif
  10. if (page_offs & (buffer_len - 1)) {
  11. /* If initialized size is not on buffer boundary, walk
  12. @@ -660,8 +663,13 @@ static int antfs_readpages(struct file *
  13. }
  14. }
  15. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
  16. + mpage_readahead(&rac, antfs_get_block);
  17. + err = 0;
  18. +#else
  19. err = mpage_readpages(mapping, pages, nr_pages,
  20. antfs_get_block);
  21. +#endif
  22. if (!err && do_init_page) {
  23. /* Initialize stuff past initialized_size with zero. */
  24. page = grab_cache_page(mapping, page_idx_to_init);
  25. --- a/libntfs-3g/misc.c
  26. +++ b/libntfs-3g/misc.c
  27. @@ -38,7 +38,11 @@ void *ntfs_malloc(size_t size)
  28. return kmalloc(size, GFP_KERNEL);
  29. }
  30. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
  31. + return __vmalloc(size, GFP_KERNEL);
  32. +#else
  33. return __vmalloc(size, GFP_KERNEL, PAGE_KERNEL);
  34. +#endif
  35. }
  36. /**