[DRBD-cvs] drbd by phil; Changed the way DEFINE_WAIT for linux-2....

drbd-user@lists.linbit.com drbd-user@lists.linbit.com
Wed, 30 Jun 2004 10:34:55 +0200 (CEST)


DRBD CVS committal

Author  : phil
Module  : drbd

Dir     : drbd/drbd


Modified Files:
      Tag: rel-0_7-branch
	drbd_compat_types.h drbd_receiver.c 


Log Message:
Changed the way DEFINE_WAIT for linux-2.4.x is defined. Now it seems
to work on linux-2.4.x again.

===================================================================
RCS file: /var/lib/cvs/drbd/drbd/drbd/Attic/drbd_compat_types.h,v
retrieving revision 1.1.2.6
retrieving revision 1.1.2.7
diff -u -3 -r1.1.2.6 -r1.1.2.7
--- drbd_compat_types.h	25 Jun 2004 09:44:20 -0000	1.1.2.6
+++ drbd_compat_types.h	30 Jun 2004 08:34:50 -0000	1.1.2.7
@@ -42,7 +42,7 @@
 #include <linux/completion.h>
 #endif
 
-#if defined(CONFIG_X86)
+#if defined(__i386__) || defined(__arch_um__)
 /**
  * find_first_bit - find the first set bit in a memory region
  * @addr: The address to start the search at
@@ -106,7 +106,7 @@
 }
 
 #else
-#warn You probabely need to copy find_next_bit() from a 2.6.x kernel.
+#warning "You probabely need to copy find_next_bit() from a 2.6.x kernel."
 #endif
 
 #ifndef ALIGN
@@ -118,7 +118,6 @@
 #endif
 
 #else // LINUX 2.6
-//#warning "FIXME"
 
 typedef struct bio drbd_bio_t;
 
===================================================================
RCS file: /var/lib/cvs/drbd/drbd/drbd/drbd_receiver.c,v
retrieving revision 1.97.2.175
retrieving revision 1.97.2.176
diff -u -3 -r1.97.2.175 -r1.97.2.176
--- drbd_receiver.c	26 Jun 2004 08:05:40 -0000	1.97.2.175
+++ drbd_receiver.c	30 Jun 2004 08:34:50 -0000	1.97.2.176
@@ -267,7 +267,13 @@
 	spin_unlock_irqrestore(&q->lock, flags);
 }
 
-#define DEFINE_WAIT(name)	DECLARE_WAITQUEUE(name,current)
+#define DEFINE_WAIT(name)						\
+	wait_queue_t name = {						\
+		.task		= current,				\
+		.task_list	= {	.next = &name.task_list,	\
+					.prev = &name.task_list,	\
+				},					\
+	}
 
 #endif