summaryrefslogtreecommitdiffstats
path: root/fs/ext4
diff options
context:
space:
mode:
authorChengguang Xu <cgxu519@gmx.com>2018-12-04 00:24:42 -0500
committerTheodore Ts'o <tytso@mit.edu>2018-12-04 00:24:42 -0500
commit50c15df69e062bf056b44d5bb51fac5ed957fa37 (patch)
tree01bd379f3cf6ba4cede3e8ff006c280639b32cc3 /fs/ext4
parent561405f031fec0a124a19c8f16275730f63fb3d9 (diff)
downloadlinux-50c15df69e062bf056b44d5bb51fac5ed957fa37.tar.bz2
ext4: remove redundant condition check
ext4_xattr_destroy_cache() can handle NULL pointer correctly, so there is no need to check NULL pointer before calling ext4_xattr_destroy_cache(). Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Chengguang Xu <cgxu519@gmx.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/super.c29
1 files changed, 13 insertions, 16 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 97a1cef29ef8..a39726cc78bc 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -1023,14 +1023,13 @@ static void ext4_put_super(struct super_block *sb)
invalidate_bdev(sbi->journal_bdev);
ext4_blkdev_remove(sbi);
}
- if (sbi->s_ea_inode_cache) {
- ext4_xattr_destroy_cache(sbi->s_ea_inode_cache);
- sbi->s_ea_inode_cache = NULL;
- }
- if (sbi->s_ea_block_cache) {
- ext4_xattr_destroy_cache(sbi->s_ea_block_cache);
- sbi->s_ea_block_cache = NULL;
- }
+
+ ext4_xattr_destroy_cache(sbi->s_ea_inode_cache);
+ sbi->s_ea_inode_cache = NULL;
+
+ ext4_xattr_destroy_cache(sbi->s_ea_block_cache);
+ sbi->s_ea_block_cache = NULL;
+
if (sbi->s_mmp_tsk)
kthread_stop(sbi->s_mmp_tsk);
brelse(sbi->s_sbh);
@@ -4545,14 +4544,12 @@ failed_mount4:
if (EXT4_SB(sb)->rsv_conversion_wq)
destroy_workqueue(EXT4_SB(sb)->rsv_conversion_wq);
failed_mount_wq:
- if (sbi->s_ea_inode_cache) {
- ext4_xattr_destroy_cache(sbi->s_ea_inode_cache);
- sbi->s_ea_inode_cache = NULL;
- }
- if (sbi->s_ea_block_cache) {
- ext4_xattr_destroy_cache(sbi->s_ea_block_cache);
- sbi->s_ea_block_cache = NULL;
- }
+ ext4_xattr_destroy_cache(sbi->s_ea_inode_cache);
+ sbi->s_ea_inode_cache = NULL;
+
+ ext4_xattr_destroy_cache(sbi->s_ea_block_cache);
+ sbi->s_ea_block_cache = NULL;
+
if (sbi->s_journal) {
jbd2_journal_destroy(sbi->s_journal);
sbi->s_journal = NULL;