f2fs: deliver the accumulated 'issued' to __issue_discard_cmd_orderly()
authorYuwei Guan <Yuwei.Guan@zeekrlife.com>
Tue, 13 Dec 2022 09:34:19 +0000 (17:34 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Fri, 6 Jan 2023 23:13:42 +0000 (15:13 -0800)
commit185a453bf1b5688f8c77f2646b0b6f3b1cbdddca
treefc76d80d488d6be34a592a50d243cb3942a4a0e8
parent8358014d6be8f3cb507d247d6a623e5961f848d0
f2fs: deliver the accumulated 'issued' to __issue_discard_cmd_orderly()

Any of the following scenarios will send more than the number of
max_requests at a time, which will not meet the design of the
max_requests limit.

- Set max_ordered_discard larger than discard_granularity from userspace.
- It is a small size device, discard_granularity can be tuned to 1 in
  f2fs_tuning_parameters().

We need to deliver the accumulated @issued to __issue_discard_cmd_orderly()
to meet the max_requests limit.

BTW, convert the parameter type of @issued in __submit_discard_cmd().

Signed-off-by: Yuwei Guan <Yuwei.Guan@zeekrlife.com>
Cc: Bagas Sanjaya <bagasdotme@gmail.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/segment.c