Skip to content

Commit ab8627e

Browse files
LiBaokun96tytso
authored andcommitted
ext4: make ext4_zeroout_es() return void
After ext4_es_insert_extent() returns void, the return value in ext4_zeroout_es() is also unnecessary, so make it return void too. Signed-off-by: Baokun Li <libaokun1@huawei.com> Reviewed-by: Jan Kara <jack@suse.cz> Link: https://lore.kernel.org/r/20230424033846.4732-13-libaokun1@huawei.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
1 parent 6c12039 commit ab8627e

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

fs/ext4/extents.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3123,7 +3123,7 @@ void ext4_ext_release(struct super_block *sb)
31233123
#endif
31243124
}
31253125

3126-
static int ext4_zeroout_es(struct inode *inode, struct ext4_extent *ex)
3126+
static void ext4_zeroout_es(struct inode *inode, struct ext4_extent *ex)
31273127
{
31283128
ext4_lblk_t ee_block;
31293129
ext4_fsblk_t ee_pblock;
@@ -3134,11 +3134,10 @@ static int ext4_zeroout_es(struct inode *inode, struct ext4_extent *ex)
31343134
ee_pblock = ext4_ext_pblock(ex);
31353135

31363136
if (ee_len == 0)
3137-
return 0;
3137+
return;
31383138

31393139
ext4_es_insert_extent(inode, ee_block, ee_len, ee_pblock,
31403140
EXTENT_STATUS_WRITTEN);
3141-
return 0;
31423141
}
31433142

31443143
/* FIXME!! we need to try to merge to left or right after zero-out */
@@ -3288,7 +3287,7 @@ static int ext4_split_extent_at(handle_t *handle,
32883287
err = ext4_ext_dirty(handle, inode, path + path->p_depth);
32893288
if (!err)
32903289
/* update extent status tree */
3291-
err = ext4_zeroout_es(inode, &zero_ex);
3290+
ext4_zeroout_es(inode, &zero_ex);
32923291
/* If we failed at this point, we don't know in which
32933292
* state the extent tree exactly is so don't try to fix
32943293
* length of the original extent as it may do even more
@@ -3641,9 +3640,8 @@ static int ext4_ext_convert_to_initialized(handle_t *handle,
36413640
out:
36423641
/* If we have gotten a failure, don't zero out status tree */
36433642
if (!err) {
3644-
err = ext4_zeroout_es(inode, &zero_ex1);
3645-
if (!err)
3646-
err = ext4_zeroout_es(inode, &zero_ex2);
3643+
ext4_zeroout_es(inode, &zero_ex1);
3644+
ext4_zeroout_es(inode, &zero_ex2);
36473645
}
36483646
return err ? err : allocated;
36493647
}

0 commit comments

Comments
 (0)