static void
jbd_journal_purge_cp_trans(struct jbd_journal *journal,
- bool flush)
+ bool flush,
+ bool once)
{
struct jbd_trans *trans;
while ((trans = TAILQ_FIRST(&journal->cp_queue))) {
} else
jbd_journal_flush_trans(trans);
}
+ if (once)
+ break;
}
}
/* Make sure that journalled content have reached
* the disk.*/
- jbd_journal_purge_cp_trans(journal, true);
+ jbd_journal_purge_cp_trans(journal, true, false);
/* There should be no block record in this journal
* session. */
/* If there is no space left, flush all journalled
* blocks to disk first.*/
if (journal->last == journal->start)
- jbd_journal_purge_cp_trans(journal, true);
+ jbd_journal_purge_cp_trans(journal, true, false);
return start_block;
}
TAILQ_REMOVE(&journal->cp_queue, trans, trans_node);
jbd_journal_free_trans(journal, trans, false);
- jbd_journal_purge_cp_trans(journal, false);
+ jbd_journal_purge_cp_trans(journal, false, true);
jbd_journal_write_sb(journal);
jbd_write_sb(journal->jbd_fs);
}