Add compatibility call for kmem_cache_destroy()
authorArnaud Lacombe <lacombar@gmail.com>
Tue, 24 Nov 2009 02:24:42 +0000 (21:24 -0500)
committerLuis R. Rodriguez <lrodriguez@atheros.com>
Tue, 1 Dec 2009 07:16:20 +0000 (23:16 -0800)
On commit 133d205a, kmem_cache_destroy() was made returning void, while
older
kernel could return an error value.

Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
compat-2.6.19.h

index 7967390437e85e240fc4035dc3e69f2bf604c9cb..017044cf0031cb1120fc6eb162cb2c5a69f9d138 100644 (file)
@@ -7,6 +7,19 @@
 /* Compat work for 2.6.19 */
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19))
 
+#include <linux/slab.h>
+
+static inline int
+compat_kmem_cache_destroy(struct kmem_cache *cachep)
+{
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19))
+       return kmem_cache_destroy(cachep);
+#else
+       kmem_cache_destroy(cachep);
+       return 0;
+#endif
+}
+
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)) */
 
 #endif /* LINUX_26_19_COMPAT_H */