verify/trim: make trim_backlog_batch work
authorVincent Fu <vincentfu@gmail.com>
Mon, 31 Mar 2025 14:01:32 +0000 (10:01 -0400)
committerVincent Fu <vincent.fu@samsung.com>
Mon, 7 Apr 2025 14:54:38 +0000 (10:54 -0400)
commit46f2285626fd96c1f631fbd06cea076a90edb87c
treea607a78c2ef95aced191ae35cebacf047e2de51c
parent67379ba4a842b8cad6077c33752ff1783235d155
verify/trim: make trim_backlog_batch work

In order to detect when we are at the beginning of a trim phase we check
io_hist_len and should check that the previous operation was not a
*trim* (instead of not a read). Without this change trim_backlog_batch
will have no effect because after one batch is done, fio will simply
start a new batch because io_hist_len is still a multiple of
trim_backlog and the last operation in a batch was a trim which is not a
read.

For check_get_verify checking against read is appropriate but for
check_get_trim we must check against a trim.

Also we need to decrement the trim_batch count for the first trim
operation we send through.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
io_u.c