ref: 824e15d0a277d9c6b9e357226dce4ae79d748bbc
parent: 6cb2cd7182476f06e85b699bc41fef11a3324792
author: ngkaho1234 <ngkaho1234@gmail.com>
date: Thu Dec 17 04:07:11 EST 2015
ext4_journal: add jbd_journal_commit_all routine.
--- a/lwext4/ext4_journal.c
+++ b/lwext4/ext4_journal.c
@@ -1187,9 +1187,6 @@
}
}
-/*
- * XXX: one should disable cache writeback first.
- */
void jbd_journal_commit_one(struct jbd_journal *journal)
{
int rc = EOK;
@@ -1241,6 +1238,13 @@
if (rc != EOK) {
journal->last = last;
jbd_journal_free_trans(journal, trans, true);
+ }
+}
+
+void jbd_journal_commit_all(struct jbd_journal *journal)
+{
+ while (!TAILQ_EMPTY(&journal->trans_queue)) {
+ jbd_journal_commit_one(journal);
}
}