summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorngkaho1234 <ngkaho1234@gmail.com>2015-12-18 10:23:59 +0000
committerngkaho1234 <ngkaho1234@gmail.com>2015-12-18 14:31:41 +0000
commitd44c244db5af1ce24454d651d00565bf09a99020 (patch)
treee562f43c85ab2bc78f7b5b76395ca102ae21c974
parent13025de0e6e1dd697a468a8b94842c73e2343bb3 (diff)
ext4_journal: clear end_write and end_write_arg fields when appropriate.
-rw-r--r--lwext4/ext4_journal.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lwext4/ext4_journal.c b/lwext4/ext4_journal.c
index 5a71555..9d0ac3d 100644
--- a/lwext4/ext4_journal.c
+++ b/lwext4/ext4_journal.c
@@ -1359,7 +1359,7 @@ void jbd_journal_cp_trans(struct jbd_journal *journal, struct jbd_trans *trans)
/**@brief Update the start block of the journal when
* all the contents in a transaction reach the disk.*/
static void jbd_trans_end_write(struct ext4_bcache *bc __unused,
- struct ext4_buf *buf __unused,
+ struct ext4_buf *buf,
int res,
void *arg)
{
@@ -1370,6 +1370,10 @@ static void jbd_trans_end_write(struct ext4_bcache *bc __unused,
if (res != EOK)
trans->error = res;
+ /* Clear the end_write and end_write_arg fields. */
+ buf->end_write = NULL;
+ buf->end_write_arg = NULL;
+
trans->written_cnt++;
if (trans->written_cnt == trans->data_cnt) {
TAILQ_REMOVE(&journal->cp_queue, trans, trans_node);