aboutsummaryrefslogtreecommitdiff
path: root/fs/jbd2
diff options
context:
space:
mode:
authorJan Kara2014-09-04 18:09:29 -0400
committerTheodore Ts'o2014-09-04 18:09:29 -0400
commit0e5ecf0a762627b949141df1d83094a9b0eb54a8 (patch)
tree14fa8da08990a77cc51bdb08fce460861a5e2c9a /fs/jbd2
parentdc6e8d669cf5cb3ff84707c372c0a2a8a5e80845 (diff)
jbd2: optimize jbd2_log_do_checkpoint() a bit
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>
Diffstat (limited to 'fs/jbd2')
-rw-r--r--fs/jbd2/checkpoint.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/jbd2/checkpoint.c b/fs/jbd2/checkpoint.c
index 90d6091d7e18..9ffb19cf376b 100644
--- a/fs/jbd2/checkpoint.c
+++ b/fs/jbd2/checkpoint.c
@@ -285,9 +285,10 @@ restart:
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