diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-04-02 06:24:04 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-05-29 23:28:32 -0400 |
commit | 77ba78776e90e8de541f13b326e284c74286252f (patch) | |
tree | ea05703a21e255484462b947e5f15ffd781163cd | |
parent | c217a2a004d98d09dfceec3a023c563ed800e833 (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.c | 10 | ||||
-rw-r--r-- | fs/xfs/kmem.h | 21 | ||||
-rw-r--r-- | fs/xfs/xfs_log.c | 2 | ||||
-rw-r--r-- | fs/xfs/xfs_log_priv.h | 2 | ||||
-rw-r--r-- | fs/xfs/xfs_trans.c | 2 | ||||
-rw-r--r-- | fs/xfs/xfs_trans.h | 2 |
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 | ||
48 | void * | 48 | void * |
49 | kmem_alloc(size_t size, unsigned int __nocast flags) | 49 | kmem_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 | ||
67 | void * | 67 | void * |
68 | kmem_zalloc(size_t size, unsigned int __nocast flags) | 68 | kmem_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 | ||
88 | void * | 88 | void * |
89 | kmem_realloc(const void *ptr, size_t newsize, size_t oldsize, | 89 | kmem_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 | ||
104 | void * | 104 | void * |
105 | kmem_zone_alloc(kmem_zone_t *zone, unsigned int __nocast flags) | 105 | kmem_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 | ||
123 | void * | 123 | void * |
124 | kmem_zone_zalloc(kmem_zone_t *zone, unsigned int __nocast flags) | 124 | kmem_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 | 30 | typedef 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 | */ |
40 | static inline gfp_t | 41 | static inline gfp_t |
41 | kmem_flags_convert(unsigned int __nocast flags) | 42 | kmem_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 | ||
57 | extern void *kmem_alloc(size_t, unsigned int __nocast); | 58 | extern void *kmem_alloc(size_t, xfs_km_flags_t); |
58 | extern void *kmem_zalloc(size_t, unsigned int __nocast); | 59 | extern void *kmem_zalloc(size_t, xfs_km_flags_t); |
59 | extern void *kmem_realloc(const void *, size_t, size_t, unsigned int __nocast); | 60 | extern void *kmem_realloc(const void *, size_t, size_t, xfs_km_flags_t); |
60 | extern void kmem_free(const void *); | 61 | extern void kmem_free(const void *); |
61 | 62 | ||
62 | static inline void *kmem_zalloc_large(size_t size) | 63 | static 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 | ||
110 | extern void *kmem_zone_alloc(kmem_zone_t *, unsigned int __nocast); | 111 | extern void *kmem_zone_alloc(kmem_zone_t *, xfs_km_flags_t); |
111 | extern void *kmem_zone_zalloc(kmem_zone_t *, unsigned int __nocast); | 112 | extern 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); | |||
555 | extern kmem_zone_t *xfs_log_ticket_zone; | 555 | extern kmem_zone_t *xfs_log_ticket_zone; |
556 | struct xlog_ticket *xlog_ticket_alloc(struct log *log, int unit_bytes, | 556 | struct 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 | ||
561 | static inline void | 561 | static 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 | */ |
445 | xfs_trans_t *xfs_trans_alloc(struct xfs_mount *, uint); | 445 | xfs_trans_t *xfs_trans_alloc(struct xfs_mount *, uint); |
446 | xfs_trans_t *_xfs_trans_alloc(struct xfs_mount *, uint, uint); | 446 | xfs_trans_t *_xfs_trans_alloc(struct xfs_mount *, uint, xfs_km_flags_t); |
447 | xfs_trans_t *xfs_trans_dup(xfs_trans_t *); | 447 | xfs_trans_t *xfs_trans_dup(xfs_trans_t *); |
448 | int xfs_trans_reserve(xfs_trans_t *, uint, uint, uint, | 448 | int xfs_trans_reserve(xfs_trans_t *, uint, uint, uint, |
449 | uint, uint); | 449 | uint, uint); |