mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-10 12:57:06 +09:00
f2fs: fix trim_fs assignment
This is missing fix from upstream. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
@@ -1675,14 +1675,19 @@ static const struct segment_allocation default_salloc_ops = {
|
||||
bool exist_trim_candidates(struct f2fs_sb_info *sbi, struct cp_control *cpc)
|
||||
{
|
||||
__u64 trim_start = cpc->trim_start;
|
||||
bool has_candidate = false;
|
||||
|
||||
mutex_lock(&SIT_I(sbi)->sentry_lock);
|
||||
for (; trim_start <= cpc->trim_end; trim_start++)
|
||||
if (add_discard_addrs(sbi, cpc, true))
|
||||
for (; cpc->trim_start <= cpc->trim_end; cpc->trim_start++) {
|
||||
if (add_discard_addrs(sbi, cpc, true)) {
|
||||
has_candidate = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
mutex_unlock(&SIT_I(sbi)->sentry_lock);
|
||||
|
||||
return trim_start <= cpc->trim_end;
|
||||
cpc->trim_start = trim_start;
|
||||
return has_candidate;
|
||||
}
|
||||
|
||||
int f2fs_trim_fs(struct f2fs_sb_info *sbi, struct fstrim_range *range)
|
||||
|
||||
Reference in New Issue
Block a user