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.

47 lines
1.3 KiB

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