PATCH - md 7 of 22 - Use wait_event_interuptible in md_thread

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 






It currently has several lines of code where one will do.



 ----------- Diffstat output ------------
 ./drivers/md/md.c |   13 +++----------
 1 files changed, 3 insertions(+), 10 deletions(-)

--- ./drivers/md/md.c	2002/06/18 03:34:17	1.6
+++ ./drivers/md/md.c	2002/06/18 03:37:06	1.7
@@ -2929,17 +2929,10 @@
 	complete(thread->event);
 	while (thread->run) {
 		void (*run)(void *data);
-		DECLARE_WAITQUEUE(wait, current);
 
-		add_wait_queue(&thread->wqueue, &wait);
-		set_task_state(current, TASK_INTERRUPTIBLE);
-		if (!test_bit(THREAD_WAKEUP, &thread->flags)) {
-			dprintk("md: thread %p went to sleep.\n", thread);
-			schedule();
-			dprintk("md: thread %p woke up.\n", thread);
-		}
-		current->state = TASK_RUNNING;
-		remove_wait_queue(&thread->wqueue, &wait);
+		wait_event_interruptible(thread->wqueue,
+					 test_bit(THREAD_WAKEUP, &thread->flags));
+
 		clear_bit(THREAD_WAKEUP, &thread->flags);
 
 		run = thread->run;
-
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux