xfs-masters
[Top] [All Lists]

[xfs-masters] [patch 2/2] fs/xfs_super: replace schedule_timeout() with

To: xfs-masters@xxxxxxxxxxx
Subject: [xfs-masters] [patch 2/2] fs/xfs_super: replace schedule_timeout() with msleep_interruptible()
From: domen@xxxxxxxxxxxx
Date: Sun, 06 Mar 2005 11:40:00 +0100
Cc: nathans@xxxxxxx, linux-xfs@xxxxxxxxxxx, domen@xxxxxxxxxxxx, nacc@xxxxxxxxxx
Reply-to: xfs-masters@xxxxxxxxxxx
Sender: xfs-masters-bounce@xxxxxxxxxxx


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.

Signed-off-by: Nishanth Aravamudan <nacc@xxxxxxxxxx>
Signed-off-by: Domen Puncer <domen@xxxxxxxxxxxx>
---


 kj-domen/fs/xfs/linux-2.6/xfs_super.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff -puN 
fs/xfs/linux-2.6/xfs_super.c~msleep_interruptible-fs_xfs_linux-2.6_xfs_super 
fs/xfs/linux-2.6/xfs_super.c
--- 
kj/fs/xfs/linux-2.6/xfs_super.c~msleep_interruptible-fs_xfs_linux-2.6_xfs_super 
    2005-03-05 16:11:05.000000000 +0100
+++ kj-domen/fs/xfs/linux-2.6/xfs_super.c       2005-03-05 16:11:05.000000000 
+0100
@@ -72,6 +72,7 @@
 #include <linux/init.h>
 #include <linux/mount.h>
 #include <linux/writeback.h>
+#include <linux/delay.h>
 
 STATIC struct quotactl_ops linvfs_qops;
 STATIC struct super_operations linvfs_sops;
@@ -488,10 +489,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 */
                try_to_freeze(PF_FREEZE);
                if (vfsp->vfs_flag & VFS_UMOUNT)
@@ -505,7 +505,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);
_


<Prev in Thread] Current Thread [Next in Thread>
  • [xfs-masters] [patch 2/2] fs/xfs_super: replace schedule_timeout() with msleep_interruptible(), domen <=