]> git.baikalelectronics.ru Git - kernel.git/commit
jbd2: Simplify journal_unmap_buffer()
authorThomas Gleixner <tglx@linutronix.de>
Fri, 9 Aug 2019 12:42:27 +0000 (14:42 +0200)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 21 Oct 2019 13:16:45 +0000 (09:16 -0400)
commit58ba4050ac1ce1140a35eb1864bcec2c490b2bef
tree37e57f2b87c365bbe8515a33b122536653065c40
parent1a1521bb50a95f9e476c2109d83bfa47e4706c56
jbd2: Simplify journal_unmap_buffer()

journal_unmap_buffer() checks first whether the buffer head is a journal.
If so it takes locks and then invokes jbd2_journal_grab_journal_head()
followed by another check whether this is journal head buffer.

The double checking is pointless.

Replace the initial check with jbd2_journal_grab_journal_head() which
alredy checks whether the buffer head is actually a journal.

Allows also early access to the journal head pointer for the upcoming
conversion of state lock to a regular spinlock.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Jan Kara <jack@suse.cz>
Cc: linux-ext4@vger.kernel.org
Cc: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20190809124233.13277-2-jack@suse.cz
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/jbd2/transaction.c