Skip to content

Commit

Permalink
f2fs: enable fstrim to issue discard while using discard option
Browse files Browse the repository at this point in the history
MIUI-1428085

The discard thread can only process 8 requests at a time by default.
So fstrim need to handle the remaining discard requests while using
discard option.

Change-Id: I5eac38c34182607e8dceeb13273522b10ce02af8
Signed-off-by: liuchao12 <liuchao12@xiaomi.com>
Signed-off-by: UtsavBalar1231 <utsavbalar1231@gmail.com>
Signed-off-by: Tashfin Shakeer Rhythm <tashfinshakeerrhythm@gmail.com>
Signed-off-by: TogoFire <togofire@mailfence.com>
  • Loading branch information
liuchao12 authored and TogoFire committed Apr 22, 2023
1 parent 59ec5d5 commit 0c7fcc0
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions fs/f2fs/segment.c
Original file line number Diff line number Diff line change
Expand Up @@ -2879,15 +2879,6 @@ int f2fs_trim_fs(struct f2fs_sb_info *sbi, struct fstrim_range *range)
if (err)
goto out;

/*
* We filed discard candidates, but actually we don't need to wait for
* all of them, since they'll be issued in idle time along with runtime
* discard option. User configuration looks like using runtime discard
* or periodic fstrim instead of it.
*/
if (f2fs_realtime_discard_enable(sbi))
goto out;

start_block = START_BLOCK(sbi, start_segno);
end_block = START_BLOCK(sbi, end_segno + 1);

Expand Down

0 comments on commit 0c7fcc0

Please sign in to comment.