diff options
author | Jiro SEKIBA <jir@unicus.jp> | 2009-07-22 16:26:34 (GMT) |
---|---|---|
committer | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2009-09-14 09:27:14 (GMT) |
commit | 79efdd94111f30c373fce05e4e5822d8ff671c2a (patch) | |
tree | 9d12c0e87146fb4fb63362f567e574d629a222a1 /fs/nilfs2/super.c | |
parent | 6233caa9d5b153c2190d6c1c35c1dd1010104fc1 (diff) | |
download | linux-fsl-qoriq-79efdd94111f30c373fce05e4e5822d8ff671c2a.tar.xz |
nilfs2: clean up nilfs_write_super
Separate conditions that check if syncing super block and alternative
super block are required as inline functions to reuse the conditions.
Signed-off-by: Jiro SEKIBA <jir@unicus.jp>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Diffstat (limited to 'fs/nilfs2/super.c')
-rw-r--r-- | fs/nilfs2/super.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c index 9926a1d6..70e8613 100644 --- a/fs/nilfs2/super.c +++ b/fs/nilfs2/super.c @@ -367,17 +367,12 @@ static void nilfs_write_super(struct super_block *sb) down_write(&nilfs->ns_sem); if (!(sb->s_flags & MS_RDONLY)) { - struct nilfs_super_block **sbp = nilfs->ns_sbp; - u64 t = get_seconds(); - int dupsb; - - if (!nilfs_discontinued(nilfs) && t >= nilfs->ns_sbwtime[0] && - t < nilfs->ns_sbwtime[0] + NILFS_SB_FREQ) { + if (!nilfs_discontinued(nilfs) && + !nilfs_sb_need_update(nilfs)) { up_write(&nilfs->ns_sem); return; } - dupsb = sbp[1] && t > nilfs->ns_sbwtime[1] + NILFS_ALTSB_FREQ; - nilfs_commit_super(sbi, dupsb); + nilfs_commit_super(sbi, nilfs_altsb_need_update(nilfs)); } sb->s_dirt = 0; up_write(&nilfs->ns_sem); |