diff options
author | Nishanth Aravamudan <nacc@us.ibm.com> | 2005-09-10 03:27:23 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-10 13:06:36 -0400 |
commit | 041e0e3b1970c508dc9a95b7dd9dc86271a7d7ac (patch) | |
tree | 41ff880a87412cf55eb12425e916fda57955ee5c /fs/xfs/linux-2.6/xfs_super.c | |
parent | 373016e9e1353f2af871993d27d00768f08cc883 (diff) |
[PATCH] fs: fix-up schedule_timeout() usage
Use schedule_timeout_{,un}interruptible() instead of
set_current_state()/schedule_timeout() to reduce kernel size. Also use helper
functions to convert between human time units and jiffies rather than constant
HZ division to avoid rounding errors.
Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_super.c')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_super.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c index 0da87bfc9999..2302454d8d47 100644 --- a/fs/xfs/linux-2.6/xfs_super.c +++ b/fs/xfs/linux-2.6/xfs_super.c | |||
@@ -467,7 +467,7 @@ xfs_flush_inode( | |||
467 | 467 | ||
468 | igrab(inode); | 468 | igrab(inode); |
469 | xfs_syncd_queue_work(vfs, inode, xfs_flush_inode_work); | 469 | xfs_syncd_queue_work(vfs, inode, xfs_flush_inode_work); |
470 | delay(HZ/2); | 470 | delay(msecs_to_jiffies(500)); |
471 | } | 471 | } |
472 | 472 | ||
473 | /* | 473 | /* |
@@ -492,7 +492,7 @@ xfs_flush_device( | |||
492 | 492 | ||
493 | igrab(inode); | 493 | igrab(inode); |
494 | xfs_syncd_queue_work(vfs, inode, xfs_flush_device_work); | 494 | xfs_syncd_queue_work(vfs, inode, xfs_flush_device_work); |
495 | delay(HZ/2); | 495 | delay(msecs_to_jiffies(500)); |
496 | xfs_log_force(ip->i_mount, (xfs_lsn_t)0, XFS_LOG_FORCE|XFS_LOG_SYNC); | 496 | xfs_log_force(ip->i_mount, (xfs_lsn_t)0, XFS_LOG_FORCE|XFS_LOG_SYNC); |
497 | } | 497 | } |
498 | 498 | ||
@@ -520,10 +520,9 @@ xfssyncd( | |||
520 | struct vfs_sync_work *work, *n; | 520 | struct vfs_sync_work *work, *n; |
521 | LIST_HEAD (tmp); | 521 | LIST_HEAD (tmp); |
522 | 522 | ||
523 | timeleft = (xfs_syncd_centisecs * HZ) / 100; | 523 | timeleft = xfs_syncd_centisecs * msecs_to_jiffies(10); |
524 | for (;;) { | 524 | for (;;) { |
525 | set_current_state(TASK_INTERRUPTIBLE); | 525 | timeleft = schedule_timeout_interruptible(timeleft); |
526 | timeleft = schedule_timeout(timeleft); | ||
527 | /* swsusp */ | 526 | /* swsusp */ |
528 | try_to_freeze(); | 527 | try_to_freeze(); |
529 | if (kthread_should_stop()) | 528 | if (kthread_should_stop()) |
@@ -537,7 +536,8 @@ xfssyncd( | |||
537 | */ | 536 | */ |
538 | if (!timeleft || list_empty(&vfsp->vfs_sync_list)) { | 537 | if (!timeleft || list_empty(&vfsp->vfs_sync_list)) { |
539 | if (!timeleft) | 538 | if (!timeleft) |
540 | timeleft = (xfs_syncd_centisecs * HZ) / 100; | 539 | timeleft = xfs_syncd_centisecs * |
540 | msecs_to_jiffies(10); | ||
541 | INIT_LIST_HEAD(&vfsp->vfs_sync_work.w_list); | 541 | INIT_LIST_HEAD(&vfsp->vfs_sync_work.w_list); |
542 | list_add_tail(&vfsp->vfs_sync_work.w_list, | 542 | list_add_tail(&vfsp->vfs_sync_work.w_list, |
543 | &vfsp->vfs_sync_list); | 543 | &vfsp->vfs_sync_list); |