[PATCH -next v2 1/2] ext4: remove unnecessary drop path references in mext_check_coverage()

Ye Bin posted 2 patches 3 years, 6 months ago
[PATCH -next v2 1/2] ext4: remove unnecessary drop path references in mext_check_coverage()
Posted by Ye Bin 3 years, 6 months ago
According to Jan Kara's suggestion:
"The use in mext_check_coverage() can be actually removed
- get_ext_path() -> ext4_find_extent() takes care of dropping the references."
So remove unnecessary call ext4_ext_drop_refs() in mext_check_coverage().

Signed-off-by: Ye Bin <yebin10@huawei.com>
---
 fs/ext4/move_extent.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/fs/ext4/move_extent.c b/fs/ext4/move_extent.c
index 701f1d6a217f..782bbda2a717 100644
--- a/fs/ext4/move_extent.c
+++ b/fs/ext4/move_extent.c
@@ -103,7 +103,6 @@ mext_check_coverage(struct inode *inode, ext4_lblk_t from, ext4_lblk_t count,
 		if (unwritten != ext4_ext_is_unwritten(ext))
 			goto out;
 		from += ext4_ext_get_actual_len(ext);
-		ext4_ext_drop_refs(path);
 	}
 	ret = 1;
 out:
-- 
2.31.1
Re: [PATCH -next v2 1/2] ext4: remove unnecessary drop path references in mext_check_coverage()
Posted by Jan Kara 3 years, 6 months ago
On Sat 24-09-22 10:12:10, Ye Bin wrote:
> According to Jan Kara's suggestion:
> "The use in mext_check_coverage() can be actually removed
> - get_ext_path() -> ext4_find_extent() takes care of dropping the references."
> So remove unnecessary call ext4_ext_drop_refs() in mext_check_coverage().
> 
> Signed-off-by: Ye Bin <yebin10@huawei.com>

Looks good. Feel free to add:

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

								Honza

> ---
>  fs/ext4/move_extent.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/fs/ext4/move_extent.c b/fs/ext4/move_extent.c
> index 701f1d6a217f..782bbda2a717 100644
> --- a/fs/ext4/move_extent.c
> +++ b/fs/ext4/move_extent.c
> @@ -103,7 +103,6 @@ mext_check_coverage(struct inode *inode, ext4_lblk_t from, ext4_lblk_t count,
>  		if (unwritten != ext4_ext_is_unwritten(ext))
>  			goto out;
>  		from += ext4_ext_get_actual_len(ext);
> -		ext4_ext_drop_refs(path);
>  	}
>  	ret = 1;
>  out:
> -- 
> 2.31.1
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR