aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/skbuff.h
diff options
context:
space:
mode:
authorAl Viro <viro@ftp.linux.org.uk>2005-10-07 02:46:04 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-10-08 18:00:57 -0400
commitdd0fc66fb33cd610bc1a5db8a5e232d34879b4d7 (patch)
tree51f96a9db96293b352e358f66032e1f4ff79fafb /include/linux/skbuff.h
parent3b0e77bd144203a507eb191f7117d2c5004ea1de (diff)
[PATCH] gfp flags annotations - part 1
- added typedef unsigned int __nocast gfp_t; - replaced __nocast uses for gfp flags with gfp_t - it gives exactly the same warnings as far as sparse is concerned, doesn't change generated code (from gcc point of view we replaced unsigned int with typedef) and documents what's going on far better. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/skbuff.h')
-rw-r--r--include/linux/skbuff.h28
1 files changed, 14 insertions, 14 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 466c879f82b8..8f5d9e7f8734 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -302,37 +302,37 @@ struct sk_buff {
302 302
303extern void __kfree_skb(struct sk_buff *skb); 303extern void __kfree_skb(struct sk_buff *skb);
304extern struct sk_buff *__alloc_skb(unsigned int size, 304extern struct sk_buff *__alloc_skb(unsigned int size,
305 unsigned int __nocast priority, int fclone); 305 gfp_t priority, int fclone);
306static inline struct sk_buff *alloc_skb(unsigned int size, 306static inline struct sk_buff *alloc_skb(unsigned int size,
307 unsigned int __nocast priority) 307 gfp_t priority)
308{ 308{
309 return __alloc_skb(size, priority, 0); 309 return __alloc_skb(size, priority, 0);
310} 310}
311 311
312static inline struct sk_buff *alloc_skb_fclone(unsigned int size, 312static inline struct sk_buff *alloc_skb_fclone(unsigned int size,
313 unsigned int __nocast priority) 313 gfp_t priority)
314{ 314{
315 return __alloc_skb(size, priority, 1); 315 return __alloc_skb(size, priority, 1);
316} 316}
317 317
318extern struct sk_buff *alloc_skb_from_cache(kmem_cache_t *cp, 318extern struct sk_buff *alloc_skb_from_cache(kmem_cache_t *cp,
319 unsigned int size, 319 unsigned int size,
320 unsigned int __nocast priority); 320 gfp_t priority);
321extern void kfree_skbmem(struct sk_buff *skb); 321extern void kfree_skbmem(struct sk_buff *skb);
322extern struct sk_buff *skb_clone(struct sk_buff *skb, 322extern struct sk_buff *skb_clone(struct sk_buff *skb,
323 unsigned int __nocast priority); 323 gfp_t priority);
324extern struct sk_buff *skb_copy(const struct sk_buff *skb, 324extern struct sk_buff *skb_copy(const struct sk_buff *skb,
325 unsigned int __nocast priority); 325 gfp_t priority);
326extern struct sk_buff *pskb_copy(struct sk_buff *skb, 326extern struct sk_buff *pskb_copy(struct sk_buff *skb,
327 unsigned int __nocast gfp_mask); 327 gfp_t gfp_mask);
328extern int pskb_expand_head(struct sk_buff *skb, 328extern int pskb_expand_head(struct sk_buff *skb,
329 int nhead, int ntail, 329 int nhead, int ntail,
330 unsigned int __nocast gfp_mask); 330 gfp_t gfp_mask);
331extern struct sk_buff *skb_realloc_headroom(struct sk_buff *skb, 331extern struct sk_buff *skb_realloc_headroom(struct sk_buff *skb,
332 unsigned int headroom); 332 unsigned int headroom);
333extern struct sk_buff *skb_copy_expand(const struct sk_buff *skb, 333extern struct sk_buff *skb_copy_expand(const struct sk_buff *skb,
334 int newheadroom, int newtailroom, 334 int newheadroom, int newtailroom,
335 unsigned int __nocast priority); 335 gfp_t priority);
336extern struct sk_buff * skb_pad(struct sk_buff *skb, int pad); 336extern struct sk_buff * skb_pad(struct sk_buff *skb, int pad);
337#define dev_kfree_skb(a) kfree_skb(a) 337#define dev_kfree_skb(a) kfree_skb(a)
338extern void skb_over_panic(struct sk_buff *skb, int len, 338extern void skb_over_panic(struct sk_buff *skb, int len,
@@ -484,7 +484,7 @@ static inline int skb_shared(const struct sk_buff *skb)
484 * NULL is returned on a memory allocation failure. 484 * NULL is returned on a memory allocation failure.
485 */ 485 */
486static inline struct sk_buff *skb_share_check(struct sk_buff *skb, 486static inline struct sk_buff *skb_share_check(struct sk_buff *skb,
487 unsigned int __nocast pri) 487 gfp_t pri)
488{ 488{
489 might_sleep_if(pri & __GFP_WAIT); 489 might_sleep_if(pri & __GFP_WAIT);
490 if (skb_shared(skb)) { 490 if (skb_shared(skb)) {
@@ -516,7 +516,7 @@ static inline struct sk_buff *skb_share_check(struct sk_buff *skb,
516 * %NULL is returned on a memory allocation failure. 516 * %NULL is returned on a memory allocation failure.
517 */ 517 */
518static inline struct sk_buff *skb_unshare(struct sk_buff *skb, 518static inline struct sk_buff *skb_unshare(struct sk_buff *skb,
519 unsigned int __nocast pri) 519 gfp_t pri)
520{ 520{
521 might_sleep_if(pri & __GFP_WAIT); 521 might_sleep_if(pri & __GFP_WAIT);
522 if (skb_cloned(skb)) { 522 if (skb_cloned(skb)) {
@@ -1017,7 +1017,7 @@ static inline void __skb_queue_purge(struct sk_buff_head *list)
1017 * %NULL is returned in there is no free memory. 1017 * %NULL is returned in there is no free memory.
1018 */ 1018 */
1019static inline struct sk_buff *__dev_alloc_skb(unsigned int length, 1019static inline struct sk_buff *__dev_alloc_skb(unsigned int length,
1020 unsigned int __nocast gfp_mask) 1020 gfp_t gfp_mask)
1021{ 1021{
1022 struct sk_buff *skb = alloc_skb(length + 16, gfp_mask); 1022 struct sk_buff *skb = alloc_skb(length + 16, gfp_mask);
1023 if (likely(skb)) 1023 if (likely(skb))
@@ -1130,8 +1130,8 @@ static inline int skb_can_coalesce(struct sk_buff *skb, int i,
1130 * If there is no free memory -ENOMEM is returned, otherwise zero 1130 * If there is no free memory -ENOMEM is returned, otherwise zero
1131 * is returned and the old skb data released. 1131 * is returned and the old skb data released.
1132 */ 1132 */
1133extern int __skb_linearize(struct sk_buff *skb, unsigned int __nocast gfp); 1133extern int __skb_linearize(struct sk_buff *skb, gfp_t gfp);
1134static inline int skb_linearize(struct sk_buff *skb, unsigned int __nocast gfp) 1134static inline int skb_linearize(struct sk_buff *skb, gfp_t gfp)
1135{ 1135{
1136 return __skb_linearize(skb, gfp); 1136 return __skb_linearize(skb, gfp);
1137} 1137}