[DRBD-cvs] svn commit by lars - r2983 - branches/drbd-8.0-for-linus/drbd - a97d57e6fadb7027f8b1ebbb266078c73db58046 if( => if (

drbd-cvs at lists.linbit.com drbd-cvs at lists.linbit.com
Tue Jul 24 10:47:37 CEST 2007


Author: lars
Date: 2007-07-24 10:47:36 +0200 (Tue, 24 Jul 2007)
New Revision: 2983

Modified:
   branches/drbd-8.0-for-linus/drbd/drbd_int.h
   branches/drbd-8.0-for-linus/drbd/drbd_main.c
   branches/drbd-8.0-for-linus/drbd/drbd_wrappers.h
Log:
a97d57e6fadb7027f8b1ebbb266078c73db58046 if( => if (



Modified: branches/drbd-8.0-for-linus/drbd/drbd_int.h
===================================================================
--- branches/drbd-8.0-for-linus/drbd/drbd_int.h	2007-07-23 17:54:18 UTC (rev 2982)
+++ branches/drbd-8.0-for-linus/drbd/drbd_int.h	2007-07-24 08:47:36 UTC (rev 2983)
@@ -1165,8 +1165,8 @@
 #include "drbd_wrappers.h"
 
 extern int minor_count;
-extern drbd_kmem_cache_t *drbd_request_cache;
-extern drbd_kmem_cache_t *drbd_ee_cache;
+extern struct kmem_cache *drbd_request_cache;
+extern struct kmem_cache *drbd_ee_cache;
 extern mempool_t *drbd_request_mempool;
 extern mempool_t *drbd_ee_mempool;
 

Modified: branches/drbd-8.0-for-linus/drbd/drbd_main.c
===================================================================
--- branches/drbd-8.0-for-linus/drbd/drbd_main.c	2007-07-23 17:54:18 UTC (rev 2982)
+++ branches/drbd-8.0-for-linus/drbd/drbd_main.c	2007-07-24 08:47:36 UTC (rev 2983)
@@ -78,7 +78,7 @@
 MODULE_DESCRIPTION("drbd - Distributed Replicated Block Device v" REL_VERSION);
 MODULE_LICENSE("GPL");
 MODULE_PARM_DESC(minor_count, "Maximum number of drbd devices (1-255)");
-MODULE_ALIAS_BLOCKDEV_MAJOR(LANANA_DRBD_MAJOR);
+MODULE_ALIAS_BLOCKDEV_MAJOR(DRBD_MAJOR);
 
 #include <linux/moduleparam.h>
 /* allow_open_on_secondary */
@@ -129,8 +129,8 @@
  */
 struct Drbd_Conf **minor_table = NULL;
 
-drbd_kmem_cache_t *drbd_request_cache;
-drbd_kmem_cache_t *drbd_ee_cache;
+struct kmem_cache *drbd_request_cache;
+struct kmem_cache *drbd_ee_cache;
 mempool_t *drbd_request_mempool;
 mempool_t *drbd_ee_mempool;
 
@@ -2151,15 +2151,15 @@
 	drbd_pp_pool         = NULL;
 
 	// caches
-	drbd_request_cache = kmem_cache_create(
+	drbd_request_cache = drbd_kmem_cache_create(
 		"drbd_req_cache", sizeof(drbd_request_t),
-		0, 0, NULL, NULL);
+		0, 0, NULL);
 	if (drbd_request_cache == NULL)
 		goto Enomem;
 
-	drbd_ee_cache = kmem_cache_create(
+	drbd_ee_cache = drbd_kmem_cache_create(
 		"drbd_ee_cache", sizeof(struct Tl_epoch_entry),
-		0, 0, NULL, NULL);
+		0, 0, NULL);
 	if (drbd_ee_cache == NULL)
 		goto Enomem;
 

Modified: branches/drbd-8.0-for-linus/drbd/drbd_wrappers.h
===================================================================
--- branches/drbd-8.0-for-linus/drbd/drbd_wrappers.h	2007-07-23 17:54:18 UTC (rev 2982)
+++ branches/drbd-8.0-for-linus/drbd/drbd_wrappers.h	2007-07-24 08:47:36 UTC (rev 2983)
@@ -163,11 +163,23 @@
 #endif
 
 #ifdef USE_KMEM_CACHE_S
-typedef struct kmem_cache_s drbd_kmem_cache_t;
-#else
-typedef struct kmem_cache drbd_kmem_cache_t;
+#define kmem_cache kmem_cache_s
 #endif
 
+/* dtor was removed in 20c2df83d25c6a95affe6157a4c9cac4cf5ffaac
+ * on the way to 2.6.23 */
+static inline struct kmem_cache *
+drbd_kmem_cache_create (const char *name, size_t size, size_t align,
+        unsigned long flags,
+        void (*ctor)(void*, struct kmem_cache *, unsigned long))
+{
+	return kmem_cache_create(name, size, align, flags, ctor
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
+		, NULL
+#endif
+		);
+}
+
 #ifdef NEED_BACKPORT_OF_ATOMIC_ADD
 
 #if defined(__x86_64__)



More information about the drbd-cvs mailing list