1 /* SPDX-License-Identifier: GPL-2.0
12 * typedef netmem_ref - a nonexistent type marking a reference to generic
15 * A netmem_ref currently is always a reference to a struct page. This
16 * abstraction is introduced so support for new memory types can be added.
18 * Use the supplied helpers to obtain the underlying memory pointer and fields.
20 typedef unsigned long __bitwise netmem_ref;
22 /* This conversion fails (returns NULL) if the netmem_ref is not struct page
25 * Currently struct page is the only possible netmem, and this helper never
28 static inline struct page *netmem_to_page(netmem_ref netmem)
30 return (__force struct page *)netmem;
33 /* Converting from page to netmem is always safe, because a page can always be
36 static inline netmem_ref page_to_netmem(struct page *page)
38 return (__force netmem_ref)page;
41 #endif /* _NET_NETMEM_H */