Search Linux Wireless

[PATCH] compat: backport vzalloc()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



vzalloc() is used in rtl8192ce now.

Signed-off-by: Hauke Mehrtens <hauke@xxxxxxxxxx>
---
 compat/compat-2.6.37.c        |   19 +++++++++++++++++++
 include/linux/compat-2.6.37.h |    2 ++
 2 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/compat/compat-2.6.37.c b/compat/compat-2.6.37.c
index 8636c65..c49efea 100644
--- a/compat/compat-2.6.37.c
+++ b/compat/compat-2.6.37.c
@@ -334,4 +334,23 @@ void compat_led_classdev_unregister(struct led_classdev *led_cdev)
 }
 EXPORT_SYMBOL(compat_led_classdev_unregister);
 
+/**
+ *	vzalloc - allocate virtually contiguous memory with zero fill
+ *	@size:	allocation size
+ *	Allocate enough pages to cover @size from the page level
+ *	allocator and map them into contiguous kernel virtual space.
+ *	The memory allocated is set to zero.
+ *
+ *	For tight control over page level allocator and protection flags
+ *	use __vmalloc() instead.
+ */
+void *vzalloc(unsigned long size)
+{
+	void *buf;
+	buf = vmalloc(size);
+	memset(buf, 0, size);
+	return buf;
+}
+EXPORT_SYMBOL(vzalloc);
+
 #endif
diff --git a/include/linux/compat-2.6.37.h b/include/linux/compat-2.6.37.h
index cee23a8..57868f5 100644
--- a/include/linux/compat-2.6.37.h
+++ b/include/linux/compat-2.6.37.h
@@ -110,6 +110,8 @@ extern void compat_led_brightness_set(struct led_classdev *led_cdev,
 
 #define netdev_refcnt_read(a) atomic_read(&a->refcnt)
 
+extern void *vzalloc(unsigned long size);
+
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)) */
 
 #endif /* LINUX_26_37_COMPAT_H */
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux