Debian Codegraph @

rust/helpers/page.c

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