patch-2.4.9 linux/include/linux/raid/md_k.h

Next file: linux/include/linux/raid/raid1.h
Previous file: linux/include/linux/raid/md.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.8/linux/include/linux/raid/md_k.h linux/include/linux/raid/md_k.h
@@ -323,7 +323,7 @@
 	void			*data;
 	md_wait_queue_head_t	wqueue;
 	unsigned long           flags;
-	struct semaphore	*sem;
+	struct completion	*event;
 	struct task_struct	*tsk;
 	const char		*name;
 } mdk_thread_t;
@@ -364,6 +364,31 @@
 	if (condition)	 						\
 		break;							\
 	__wait_event_lock_irq(wq, condition, lock);			\
+} while (0)
+
+
+#define __wait_disk_event(wq, condition) 				\
+do {									\
+	wait_queue_t __wait;						\
+	init_waitqueue_entry(&__wait, current);				\
+									\
+	add_wait_queue(&wq, &__wait);					\
+	for (;;) {							\
+		set_current_state(TASK_UNINTERRUPTIBLE);		\
+		if (condition)						\
+			break;						\
+		run_task_queue(&tq_disk);				\
+		schedule();						\
+	}								\
+	current->state = TASK_RUNNING;					\
+	remove_wait_queue(&wq, &__wait);				\
+} while (0)
+
+#define wait_disk_event(wq, condition) 					\
+do {									\
+	if (condition)	 						\
+		break;							\
+	__wait_disk_event(wq, condition);				\
 } while (0)
 
 #endif 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)