Add buffer_compress_chunk option
Instead of doing bs/2 of incompressible and zeroed data for a 50%
compression setting, use the smaller chunk size specified by
this option.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
diff --git a/io_u.c b/io_u.c
index ca33e58..a0020d2 100644
--- a/io_u.c
+++ b/io_u.c
@@ -1544,8 +1544,11 @@
unsigned int perc = td->o.compress_percentage;
if (perc) {
+ unsigned int seg = min_write;
+
+ seg = min(min_write, td->o.compress_chunk);
fill_random_buf_percentage(&td->buf_state, io_u->buf,
- perc, min_write, max_bs);
+ perc, seg, max_bs);
} else
fill_random_buf(&td->buf_state, io_u->buf, max_bs);
} else