aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nilfs2/recovery.c
diff options
context:
space:
mode:
authorRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>2009-04-06 22:01:58 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-04-07 11:31:20 -0400
commitcece552074c591970353ad48308d65f110aeaf28 (patch)
tree2dcca7913d38df89711504f5daeecccfedb5a3eb /fs/nilfs2/recovery.c
parentc96fa464a567a2a8796009af0e79bc68af73f485 (diff)
nilfs2: simplify handling of active state of segments
will reduce some lines of segment constructor. Previously, the state was complexly controlled through a list of segments in order to keep consistency in meta data of usage state of segments. Instead, this presents ``calculated'' active flags to userland cleaner program and stop maintaining its real flag on disk. Only by this fake flag, the cleaner cannot exactly know if each segment is reclaimable or not. However, the recent extension of nilfs_sustat ioctl struct (nilfs2-extend-nilfs_sustat-ioctl-struct.patch) can prevent the cleaner from reclaiming in-use segment wrongly. So, now I can apply this for simplification. 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/recovery.c')
-rw-r--r--fs/nilfs2/recovery.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/fs/nilfs2/recovery.c b/fs/nilfs2/recovery.c
index ef387b19682c..6ab4c8fc5e9f 100644
--- a/fs/nilfs2/recovery.c
+++ b/fs/nilfs2/recovery.c
@@ -463,16 +463,6 @@ static int nilfs_prepare_segment_for_recovery(struct the_nilfs *nilfs,
463 nilfs_free_segment_entry(ent); 463 nilfs_free_segment_entry(ent);
464 } 464 }
465 465
466 /*
467 * The segment having the latest super root is active, and
468 * should be deactivated on the next construction for recovery.
469 */
470 err = -ENOMEM;
471 ent = nilfs_alloc_segment_entry(segnum[0]);
472 if (unlikely(!ent))
473 goto failed;
474 list_add_tail(&ent->list, &ri->ri_used_segments);
475
476 /* Allocate new segments for recovery */ 466 /* Allocate new segments for recovery */
477 err = nilfs_sufile_alloc(sufile, &segnum[0]); 467 err = nilfs_sufile_alloc(sufile, &segnum[0]);
478 if (unlikely(err)) 468 if (unlikely(err))
@@ -757,7 +747,7 @@ int nilfs_recover_logical_segments(struct the_nilfs *nilfs,
757 goto failed; 747 goto failed;
758 } 748 }
759 749
760 err = nilfs_attach_segment_constructor(sbi, ri); 750 err = nilfs_attach_segment_constructor(sbi);
761 if (unlikely(err)) 751 if (unlikely(err))
762 goto failed; 752 goto failed;
763 753