aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/kmem.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/kmem.h')
-rw-r--r--fs/xfs/kmem.h21
1 files changed, 11 insertions, 10 deletions
diff --git a/fs/xfs/kmem.h b/fs/xfs/kmem.h
index ab7c53fe346e..b2f2620f9a87 100644
--- a/fs/xfs/kmem.h
+++ b/fs/xfs/kmem.h
@@ -27,10 +27,11 @@
27 * General memory allocation interfaces 27 * General memory allocation interfaces
28 */ 28 */
29 29
30#define KM_SLEEP 0x0001u 30typedef unsigned __bitwise xfs_km_flags_t;
31#define KM_NOSLEEP 0x0002u 31#define KM_SLEEP ((__force xfs_km_flags_t)0x0001u)
32#define KM_NOFS 0x0004u 32#define KM_NOSLEEP ((__force xfs_km_flags_t)0x0002u)
33#define KM_MAYFAIL 0x0008u 33#define KM_NOFS ((__force xfs_km_flags_t)0x0004u)
34#define KM_MAYFAIL ((__force xfs_km_flags_t)0x0008u)
34 35
35/* 36/*
36 * We use a special process flag to avoid recursive callbacks into 37 * We use a special process flag to avoid recursive callbacks into
@@ -38,7 +39,7 @@
38 * warnings, so we explicitly skip any generic ones (silly of us). 39 * warnings, so we explicitly skip any generic ones (silly of us).
39 */ 40 */
40static inline gfp_t 41static inline gfp_t
41kmem_flags_convert(unsigned int __nocast flags) 42kmem_flags_convert(xfs_km_flags_t flags)
42{ 43{
43 gfp_t lflags; 44 gfp_t lflags;
44 45
@@ -54,9 +55,9 @@ kmem_flags_convert(unsigned int __nocast flags)
54 return lflags; 55 return lflags;
55} 56}
56 57
57extern void *kmem_alloc(size_t, unsigned int __nocast); 58extern void *kmem_alloc(size_t, xfs_km_flags_t);
58extern void *kmem_zalloc(size_t, unsigned int __nocast); 59extern void *kmem_zalloc(size_t, xfs_km_flags_t);
59extern void *kmem_realloc(const void *, size_t, size_t, unsigned int __nocast); 60extern void *kmem_realloc(const void *, size_t, size_t, xfs_km_flags_t);
60extern void kmem_free(const void *); 61extern void kmem_free(const void *);
61 62
62static inline void *kmem_zalloc_large(size_t size) 63static inline void *kmem_zalloc_large(size_t size)
@@ -107,7 +108,7 @@ kmem_zone_destroy(kmem_zone_t *zone)
107 kmem_cache_destroy(zone); 108 kmem_cache_destroy(zone);
108} 109}
109 110
110extern void *kmem_zone_alloc(kmem_zone_t *, unsigned int __nocast); 111extern void *kmem_zone_alloc(kmem_zone_t *, xfs_km_flags_t);
111extern void *kmem_zone_zalloc(kmem_zone_t *, unsigned int __nocast); 112extern void *kmem_zone_zalloc(kmem_zone_t *, xfs_km_flags_t);
112 113
113#endif /* __XFS_SUPPORT_KMEM_H__ */ 114#endif /* __XFS_SUPPORT_KMEM_H__ */