randtrimwrite: write at same offset as trim
authorVincent Fu <vincent.fu@samsung.com>
Thu, 29 Sep 2022 23:58:17 +0000 (16:58 -0700)
committerVincent Fu <vincent.fu@samsung.com>
Mon, 3 Oct 2022 21:36:57 +0000 (17:36 -0400)
commitf9f1e137bbf6afec54102ff7720c1c0c01940199
tree70d8c955ea68f1e91f0ba39cd41034c143db92bd
parent0ebd3bf6186852408503f428c7a74fedd34214cb
randtrimwrite: write at same offset as trim

We need to do a little bit more to make sure that the writes land on the
offsets that were trimmed.

We only have a single random seed for offsets. So we need to just use
the offset from trim commands when issuing writes.

When we have variable block sizes we need to make sure that the trim and
write commands are the same size.

When randommap is enabled we have to let it adjust the block size for
trim commands to make sure that the trim command does not touch any
blocks that have already been touched.

For sizes of write commands just use the size of the trim command.

Fixes: c16dc793a3c45780f67ce65244b6e91323dee014 "Add randtrimwrite data
direction"

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