Re: [PATCH 06/27] ext4: refactor ext4_collapse_range()

From: Jan Kara
Date: Wed Dec 04 2024 - 06:58:28 EST


On Tue 22-10-24 19:10:37, Zhang Yi wrote:
> From: Zhang Yi <yi.zhang@xxxxxxxxxx>
>
> Simplify ext4_collapse_range() and align its code style with that of
> ext4_zero_range() and ext4_punch_hole(). Refactor it by: a) renaming
> variables, b) removing redundant input parameter checks and moving
> the remaining checks under i_rwsem in preparation for future
> refactoring, and c) renaming the three stale error tags.
>
> Signed-off-by: Zhang Yi <yi.zhang@xxxxxxxxxx>

Looks good. Feel free to add:

Reviewed-by: Jan Kara <jack@xxxxxxx>

Just one nit below:

> -out_stop:
> +out_handle:
> ext4_journal_stop(handle);
> -out_mmap:
> +out_invalidate_lock:
> filemap_invalidate_unlock(mapping);
> -out_mutex:
> +out:
> inode_unlock(inode);
> return ret;
> }

Again, I think "out_inode_lock" would be a better name than just "out".

Honza

--
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR