ext4: make ext4_insert_delayed_block() insert multi-blocks
authorZhang Yi <yi.zhang@huawei.com>
Fri, 17 May 2024 12:40:04 +0000 (20:40 +0800)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 27 Jun 2024 22:04:50 +0000 (18:04 -0400)
commit1850d76c1b781ad9c7dc3c4968fb40c1915231c0
treef7e899579af0a49461c7efaf877c7bf5070e3c0f
parent49bf6ab4d30b7a39d86a585e0a58f6c449d2e009
ext4: make ext4_insert_delayed_block() insert multi-blocks

Rename ext4_insert_delayed_block() to ext4_insert_delayed_blocks(),
pass length parameter to make it insert multiple delalloc blocks at a
time. For non-bigalloc case, just reserve len blocks and insert delalloc
extent. For bigalloc case, we can ensure that the clusters in the middle
of a extent must be unallocated, we only need to check whether the start
and end clusters are delayed/allocated. We should subtract the space for
the start and/or end block(s) if they are allocated.

Signed-off-by: Zhang Yi <yi.zhang@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://patch.msgid.link/20240517124005.347221-10-yi.zhang@huaweicloud.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/inode.c