page.c 576 B

12345678910111213141516171819202122232425262728
  1. // SPDX-License-Identifier: GPL-2.0
  2. #include <linux/gfp.h>
  3. #include <linux/highmem.h>
  4. #include <linux/mm.h>
  5. __rust_helper struct page *rust_helper_alloc_pages(gfp_t gfp_mask,
  6. unsigned int order)
  7. {
  8. return alloc_pages(gfp_mask, order);
  9. }
  10. __rust_helper void *rust_helper_kmap_local_page(struct page *page)
  11. {
  12. return kmap_local_page(page);
  13. }
  14. __rust_helper void rust_helper_kunmap_local(const void *addr)
  15. {
  16. kunmap_local(addr);
  17. }
  18. #ifndef NODE_NOT_IN_PAGE_FLAGS
  19. __rust_helper int rust_helper_page_to_nid(const struct page *page)
  20. {
  21. return page_to_nid(page);
  22. }
  23. #endif