]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ext4: move out common parts into ext4_fallocate()
authorZhang Yi <yi.zhang@huawei.com>
Thu, 24 Jul 2025 02:57:15 +0000 (22:57 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 1 Aug 2025 08:48:46 +0000 (09:48 +0100)
commit35bd33e3ef090cf2b734d28ce282af093bb2baff
treec0d546bf4aa111350360830ca9dec321975ece22
parent8a98313caa3a4c494f530777d9dde592f915b20d
ext4: move out common parts into ext4_fallocate()

[ Upstream commit 2890e5e0f49e10f3dadc5f7b7ea434e3e77e12a6 ]

Currently, all zeroing ranges, punch holes, collapse ranges, and insert
ranges first wait for all existing direct I/O workers to complete, and
then they acquire the mapping's invalidate lock before performing the
actual work. These common components are nearly identical, so we can
simplify the code by factoring them out into the ext4_fallocate().

Signed-off-by: Zhang Yi <yi.zhang@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>
Link: https://patch.msgid.link/20241220011637.1157197-11-yi.zhang@huaweicloud.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Stable-dep-of: 29ec9bed2395 ("ext4: fix incorrect punch max_end")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/extents.c
fs/ext4/inode.c