diff options
Diffstat (limited to 'net/tipc/core.h')
| -rw-r--r-- | net/tipc/core.h | 28 |
1 files changed, 5 insertions, 23 deletions
diff --git a/net/tipc/core.h b/net/tipc/core.h index a881f92a8537..188799017abd 100644 --- a/net/tipc/core.h +++ b/net/tipc/core.h | |||
| @@ -56,8 +56,12 @@ | |||
| 56 | #include <linux/netdevice.h> | 56 | #include <linux/netdevice.h> |
| 57 | #include <linux/in.h> | 57 | #include <linux/in.h> |
| 58 | #include <linux/list.h> | 58 | #include <linux/list.h> |
| 59 | #include <linux/slab.h> | ||
| 59 | #include <linux/vmalloc.h> | 60 | #include <linux/vmalloc.h> |
| 60 | 61 | ||
| 62 | |||
| 63 | #define TIPC_MOD_VER "2.0.0" | ||
| 64 | |||
| 61 | /* | 65 | /* |
| 62 | * TIPC sanity test macros | 66 | * TIPC sanity test macros |
| 63 | */ | 67 | */ |
| @@ -324,29 +328,7 @@ static inline struct tipc_msg *buf_msg(struct sk_buff *skb) | |||
| 324 | return (struct tipc_msg *)skb->data; | 328 | return (struct tipc_msg *)skb->data; |
| 325 | } | 329 | } |
| 326 | 330 | ||
| 327 | /** | 331 | extern struct sk_buff *buf_acquire(u32 size); |
| 328 | * buf_acquire - creates a TIPC message buffer | ||
| 329 | * @size: message size (including TIPC header) | ||
| 330 | * | ||
| 331 | * Returns a new buffer with data pointers set to the specified size. | ||
| 332 | * | ||
| 333 | * NOTE: Headroom is reserved to allow prepending of a data link header. | ||
| 334 | * There may also be unrequested tailroom present at the buffer's end. | ||
| 335 | */ | ||
| 336 | |||
| 337 | static inline struct sk_buff *buf_acquire(u32 size) | ||
| 338 | { | ||
| 339 | struct sk_buff *skb; | ||
| 340 | unsigned int buf_size = (BUF_HEADROOM + size + 3) & ~3u; | ||
| 341 | |||
| 342 | skb = alloc_skb_fclone(buf_size, GFP_ATOMIC); | ||
| 343 | if (skb) { | ||
| 344 | skb_reserve(skb, BUF_HEADROOM); | ||
| 345 | skb_put(skb, size); | ||
| 346 | skb->next = NULL; | ||
| 347 | } | ||
| 348 | return skb; | ||
| 349 | } | ||
| 350 | 332 | ||
| 351 | /** | 333 | /** |
| 352 | * buf_discard - frees a TIPC message buffer | 334 | * buf_discard - frees a TIPC message buffer |
