diff options
author | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2009-04-06 22:01:59 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-07 11:31:20 -0400 |
commit | e339ad31f59925b48a92ee3947692fdf9758b8c7 (patch) | |
tree | 6bb85c43bfd100b0a220c788c654f2f74ca553e4 /fs/nilfs2/segment.c | |
parent | cece552074c591970353ad48308d65f110aeaf28 (diff) |
nilfs2: introduce secondary super block
The former versions didn't have extra super blocks. This improves the
weak point by introducing another super block at unused region in tail of
the partition.
This doesn't break disk format compatibility; older versions just ingore
the secondary super block, and new versions just recover it if it doesn't
exist. The partition created by an old mkfs may not have unused region,
but in that case, the secondary super block will not be added.
This doesn't make more redundant copies of the super block; it is a future
work.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/nilfs2/segment.c')
-rw-r--r-- | fs/nilfs2/segment.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c index e43558d50e78..fb70ec3be20e 100644 --- a/fs/nilfs2/segment.c +++ b/fs/nilfs2/segment.c | |||
@@ -2068,7 +2068,8 @@ static void nilfs_segctor_complete_write(struct nilfs_sc_info *sci) | |||
2068 | 2068 | ||
2069 | if (update_sr) { | 2069 | if (update_sr) { |
2070 | nilfs_set_last_segment(nilfs, segbuf->sb_pseg_start, | 2070 | nilfs_set_last_segment(nilfs, segbuf->sb_pseg_start, |
2071 | segbuf->sb_sum.seg_seq, nilfs->ns_cno); | 2071 | segbuf->sb_sum.seg_seq, nilfs->ns_cno++); |
2072 | sbi->s_super->s_dirt = 1; | ||
2072 | 2073 | ||
2073 | clear_bit(NILFS_SC_HAVE_DELTA, &sci->sc_flags); | 2074 | clear_bit(NILFS_SC_HAVE_DELTA, &sci->sc_flags); |
2074 | clear_bit(NILFS_SC_DIRTY, &sci->sc_flags); | 2075 | clear_bit(NILFS_SC_DIRTY, &sci->sc_flags); |
@@ -2224,9 +2225,6 @@ static int nilfs_segctor_do_construct(struct nilfs_sc_info *sci, int mode) | |||
2224 | 2225 | ||
2225 | /* Commit segments */ | 2226 | /* Commit segments */ |
2226 | if (has_sr) { | 2227 | if (has_sr) { |
2227 | down_write(&nilfs->ns_sem); | ||
2228 | nilfs_update_last_segment(sbi, 1); | ||
2229 | up_write(&nilfs->ns_sem); | ||
2230 | nilfs_segctor_commit_free_segments(sci); | 2228 | nilfs_segctor_commit_free_segments(sci); |
2231 | nilfs_segctor_clear_metadata_dirty(sci); | 2229 | nilfs_segctor_clear_metadata_dirty(sci); |
2232 | } | 2230 | } |
@@ -2564,7 +2562,7 @@ static int nilfs_segctor_construct(struct nilfs_sc_info *sci, | |||
2564 | if (test_bit(NILFS_SC_SUPER_ROOT, &sci->sc_flags) && | 2562 | if (test_bit(NILFS_SC_SUPER_ROOT, &sci->sc_flags) && |
2565 | nilfs_discontinued(nilfs)) { | 2563 | nilfs_discontinued(nilfs)) { |
2566 | down_write(&nilfs->ns_sem); | 2564 | down_write(&nilfs->ns_sem); |
2567 | req->sb_err = nilfs_commit_super(sbi); | 2565 | req->sb_err = nilfs_commit_super(sbi, 0); |
2568 | up_write(&nilfs->ns_sem); | 2566 | up_write(&nilfs->ns_sem); |
2569 | } | 2567 | } |
2570 | } | 2568 | } |