Re: [PATCH v3 05/12] ext4: passing block allocation information to ext4_es_insert_extent()

From: Jan Kara
Date: Wed Sep 04 2024 - 06:21:30 EST


On Tue 13-08-24 20:34:45, Zhang Yi wrote:
> From: Zhang Yi <yi.zhang@xxxxxxxxxx>
>
> Just pass the block allocation flag to ext4_es_insert_extent() when we
> replacing a current extent after an actually block allocation or extent
> status conversion, this flag will be used by later changes.
>
> Suggested-by: Jan Kara <jack@xxxxxxx>
> Signed-off-by: Zhang Yi <yi.zhang@xxxxxxxxxx>

Looks good. Just one suggestion below. With that feel free to add:

Reviewed-by: Jan Kara <jack@xxxxxxx>

> @@ -848,7 +848,7 @@ static int __es_insert_extent(struct inode *inode, struct extent_status *newes,
> */
> void ext4_es_insert_extent(struct inode *inode, ext4_lblk_t lblk,
> ext4_lblk_t len, ext4_fsblk_t pblk,
> - unsigned int status)
> + unsigned int status, int flags)

Since you pass flags to ext4_es_insert_extent() only from one place, let's
not pretend these are always full mapping flags and just make this new
argument:

bool delalloc_reserve_used

and from ext4_map_blocks_create() you can pass flags &
EXT4_GET_BLOCKS_DELALLOC_RESERVE.

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