diff options
author | Guo Chao <yan@linux.vnet.ibm.com> | 2013-01-28 21:41:02 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2013-01-28 21:41:02 -0500 |
commit | b1deefc99e668348f7c785c6ece5f6ff4c6d8b5c (patch) | |
tree | ce16d0377ace3dfd7c0a4ecefc27f29a8ee431c2 /fs | |
parent | 41be871f747f64e076b09a68ae82a643e2ffb215 (diff) |
ext4: remove unnecessary NULL pointer check
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>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ext4/namei.c | 3 | ||||
-rw-r--r-- | fs/ext4/super.c | 6 |
2 files changed, 2 insertions, 7 deletions
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index f4b95870870e..34ed624d2c56 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c | |||
@@ -2110,8 +2110,7 @@ static int ext4_dx_add_entry(handle_t *handle, struct dentry *dentry, | |||
2110 | journal_error: | 2110 | journal_error: |
2111 | ext4_std_error(dir->i_sb, err); | 2111 | ext4_std_error(dir->i_sb, err); |
2112 | cleanup: | 2112 | cleanup: |
2113 | if (bh) | 2113 | brelse(bh); |
2114 | brelse(bh); | ||
2115 | dx_release(frames); | 2114 | dx_release(frames); |
2116 | return err; | 2115 | return err; |
2117 | } | 2116 | } |
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index dc0fb7b942cf..aac52738eb60 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -4480,16 +4480,12 @@ static void ext4_clear_journal_err(struct super_block *sb, | |||
4480 | int ext4_force_commit(struct super_block *sb) | 4480 | int ext4_force_commit(struct super_block *sb) |
4481 | { | 4481 | { |
4482 | journal_t *journal; | 4482 | journal_t *journal; |
4483 | int ret = 0; | ||
4484 | 4483 | ||
4485 | if (sb->s_flags & MS_RDONLY) | 4484 | if (sb->s_flags & MS_RDONLY) |
4486 | return 0; | 4485 | return 0; |
4487 | 4486 | ||
4488 | journal = EXT4_SB(sb)->s_journal; | 4487 | journal = EXT4_SB(sb)->s_journal; |
4489 | if (journal) | 4488 | return ext4_journal_force_commit(journal); |
4490 | ret = ext4_journal_force_commit(journal); | ||
4491 | |||
4492 | return ret; | ||
4493 | } | 4489 | } |
4494 | 4490 | ||
4495 | static int ext4_sync_fs(struct super_block *sb, int wait) | 4491 | static int ext4_sync_fs(struct super_block *sb, int wait) |