From 305d186c7300dd7894db6a6749775d7ee31a019a Mon Sep 17 00:00:00 2001 From: Arnaud Lacombe Date: Mon, 23 Nov 2009 21:24:42 -0500 Subject: [PATCH] Add compatibility call for kmem_cache_destroy() On commit 133d205a, kmem_cache_destroy() was made returning void, while older kernel could return an error value. Signed-off-by: Arnaud Lacombe --- compat-2.6.19.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/compat-2.6.19.h b/compat-2.6.19.h index 7967390437e8..017044cf0031 100644 --- a/compat-2.6.19.h +++ b/compat-2.6.19.h @@ -7,6 +7,19 @@ /* Compat work for 2.6.19 */ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)) +#include + +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 */ -- 2.30.2