Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
torvalds
GitHub Repository: torvalds/linux
Path: blob/master/rust/helpers/page.c
29509 views
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
struct page *rust_helper_alloc_pages(gfp_t gfp_mask, unsigned int order)
8
{
9
return alloc_pages(gfp_mask, order);
10
}
11
12
void *rust_helper_kmap_local_page(struct page *page)
13
{
14
return kmap_local_page(page);
15
}
16
17
void rust_helper_kunmap_local(const void *addr)
18
{
19
kunmap_local(addr);
20
}
21
22
#ifndef NODE_NOT_IN_PAGE_FLAGS
23
int rust_helper_page_to_nid(const struct page *page)
24
{
25
return page_to_nid(page);
26
}
27
#endif
28
29