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