Skip to content

Commit

Permalink
jbd2: optimize jbd2_log_do_checkpoint() a bit
Browse files Browse the repository at this point in the history
When we discover written out buffer in transaction checkpoint list we
don't have to recheck validity of a transaction. Either this is the
last buffer in a transaction - and then we are done - or this isn't
and then we can just take another buffer from the checkpoint list
without dropping j_list_lock.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
  • Loading branch information
jankara authored and tytso committed Sep 4, 2014
1 parent dc6e8d6 commit 0e5ecf0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions fs/jbd2/checkpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,10 @@ int jbd2_log_do_checkpoint(journal_t *journal)
if (unlikely(buffer_write_io_error(bh)) && !result)
result = -EIO;
BUFFER_TRACE(bh, "remove from checkpoint");
__jbd2_journal_remove_checkpoint(jh);
spin_unlock(&journal->j_list_lock);
goto retry;
if (__jbd2_journal_remove_checkpoint(jh))
/* The transaction was released; we're done */
goto out;
continue;
}
/*
* Important: we are about to write the buffer, and
Expand Down

0 comments on commit 0e5ecf0

Please sign in to comment.