ext4: add EXT4_MB_HINT_GOAL_ONLY test in ext4_mb_use_preallocated
authorKemeng Shi <shikemeng@huaweicloud.com>
Sat, 3 Jun 2023 15:03:13 +0000 (23:03 +0800)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 15 Jun 2023 04:02:10 +0000 (00:02 -0400)
commit1eff590489a213a213c57d96b86f48b32cdf8c3a
treee06eca260ee09de5c9c727b6e712909976d689f6
parentc3defd99d58cbdd132bd197714e5523dac976b66
ext4: add EXT4_MB_HINT_GOAL_ONLY test in ext4_mb_use_preallocated

ext4_mb_use_preallocated will ignore the demand to alloc goal blocks,
although the EXT4_MB_HINT_GOAL_ONLY is requested.
For group pa, ext4_mb_group_or_file will not set EXT4_MB_HINT_GROUP_ALLOC
if EXT4_MB_HINT_GOAL_ONLY is set. So we will not alloc goal blocks from
group pa if EXT4_MB_HINT_GOAL_ONLY is set.
For inode pa, ext4_mb_pa_goal_check is added to check if free extent in
found inode pa meets goal blocks when EXT4_MB_HINT_GOAL_ONLY is set.

Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
Suggested-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>
Link: https://lore.kernel.org/r/20230603150327.3596033-6-shikemeng@huaweicloud.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/mballoc.c