options: Support arbitrarily long pattern buffers
authorLogan Gunthorpe <logang@deltatee.com>
Fri, 18 Nov 2022 23:15:59 +0000 (16:15 -0700)
committerVincent Fu <vincent.fu@samsung.com>
Sat, 19 Nov 2022 00:36:10 +0000 (19:36 -0500)
commit1dc47d6bccb7c64ee8cd3923e5ec9e8d3bb8a96e
treea8dd8b2e7e636e278f97d39f363c1fa802f4047a
parentaccccb191e6c20242e3f7ad7b5f705dcba118a11
options: Support arbitrarily long pattern buffers

Dynamically allocate the pattern buffer to remove the 512B length
restriction. To accomplish this, store a pointer instead of a fixed
block of memory for the buffers in the thread_options structure.
Then introduce and use the function parse_and_fill_pattern_alloc()
which will calculate the approprite size of the buffer and allocate
it before filling it.

The buffers will be freed, along with a number of string buffers
in free_thread_options_to_cpu(). They will also be reallocated (if
necessary) when receiving them over the wire with
convert_thread_options_to_cpu().

This allows for specifying real world compressible data (eg. The
Calgary Corpus) for the buffer_pattern option.

Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
cconv.c
lib/pattern.c
lib/pattern.h
options.c
stat.h
thread_options.h