]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
fs: reiserfs: remove unnecessary check of bh in remove_from_transaction()
authorJia-Ju Bai <baijiaju1990@gmail.com>
Wed, 25 Sep 2019 23:46:55 +0000 (16:46 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 26 Sep 2019 00:51:39 +0000 (17:51 -0700)
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/20190727084019.11307-1-baijiaju1990@gmail.com
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Hariprasad Kelam <hariprasad.kelam@gmail.com>
Cc: Bharath Vedartham <linux.bhar@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/reiserfs/journal.c

index 4517a1394c6f418de001bf26ccdf7fdaab192d62..11155b8513db99f2ad9c1760ef3a05a55bea955c 100644 (file)
@@ -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) {