patch-2.4.2 linux/include/linux/skbuff.h

Next file: linux/include/linux/smb.h
Previous file: linux/include/linux/serial.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.1/linux/include/linux/skbuff.h linux/include/linux/skbuff.h
@@ -153,7 +153,7 @@
 /*
  *	Handling routines are only of interest to the kernel
  */
-#include <linux/malloc.h>
+#include <linux/slab.h>
 
 #include <asm/system.h>
 
@@ -878,26 +878,45 @@
 }
 
 /**
- *	dev_alloc_skb - allocate an skbuff for sending
+ *	__dev_alloc_skb - allocate an skbuff for sending
  *	@length: length to allocate
+ *	@gfp_mask: get_free_pages mask, passed to alloc_skb
  *
  *	Allocate a new &sk_buff and assign it a usage count of one. The
  *	buffer has unspecified headroom built in. Users should allocate
  *	the headroom they think they need without accounting for the
  *	built in space. The built in space is used for optimisations.
  *
- *	%NULL is returned in there is no free memory. Although this function
- *	allocates memory it can be called from an interrupt.
+ *	%NULL is returned in there is no free memory.
  */
  
-static inline struct sk_buff *dev_alloc_skb(unsigned int length)
+static inline struct sk_buff *__dev_alloc_skb(unsigned int length,
+					      int gfp_mask)
 {
 	struct sk_buff *skb;
 
-	skb = alloc_skb(length+16, GFP_ATOMIC);
+	skb = alloc_skb(length+16, gfp_mask);
 	if (skb)
 		skb_reserve(skb,16);
 	return skb;
+}
+
+/**
+ *	dev_alloc_skb - allocate an skbuff for sending
+ *	@length: length to allocate
+ *
+ *	Allocate a new &sk_buff and assign it a usage count of one. The
+ *	buffer has unspecified headroom built in. Users should allocate
+ *	the headroom they think they need without accounting for the
+ *	built in space. The built in space is used for optimisations.
+ *
+ *	%NULL is returned in there is no free memory. Although this function
+ *	allocates memory it can be called from an interrupt.
+ */
+ 
+static inline struct sk_buff *dev_alloc_skb(unsigned int length)
+{
+	return __dev_alloc_skb(length, GFP_ATOMIC);
 }
 
 /**

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)