aboutsummaryrefslogtreecommitdiffstats
path: root/fs/logfs/journal.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/logfs/journal.c')
-rw-r--r--fs/logfs/journal.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/logfs/journal.c b/fs/logfs/journal.c
index f186043e862..33bd260b830 100644
--- a/fs/logfs/journal.c
+++ b/fs/logfs/journal.c
@@ -801,6 +801,7 @@ void do_logfs_journal_wl_pass(struct super_block *sb)
801{ 801{
802 struct logfs_super *super = logfs_super(sb); 802 struct logfs_super *super = logfs_super(sb);
803 struct logfs_area *area = super->s_journal_area; 803 struct logfs_area *area = super->s_journal_area;
804 struct btree_head32 *head = &super->s_reserved_segments;
804 u32 segno, ec; 805 u32 segno, ec;
805 int i, err; 806 int i, err;
806 807
@@ -808,6 +809,7 @@ void do_logfs_journal_wl_pass(struct super_block *sb)
808 /* Drop old segments */ 809 /* Drop old segments */
809 journal_for_each(i) 810 journal_for_each(i)
810 if (super->s_journal_seg[i]) { 811 if (super->s_journal_seg[i]) {
812 btree_remove32(head, super->s_journal_seg[i]);
811 logfs_set_segment_unreserved(sb, 813 logfs_set_segment_unreserved(sb,
812 super->s_journal_seg[i], 814 super->s_journal_seg[i],
813 super->s_journal_ec[i]); 815 super->s_journal_ec[i]);
@@ -820,8 +822,13 @@ void do_logfs_journal_wl_pass(struct super_block *sb)
820 super->s_journal_seg[i] = segno; 822 super->s_journal_seg[i] = segno;
821 super->s_journal_ec[i] = ec; 823 super->s_journal_ec[i] = ec;
822 logfs_set_segment_reserved(sb, segno); 824 logfs_set_segment_reserved(sb, segno);
825 err = btree_insert32(head, segno, (void *)1, GFP_KERNEL);
826 BUG_ON(err); /* mempool should prevent this */
827 err = logfs_erase_segment(sb, segno, 1);
828 BUG_ON(err); /* FIXME: remount-ro would be nicer */
823 } 829 }
824 /* Manually move journal_area */ 830 /* Manually move journal_area */
831 freeseg(sb, area->a_segno);
825 area->a_segno = super->s_journal_seg[0]; 832 area->a_segno = super->s_journal_seg[0];
826 area->a_is_open = 0; 833 area->a_is_open = 0;
827 area->a_used_bytes = 0; 834 area->a_used_bytes = 0;