1 ext4: remove redundant condition check
3 From: Chengguang Xu <cgxu519@gmx.com>
5 ext4_xattr_destroy_cache() can handle NULL pointer correctly,
6 so there is no need to check NULL pointer before calling
7 ext4_xattr_destroy_cache().
9 Reviewed-by: Jan Kara <jack@suse.cz>
10 Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
11 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
13 fs/ext4/super.c | 29 +++++++++++++----------------
14 1 file changed, 13 insertions(+), 16 deletions(-)
16 diff --git a/fs/ext4/super.c b/fs/ext4/super.c
17 index 53ff6c2a26ed..30d4a4e69de8 100644
20 @@ -1000,14 +1000,13 @@ static void ext4_put_super(struct super_block *sb)
21 invalidate_bdev(sbi->journal_bdev);
22 ext4_blkdev_remove(sbi);
24 - if (sbi->s_ea_inode_cache) {
25 - ext4_xattr_destroy_cache(sbi->s_ea_inode_cache);
26 - sbi->s_ea_inode_cache = NULL;
28 - if (sbi->s_ea_block_cache) {
29 - ext4_xattr_destroy_cache(sbi->s_ea_block_cache);
30 - sbi->s_ea_block_cache = NULL;
33 + ext4_xattr_destroy_cache(sbi->s_ea_inode_cache);
34 + sbi->s_ea_inode_cache = NULL;
36 + ext4_xattr_destroy_cache(sbi->s_ea_block_cache);
37 + sbi->s_ea_block_cache = NULL;
40 kthread_stop(sbi->s_mmp_tsk);
42 @@ -4522,14 +4521,12 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
43 if (EXT4_SB(sb)->rsv_conversion_wq)
44 destroy_workqueue(EXT4_SB(sb)->rsv_conversion_wq);
46 - if (sbi->s_ea_inode_cache) {
47 - ext4_xattr_destroy_cache(sbi->s_ea_inode_cache);
48 - sbi->s_ea_inode_cache = NULL;
50 - if (sbi->s_ea_block_cache) {
51 - ext4_xattr_destroy_cache(sbi->s_ea_block_cache);
52 - sbi->s_ea_block_cache = NULL;
54 + ext4_xattr_destroy_cache(sbi->s_ea_inode_cache);
55 + sbi->s_ea_inode_cache = NULL;
57 + ext4_xattr_destroy_cache(sbi->s_ea_block_cache);
58 + sbi->s_ea_block_cache = NULL;
61 jbd2_journal_destroy(sbi->s_journal);
62 sbi->s_journal = NULL;