ext4: remove unnecessary NULL pointer check
authorGuo Chao <yan@linux.vnet.ibm.com>
Tue, 29 Jan 2013 02:41:02 +0000 (21:41 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 29 Jan 2013 02:41:02 +0000 (21:41 -0500)
brelse() and ext4_journal_force_commit() are both inlined and able
to handle NULL.

Signed-off-by: Guo Chao <yan@linux.vnet.ibm.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs/ext4/namei.c
fs/ext4/super.c

index f4b95870870e333d5f6a4e5363091ad45f2aaa8e..34ed624d2c561da5f02616cf8a10db6746e4a167 100644 (file)
@@ -2110,8 +2110,7 @@ static int ext4_dx_add_entry(handle_t *handle, struct dentry *dentry,
 journal_error:
        ext4_std_error(dir->i_sb, err);
 cleanup:
-       if (bh)
-               brelse(bh);
+       brelse(bh);
        dx_release(frames);
        return err;
 }
index dc0fb7b942cf7800fea65caf9473d04d0de803d5..aac52738eb606285feb23b8a42356ad606b87d53 100644 (file)
@@ -4480,16 +4480,12 @@ static void ext4_clear_journal_err(struct super_block *sb,
 int ext4_force_commit(struct super_block *sb)
 {
        journal_t *journal;
-       int ret = 0;
 
        if (sb->s_flags & MS_RDONLY)
                return 0;
 
        journal = EXT4_SB(sb)->s_journal;
-       if (journal)
-               ret = ext4_journal_force_commit(journal);
-
-       return ret;
+       return ext4_journal_force_commit(journal);
 }
 
 static int ext4_sync_fs(struct super_block *sb, int wait)