aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/core.h
diff options
context:
space:
mode:
Diffstat (limited to 'net/tipc/core.h')
-rw-r--r--net/tipc/core.h23
1 files changed, 20 insertions, 3 deletions
diff --git a/net/tipc/core.h b/net/tipc/core.h
index feabca580820..325404fd4eb5 100644
--- a/net/tipc/core.h
+++ b/net/tipc/core.h
@@ -180,6 +180,12 @@ extern int tipc_core_start(void);
180extern void tipc_core_stop(void); 180extern void tipc_core_stop(void);
181extern int tipc_core_start_net(void); 181extern int tipc_core_start_net(void);
182extern void tipc_core_stop_net(void); 182extern void tipc_core_stop_net(void);
183extern int tipc_handler_start(void);
184extern void tipc_handler_stop(void);
185extern int tipc_netlink_start(void);
186extern void tipc_netlink_stop(void);
187extern int tipc_socket_init(void);
188extern void tipc_socket_stop(void);
183 189
184static inline int delimit(int val, int min, int max) 190static inline int delimit(int val, int min, int max)
185{ 191{
@@ -310,7 +316,7 @@ static inline struct sk_buff *buf_acquire(u32 size)
310 struct sk_buff *skb; 316 struct sk_buff *skb;
311 unsigned int buf_size = (BUF_HEADROOM + size + 3) & ~3u; 317 unsigned int buf_size = (BUF_HEADROOM + size + 3) & ~3u;
312 318
313 skb = alloc_skb(buf_size, GFP_ATOMIC); 319 skb = alloc_skb_fclone(buf_size, GFP_ATOMIC);
314 if (skb) { 320 if (skb) {
315 skb_reserve(skb, BUF_HEADROOM); 321 skb_reserve(skb, BUF_HEADROOM);
316 skb_put(skb, size); 322 skb_put(skb, size);
@@ -328,8 +334,19 @@ static inline struct sk_buff *buf_acquire(u32 size)
328 334
329static inline void buf_discard(struct sk_buff *skb) 335static inline void buf_discard(struct sk_buff *skb)
330{ 336{
331 if (likely(skb != NULL)) 337 kfree_skb(skb);
332 kfree_skb(skb); 338}
339
340/**
341 * buf_linearize - convert a TIPC message buffer into a single contiguous piece
342 * @skb: message buffer
343 *
344 * Returns 0 on success.
345 */
346
347static inline int buf_linearize(struct sk_buff *skb)
348{
349 return skb_linearize(skb);
333} 350}
334 351
335#endif 352#endif