diff mbox series

[11/11] btrfs: reclaim from data sub-space space_info

Message ID 36e642488814dbff7719c77b1fbdca5a8066ffc6.1733384172.git.naohiro.aota@wdc.com (mailing list archive)
State New
Headers show
Series btrfs: zoned: split out data relocation space_info | expand

Commit Message

Naohiro Aota Dec. 5, 2024, 7:48 a.m. UTC
Currently, we only have sub-space space_info for data. Modify
btrfs_async_data_reclaim() to run the reclaim process on the sub-spaces as
well.

Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
---
 fs/btrfs/space-info.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/fs/btrfs/space-info.c b/fs/btrfs/space-info.c
index cfc59123b00c..ddb042845e86 100644
--- a/fs/btrfs/space-info.c
+++ b/fs/btrfs/space-info.c
@@ -1422,6 +1422,9 @@  static void btrfs_async_reclaim_data_space(struct work_struct *work)
 	fs_info = container_of(work, struct btrfs_fs_info, async_data_reclaim_work);
 	space_info = fs_info->data_sinfo;
 	do_async_reclaim_data_space(space_info);
+	for (int i = 0; i < BTRFS_SPACE_INFO_SUB_GROUP_MAX; i++)
+		if (space_info->sub_group[i])
+			do_async_reclaim_data_space(space_info->sub_group[i]);
 }
 
 void btrfs_init_async_reclaim_work(struct btrfs_fs_info *fs_info)