1343f1a6f99b1127ca37a598f2ddf880bf53de98
[linux-2.6-block.git] / fs / xfs / kmem.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Copyright (c) 2000-2005 Silicon Graphics, Inc.
4  * All Rights Reserved.
5  */
6 #ifndef __XFS_SUPPORT_KMEM_H__
7 #define __XFS_SUPPORT_KMEM_H__
8
9 #include <linux/slab.h>
10 #include <linux/sched.h>
11 #include <linux/mm.h>
12 #include <linux/vmalloc.h>
13
14 /*
15  * General memory allocation interfaces
16  */
17
18 static inline void  kmem_free(const void *ptr)
19 {
20         kvfree(ptr);
21 }
22
23 /*
24  * Zone interfaces
25  */
26 static inline struct page *
27 kmem_to_page(void *addr)
28 {
29         if (is_vmalloc_addr(addr))
30                 return vmalloc_to_page(addr);
31         return virt_to_page(addr);
32 }
33
34 #endif /* __XFS_SUPPORT_KMEM_H__ */