Skip to content

Commit

Permalink
fs: reiserfs: remove unnecessary check of bh in remove_from_transacti…
Browse files Browse the repository at this point in the history
…on()

On lines 3430-3434, bh has been assured to be non-null:
    cn = get_journal_hash_dev(sb, journal->j_hash_table, blocknr);
    if (!cn || !cn->bh) {
        return ret;
    }
    bh = cn->bh;

Thus, the check of bh on line 3447 is unnecessary and can be removed.
Thank Andrew Morton for good advice.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Jia-Ju Bai <[email protected]>
Reviewed-by: Jan Kara <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Cc: Hariprasad Kelam <[email protected]>
Cc: Bharath Vedartham <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
XidianGeneral authored and torvalds committed Sep 26, 2019
1 parent dbbf869 commit d256085
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions fs/reiserfs/journal.c
Original file line number Diff line number Diff line change
Expand Up @@ -3444,9 +3444,8 @@ static int remove_from_transaction(struct super_block *sb,
if (cn == journal->j_last) {
journal->j_last = cn->prev;
}
if (bh)
remove_journal_hash(sb, journal->j_hash_table, NULL,
bh->b_blocknr, 0);
remove_journal_hash(sb, journal->j_hash_table, NULL,
bh->b_blocknr, 0);
clear_buffer_journaled(bh); /* don't log this one */

if (!already_cleaned) {
Expand Down

0 comments on commit d256085

Please sign in to comment.