|
@@ -363,7 +363,7 @@ void jbd2_journal_commit_transaction(journal_t *journal)
|
|
int space_left = 0;
|
|
int space_left = 0;
|
|
int first_tag = 0;
|
|
int first_tag = 0;
|
|
int tag_flag;
|
|
int tag_flag;
|
|
- int i;
|
|
|
|
|
|
+ int i, to_free = 0;
|
|
int tag_bytes = journal_tag_bytes(journal);
|
|
int tag_bytes = journal_tag_bytes(journal);
|
|
struct buffer_head *cbh = NULL; /* For transactional checksums */
|
|
struct buffer_head *cbh = NULL; /* For transactional checksums */
|
|
__u32 crc32_sum = ~0;
|
|
__u32 crc32_sum = ~0;
|
|
@@ -1011,12 +1011,10 @@ restart_loop:
|
|
journal->j_average_commit_time = commit_time;
|
|
journal->j_average_commit_time = commit_time;
|
|
spin_unlock(&journal->j_state_lock);
|
|
spin_unlock(&journal->j_state_lock);
|
|
|
|
|
|
- if (journal->j_commit_callback)
|
|
|
|
- journal->j_commit_callback(journal, commit_transaction);
|
|
|
|
-
|
|
|
|
if (commit_transaction->t_checkpoint_list == NULL &&
|
|
if (commit_transaction->t_checkpoint_list == NULL &&
|
|
commit_transaction->t_checkpoint_io_list == NULL) {
|
|
commit_transaction->t_checkpoint_io_list == NULL) {
|
|
__jbd2_journal_drop_transaction(journal, commit_transaction);
|
|
__jbd2_journal_drop_transaction(journal, commit_transaction);
|
|
|
|
+ to_free = 1;
|
|
} else {
|
|
} else {
|
|
if (journal->j_checkpoint_transactions == NULL) {
|
|
if (journal->j_checkpoint_transactions == NULL) {
|
|
journal->j_checkpoint_transactions = commit_transaction;
|
|
journal->j_checkpoint_transactions = commit_transaction;
|
|
@@ -1035,11 +1033,16 @@ restart_loop:
|
|
}
|
|
}
|
|
spin_unlock(&journal->j_list_lock);
|
|
spin_unlock(&journal->j_list_lock);
|
|
|
|
|
|
|
|
+ if (journal->j_commit_callback)
|
|
|
|
+ journal->j_commit_callback(journal, commit_transaction);
|
|
|
|
+
|
|
trace_mark(jbd2_end_commit, "dev %s transaction %d head %d",
|
|
trace_mark(jbd2_end_commit, "dev %s transaction %d head %d",
|
|
- journal->j_devname, journal->j_commit_sequence,
|
|
|
|
|
|
+ journal->j_devname, commit_transaction->t_tid,
|
|
journal->j_tail_sequence);
|
|
journal->j_tail_sequence);
|
|
jbd_debug(1, "JBD: commit %d complete, head %d\n",
|
|
jbd_debug(1, "JBD: commit %d complete, head %d\n",
|
|
journal->j_commit_sequence, journal->j_tail_sequence);
|
|
journal->j_commit_sequence, journal->j_tail_sequence);
|
|
|
|
+ if (to_free)
|
|
|
|
+ kfree(commit_transaction);
|
|
|
|
|
|
wake_up(&journal->j_wait_done_commit);
|
|
wake_up(&journal->j_wait_done_commit);
|
|
}
|
|
}
|