ext4: make online defragmentation support large folios
authorZhang Yi <yi.zhang@huawei.com>
Mon, 12 May 2025 06:33:18 +0000 (14:33 +0800)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 20 May 2025 14:31:12 +0000 (10:31 -0400)
commit01e807e18fd87937f515926b79152dfa4f13b735
treecf52276ceb27c17f8b98b1f7f21e7f878a4d878a
parentcd9f76de6ae9a5a0ca6201b1f06cf116a6a3e3a2
ext4: make online defragmentation support large folios

move_extent_per_page() currently assumes that each folio is the size of
PAGE_SIZE and only copies data for one page. ext4_move_extents() should
call move_extent_per_page() for each page. To support larger folios,
simply modify the calculations for the block start and end offsets
within the folio based on the provided range of 'data_offset_in_page'
and 'block_len_in_page'. This function will continue to handle PAGE_SIZE
of data at a time and will not convert this function to manage an entire
folio. Additionally, we use the source folio to copy data, so it doesn't
matter if the source and dest folios are different in size.

Signed-off-by: Zhang Yi <yi.zhang@huawei.com>
Link: https://patch.msgid.link/20250512063319.3539411-8-yi.zhang@huaweicloud.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/move_extent.c