Skip to contentSkip to conversation

nbd: replace schedule_timeout() with

PATCH New Nishanth Aravamudan 1 participant 2 messages Jul 19, 2004 – Jul 21, 2004

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nbd: replace schedule_timeout() with

I would appreciate any comments from the janitors list.

Applys-to: 2.6.7

Description: Uses msleep() instead of schedule_timeout() to guarantee the task delays at least the desired time amount.

drivers/block/nbd.c +1 -2
@@ -139,8 +139,7 @@ static void nbd_end_request(struct reque
 		spin_unlock(&lo->queue_lock);
 		printk(KERN_DEBUG "%s: request %p still in use (%d), waiting\n",
 		    lo->disk->disk_name, req, req->ref_count);
-		set_current_state(TASK_UNINTERRUPTIBLE);
-		schedule_timeout(HZ); /* wait a second */
+		msleep(1000);
 		spin_lock(&lo->queue_lock);
 	}
 	spin_unlock(&lo->queue_lock);

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors

#1 lore raw

PATCH 1/1 nbd: replace schedule_timeout() with

Please find below the corrected patch, as the previous one would not compile. Thanks.

I would appreciate any comments from the janitors list.

Applys-to: 2.6.7

Description: Uses msleep() instead of schedule_timeout() to guarantee the task delays at least the desired time amount.

drivers/block/nbd.c +2 -2
@@ -54,6 +54,7 @@
 #include <linux/errno.h>
 #include <linux/file.h>
 #include <linux/ioctl.h>
+#include <linux/delay.h>
 #include <net/sock.h>
 
 #include <linux/devfs_fs_kernel.h>
@@ -139,8 +140,7 @@ static void nbd_end_request(struct reque
 		spin_unlock(&lo->queue_lock);
 		printk(KERN_DEBUG "%s: request %p still in use (%d), waiting\n",
 		    lo->disk->disk_name, req, req->ref_count);
-		set_current_state(TASK_UNINTERRUPTIBLE);
-		schedule_timeout(HZ); /* wait a second */
+		msleep(1000);
 		spin_lock(&lo->queue_lock);
 	}
 	spin_unlock(&lo->queue_lock);

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors