aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-04-02 06:24:04 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-05-29 23:28:32 -0400
commit77ba78776e90e8de541f13b326e284c74286252f (patch)
treeea05703a21e255484462b947e5f15ffd781163cd
parentc217a2a004d98d09dfceec3a023c563ed800e833 (diff)
xfs: switch to proper __bitwise type for KM_... flags
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--fs/xfs/kmem.c10
-rw-r--r--fs/xfs/kmem.h21
-rw-r--r--fs/xfs/xfs_log.c2
-rw-r--r--fs/xfs/xfs_log_priv.h2
-rw-r--r--fs/xfs/xfs_trans.c2
-rw-r--r--fs/xfs/xfs_trans.h2
6 files changed, 20 insertions, 19 deletions
diff --git a/fs/xfs/kmem.c b/fs/xfs/kmem.c
index a907de565db3..4a7286c1dc80 100644
--- a/fs/xfs/kmem.c
+++ b/fs/xfs/kmem.c
@@ -46,7 +46,7 @@ kmem_zalloc_greedy(size_t *size, size_t minsize, size_t maxsize)
46} 46}
47 47
48void * 48void *
49kmem_alloc(size_t size, unsigned int __nocast flags) 49kmem_alloc(size_t size, xfs_km_flags_t flags)
50{ 50{
51 int retries = 0; 51 int retries = 0;
52 gfp_t lflags = kmem_flags_convert(flags); 52 gfp_t lflags = kmem_flags_convert(flags);
@@ -65,7 +65,7 @@ kmem_alloc(size_t size, unsigned int __nocast flags)
65} 65}
66 66
67void * 67void *
68kmem_zalloc(size_t size, unsigned int __nocast flags) 68kmem_zalloc(size_t size, xfs_km_flags_t flags)
69{ 69{
70 void *ptr; 70 void *ptr;
71 71
@@ -87,7 +87,7 @@ kmem_free(const void *ptr)
87 87
88void * 88void *
89kmem_realloc(const void *ptr, size_t newsize, size_t oldsize, 89kmem_realloc(const void *ptr, size_t newsize, size_t oldsize,
90 unsigned int __nocast flags) 90 xfs_km_flags_t flags)
91{ 91{
92 void *new; 92 void *new;
93 93
@@ -102,7 +102,7 @@ kmem_realloc(const void *ptr, size_t newsize, size_t oldsize,
102} 102}
103 103
104void * 104void *
105kmem_zone_alloc(kmem_zone_t *zone, unsigned int __nocast flags) 105kmem_zone_alloc(kmem_zone_t *zone, xfs_km_flags_t flags)
106{ 106{
107 int retries = 0; 107 int retries = 0;
108 gfp_t lflags = kmem_flags_convert(flags); 108 gfp_t lflags = kmem_flags_convert(flags);
@@ -121,7 +121,7 @@ kmem_zone_alloc(kmem_zone_t *zone, unsigned int __nocast flags)
121} 121}
122 122
123void * 123void *
124kmem_zone_zalloc(kmem_zone_t *zone, unsigned int __nocast flags) 124kmem_zone_zalloc(kmem_zone_t *zone, xfs_km_flags_t flags)
125{ 125{
126 void *ptr; 126 void *ptr;
127 127
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__ */
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
index 6b965bf450e4..f30d9807dc48 100644
--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -3152,7 +3152,7 @@ xlog_ticket_alloc(
3152 int cnt, 3152 int cnt,
3153 char client, 3153 char client,
3154 bool permanent, 3154 bool permanent,
3155 int alloc_flags) 3155 xfs_km_flags_t alloc_flags)
3156{ 3156{
3157 struct xlog_ticket *tic; 3157 struct xlog_ticket *tic;
3158 uint num_headers; 3158 uint num_headers;
diff --git a/fs/xfs/xfs_log_priv.h b/fs/xfs/xfs_log_priv.h
index 735ff1ee53da..5bc33261f5be 100644
--- a/fs/xfs/xfs_log_priv.h
+++ b/fs/xfs/xfs_log_priv.h
@@ -555,7 +555,7 @@ extern void xlog_pack_data(xlog_t *log, xlog_in_core_t *iclog, int);
555extern kmem_zone_t *xfs_log_ticket_zone; 555extern kmem_zone_t *xfs_log_ticket_zone;
556struct xlog_ticket *xlog_ticket_alloc(struct log *log, int unit_bytes, 556struct xlog_ticket *xlog_ticket_alloc(struct log *log, int unit_bytes,
557 int count, char client, bool permanent, 557 int count, char client, bool permanent,
558 int alloc_flags); 558 xfs_km_flags_t alloc_flags);
559 559
560 560
561static inline void 561static inline void
diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c
index cdf896fcbfa4..fdf324508c5e 100644
--- a/fs/xfs/xfs_trans.c
+++ b/fs/xfs/xfs_trans.c
@@ -584,7 +584,7 @@ xfs_trans_t *
584_xfs_trans_alloc( 584_xfs_trans_alloc(
585 xfs_mount_t *mp, 585 xfs_mount_t *mp,
586 uint type, 586 uint type,
587 uint memflags) 587 xfs_km_flags_t memflags)
588{ 588{
589 xfs_trans_t *tp; 589 xfs_trans_t *tp;
590 590
diff --git a/fs/xfs/xfs_trans.h b/fs/xfs/xfs_trans.h
index 7ab99e1898c8..7c37b533aa8e 100644
--- a/fs/xfs/xfs_trans.h
+++ b/fs/xfs/xfs_trans.h
@@ -443,7 +443,7 @@ typedef struct xfs_trans {
443 * XFS transaction mechanism exported interfaces. 443 * XFS transaction mechanism exported interfaces.
444 */ 444 */
445xfs_trans_t *xfs_trans_alloc(struct xfs_mount *, uint); 445xfs_trans_t *xfs_trans_alloc(struct xfs_mount *, uint);
446xfs_trans_t *_xfs_trans_alloc(struct xfs_mount *, uint, uint); 446xfs_trans_t *_xfs_trans_alloc(struct xfs_mount *, uint, xfs_km_flags_t);
447xfs_trans_t *xfs_trans_dup(xfs_trans_t *); 447xfs_trans_t *xfs_trans_dup(xfs_trans_t *);
448int xfs_trans_reserve(xfs_trans_t *, uint, uint, uint, 448int xfs_trans_reserve(xfs_trans_t *, uint, uint, uint,
449 uint, uint); 449 uint, uint);