jbd2: fold __process_buffer() into jbd2_log_do_checkpoint()
authorTheodore Ts'o <tytso@mit.edu>
Tue, 2 Sep 2014 01:19:01 +0000 (21:19 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 2 Sep 2014 01:19:01 +0000 (21:19 -0400)
commitbe1158cc615fd723552f0d9912087423c7cadda5
treedee7dc2306bb71cdd5c28d3f09b9f04dfd4cc2ff
parented8a1a766af7371bfbe41857a3a11496b4165143
jbd2: fold __process_buffer() into jbd2_log_do_checkpoint()

__process_buffer() is only called by jbd2_log_do_checkpoint(), and it
had a very complex locking protocol where it would be called with the
j_list_lock, and sometimes exit with the lock held (if the return code
was 0), or release the lock.

This was confusing both to humans and to smatch (which erronously
complained that the lock was taken twice).

Folding __process_buffer() to the caller allows us to simplify the
control flow, making the resulting function easier to read and reason
about, and dropping the compiled size of fs/jbd2/checkpoint.c by 150
bytes (over 4% of the text size).

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Jan Kara <jack@suse.cz>
fs/jbd2/checkpoint.c