Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0e5ecf0a authored by Jan Kara's avatar Jan Kara Committed by Theodore Ts'o
Browse files

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: default avatarJan Kara <jack@suse.cz>
Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
parent dc6e8d66
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
@@ -285,9 +285,10 @@ int jbd2_log_do_checkpoint(journal_t *journal)
			if (unlikely(buffer_write_io_error(bh)) && !result)
			if (unlikely(buffer_write_io_error(bh)) && !result)
				result = -EIO;
				result = -EIO;
			BUFFER_TRACE(bh, "remove from checkpoint");
			BUFFER_TRACE(bh, "remove from checkpoint");
			__jbd2_journal_remove_checkpoint(jh);
			if (__jbd2_journal_remove_checkpoint(jh))
			spin_unlock(&journal->j_list_lock);
				/* The transaction was released; we're done */
			goto retry;
				goto out;
			continue;
		}
		}
		/*
		/*
		 * Important: we are about to write the buffer, and
		 * Important: we are about to write the buffer, and