diff mbox series

[v4,12/12] ext4: make ext4_zeroout_es() return void

Message ID 20230424033846.4732-13-libaokun1@huawei.com
State Awaiting Upstream
Headers show
Series ext4: fix WARNING in ext4_da_update_reserve_space | expand

Commit Message

Baokun Li April 24, 2023, 3:38 a.m. UTC
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>
---
 fs/ext4/extents.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

Comments

Jan Kara May 3, 2023, 2:33 p.m. UTC | #1
On Mon 24-04-23 11:38:46, Baokun Li wrote:
> 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>

Looks good to me. Feel free to add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

> ---
>  fs/ext4/extents.c | 12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
> index d555ed924f37..6c3080830b00 100644
> --- a/fs/ext4/extents.c
> +++ b/fs/ext4/extents.c
> @@ -3123,7 +3123,7 @@ void ext4_ext_release(struct super_block *sb)
>  #endif
>  }
>  
> -static int ext4_zeroout_es(struct inode *inode, struct ext4_extent *ex)
> +static void ext4_zeroout_es(struct inode *inode, struct ext4_extent *ex)
>  {
>  	ext4_lblk_t  ee_block;
>  	ext4_fsblk_t ee_pblock;
> @@ -3134,11 +3134,10 @@ static int ext4_zeroout_es(struct inode *inode, struct ext4_extent *ex)
>  	ee_pblock = ext4_ext_pblock(ex);
>  
>  	if (ee_len == 0)
> -		return 0;
> +		return;
>  
>  	ext4_es_insert_extent(inode, ee_block, ee_len, ee_pblock,
>  			      EXTENT_STATUS_WRITTEN);
> -	return 0;
>  }
>  
>  /* 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,
>  			err = ext4_ext_dirty(handle, inode, path + path->p_depth);
>  			if (!err)
>  				/* update extent status tree */
> -				err = ext4_zeroout_es(inode, &zero_ex);
> +				ext4_zeroout_es(inode, &zero_ex);
>  			/* If we failed at this point, we don't know in which
>  			 * state the extent tree exactly is so don't try to fix
>  			 * 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,
>  out:
>  	/* If we have gotten a failure, don't zero out status tree */
>  	if (!err) {
> -		err = ext4_zeroout_es(inode, &zero_ex1);
> -		if (!err)
> -			err = ext4_zeroout_es(inode, &zero_ex2);
> +		ext4_zeroout_es(inode, &zero_ex1);
> +		ext4_zeroout_es(inode, &zero_ex2);
>  	}
>  	return err ? err : allocated;
>  }
> -- 
> 2.31.1
>
diff mbox series

Patch

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index d555ed924f37..6c3080830b00 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -3123,7 +3123,7 @@  void ext4_ext_release(struct super_block *sb)
 #endif
 }
 
-static int ext4_zeroout_es(struct inode *inode, struct ext4_extent *ex)
+static void ext4_zeroout_es(struct inode *inode, struct ext4_extent *ex)
 {
 	ext4_lblk_t  ee_block;
 	ext4_fsblk_t ee_pblock;
@@ -3134,11 +3134,10 @@  static int ext4_zeroout_es(struct inode *inode, struct ext4_extent *ex)
 	ee_pblock = ext4_ext_pblock(ex);
 
 	if (ee_len == 0)
-		return 0;
+		return;
 
 	ext4_es_insert_extent(inode, ee_block, ee_len, ee_pblock,
 			      EXTENT_STATUS_WRITTEN);
-	return 0;
 }
 
 /* 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,
 			err = ext4_ext_dirty(handle, inode, path + path->p_depth);
 			if (!err)
 				/* update extent status tree */
-				err = ext4_zeroout_es(inode, &zero_ex);
+				ext4_zeroout_es(inode, &zero_ex);
 			/* If we failed at this point, we don't know in which
 			 * state the extent tree exactly is so don't try to fix
 			 * 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,
 out:
 	/* If we have gotten a failure, don't zero out status tree */
 	if (!err) {
-		err = ext4_zeroout_es(inode, &zero_ex1);
-		if (!err)
-			err = ext4_zeroout_es(inode, &zero_ex2);
+		ext4_zeroout_es(inode, &zero_ex1);
+		ext4_zeroout_es(inode, &zero_ex2);
 	}
 	return err ? err : allocated;
 }