Skip to content

Commit

Permalink
ext4: remove unnecessary NULL pointer check
Browse files Browse the repository at this point in the history
brelse() and ext4_journal_force_commit() are both inlined and able
to handle NULL.

Signed-off-by: Guo Chao <[email protected]>
Reviewed-by: Darrick J. Wong <[email protected]>
Signed-off-by: "Theodore Ts'o" <[email protected]>
  • Loading branch information
Guo Chao authored and tytso committed Jan 29, 2013
1 parent 41be871 commit b1deefc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
3 changes: 1 addition & 2 deletions fs/ext4/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
6 changes: 1 addition & 5 deletions fs/ext4/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b1deefc

Please sign in to comment.