Skip to contentSkip to conversation

fs/xfs_super: replace schedule_timeout() with

PATCH In review Nishanth Aravamudan 1 participant 1 message Jan 20, 2005

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

PATCH 12/40 fs/xfs_super: replace schedule_timeout() with

Hi,

Please consider applying.

Description: Use msleep_interruptible() instead of schedule_timeout(). The current code is not wrong; however a change to msleep_interruptible() has two major benefits: 1) consistency across the kernel and 2) uses human-sensible time units (msecs). Change the units of timeleft appropriately to msecs.

fs/xfs/linux-2.6/xfs_super.c +4 -4
@@ -73,6 +73,7 @@
 #include <linux/mount.h>
 #include <linux/suspend.h>
 #include <linux/writeback.h>
+#include <linux/delay.h>
 
 STATIC struct quotactl_ops linvfs_qops;
 STATIC struct super_operations linvfs_sops;
@@ -484,10 +485,9 @@ xfssyncd(
 	wake_up(&vfsp->vfs_wait_sync_task);
 
 	INIT_LIST_HEAD(&tmp);
-	timeleft = (xfs_syncd_centisecs * HZ) / 100;
+	timeleft = xfs_syncd_centisecs * 10;
 	for (;;) {
-		set_current_state(TASK_INTERRUPTIBLE);
-		timeleft = schedule_timeout(timeleft);
+		timeleft = msleep_interruptible(timeleft);
 		/* swsusp */
 		if (current->flags & PF_FREEZE)
 			refrigerator(PF_FREEZE);
@@ -502,7 +502,7 @@ xfssyncd(
 		 */
 		if (!timeleft || list_empty(&vfsp->vfs_sync_list)) {
 			if (!timeleft)
-				timeleft = (xfs_syncd_centisecs * HZ) / 100;
+				timeleft = xfs_syncd_centisecs * 10;
 			INIT_LIST_HEAD(&vfsp->vfs_sync_work.w_list);
 			list_add_tail(&vfsp->vfs_sync_work.w_list,
 					&vfsp->vfs_sync_list);

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