diff options
author | Jiro SEKIBA <jir@unicus.jp> | 2009-07-22 12:33:49 -0400 |
---|---|---|
committer | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2009-09-14 05:27:14 -0400 |
commit | 1dfa27105a6cf4171c439fd40a004a0a17838115 (patch) | |
tree | 7d348398a9e623324ca86eafd050b8c12abf3cea /fs/nilfs2/segment.c | |
parent | 79efdd94111f30c373fce05e4e5822d8ff671c2a (diff) |
nilfs2: stop using periodic write_super callback
This removes nilfs_write_super and commit super block in nilfs
internal thread, instead of periodic write_super callback.
VFS layer calls ->write_super callback periodically. However,
it looks like that calling back is ommited when disk I/O is busy.
And when cleanerd (nilfs GC) is runnig, disk I/O tend to be busy thus
nilfs superblock is not synchronized as nilfs designed.
To avoid it, syncing superblock by nilfs thread instead of pdflush.
Signed-off-by: Jiro SEKIBA <jir@unicus.jp>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Diffstat (limited to 'fs/nilfs2/segment.c')
-rw-r--r-- | fs/nilfs2/segment.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c index 51ff3d0a4ee2..683df89dbae5 100644 --- a/fs/nilfs2/segment.c +++ b/fs/nilfs2/segment.c | |||
@@ -2501,7 +2501,8 @@ static int nilfs_segctor_construct(struct nilfs_sc_info *sci, | |||
2501 | if (test_bit(NILFS_SC_SUPER_ROOT, &sci->sc_flags) && | 2501 | if (test_bit(NILFS_SC_SUPER_ROOT, &sci->sc_flags) && |
2502 | nilfs_discontinued(nilfs)) { | 2502 | nilfs_discontinued(nilfs)) { |
2503 | down_write(&nilfs->ns_sem); | 2503 | down_write(&nilfs->ns_sem); |
2504 | req->sb_err = nilfs_commit_super(sbi, 0); | 2504 | req->sb_err = nilfs_commit_super(sbi, |
2505 | nilfs_altsb_need_update(nilfs)); | ||
2505 | up_write(&nilfs->ns_sem); | 2506 | up_write(&nilfs->ns_sem); |
2506 | } | 2507 | } |
2507 | } | 2508 | } |
@@ -2689,6 +2690,7 @@ static int nilfs_segctor_thread(void *arg) | |||
2689 | } else { | 2690 | } else { |
2690 | DEFINE_WAIT(wait); | 2691 | DEFINE_WAIT(wait); |
2691 | int should_sleep = 1; | 2692 | int should_sleep = 1; |
2693 | struct the_nilfs *nilfs; | ||
2692 | 2694 | ||
2693 | prepare_to_wait(&sci->sc_wait_daemon, &wait, | 2695 | prepare_to_wait(&sci->sc_wait_daemon, &wait, |
2694 | TASK_INTERRUPTIBLE); | 2696 | TASK_INTERRUPTIBLE); |
@@ -2709,6 +2711,9 @@ static int nilfs_segctor_thread(void *arg) | |||
2709 | finish_wait(&sci->sc_wait_daemon, &wait); | 2711 | finish_wait(&sci->sc_wait_daemon, &wait); |
2710 | timeout = ((sci->sc_state & NILFS_SEGCTOR_COMMIT) && | 2712 | timeout = ((sci->sc_state & NILFS_SEGCTOR_COMMIT) && |
2711 | time_after_eq(jiffies, sci->sc_timer->expires)); | 2713 | time_after_eq(jiffies, sci->sc_timer->expires)); |
2714 | nilfs = sci->sc_sbi->s_nilfs; | ||
2715 | if (sci->sc_super->s_dirt && nilfs_sb_need_update(nilfs)) | ||
2716 | set_nilfs_discontinued(nilfs); | ||
2712 | } | 2717 | } |
2713 | goto loop; | 2718 | goto loop; |
2714 | 2719 | ||