add patch fix-crypto-warnings
[ext4-patch-queue.git] / optimize-jbd2_log_do_checkpoint-a-bit
blob2b919a35baf04773f94ea8fe1f35dece5d98bf48
1 jbd2: optimize jbd2_log_do_checkpoint() a bit
3 From: Jan Kara <jack@suse.cz>
5 When we discover written out buffer in transaction checkpoint list we
6 don't have to recheck validity of a transaction. Either this is the
7 last buffer in a transaction - and then we are done - or this isn't
8 and then we can just take another buffer from the checkpoint list
9 without dropping j_list_lock.
11 Signed-off-by: Jan Kara <jack@suse.cz>
12 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
13 ---
14  fs/jbd2/checkpoint.c | 7 ++++---
15  1 file changed, 4 insertions(+), 3 deletions(-)
17 diff --git a/fs/jbd2/checkpoint.c b/fs/jbd2/checkpoint.c
18 index cb6e17c..7713f94 100644
19 --- a/fs/jbd2/checkpoint.c
20 +++ b/fs/jbd2/checkpoint.c
21 @@ -289,9 +289,10 @@ restart:
22                         if (unlikely(buffer_write_io_error(bh)) && !result)
23                                 result = -EIO;
24                         BUFFER_TRACE(bh, "remove from checkpoint");
25 -                       __jbd2_journal_remove_checkpoint(jh);
26 -                       spin_unlock(&journal->j_list_lock);
27 -                       goto retry;
28 +                       if (__jbd2_journal_remove_checkpoint(jh))
29 +                               /* The transaction was released; we're done */
30 +                               goto out;
31 +                       continue;
32                 }
33                 /*
34                  * Important: we are about to write the buffer, and