Age | Commit message (Collapse) | Author |
|
Signed-off-by: Ville Skyttä <ville.skytta@upcloud.com>
|
|
Callers of parse_format() pass a size in bytes while the parse_format()
function itself expects a number of elements. Fix this by making the
fmt_desc[] array NULL-terminated. This patch fixes the following Coverity
complaint:
CID 300986 (#1 of 1): Out-of-bounds access (OVERRUN)
overrun-buffer-arg: Overrunning array fmt_desc of 1 24-byte elements by
passing it to a function which accesses it at element index 23 (byte
offset 575) using argument 24U.
Cc: Roman Pen <r.peniaev@gmail.com>
Fixes: 634bd210c17a ("lib/pattern: add set of functions to parse combined pattern input")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
|
|
Change two occurrences of 'descritor' into 'descriptor'
Cc: Roman Pen <r.peniaev@gmail.com>
Fixes: 634bd210c17a ("lib/pattern: add set of functions to parse combined pattern input")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
|
|
- Try and remove unneeded #include lines
- Try and add #include lines that would allow the files to be built in a
more standalone manner
Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
|
|
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
It is useful to be able to initialize the buffer contents using an
input file (e.g. when testing certain pathological patterns for
compression). Add support to the buffer_pattern input argument for
reading data from a file via enclosing the filename in ``''``.
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Logan Gunthorpe <logang@deltatee.com>
Reviewed-By: Muli Ben-Yehuda <muli@lightbitslabs.com>
Signed-off-by: Stephen Bates <sbates@raithlin.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
|
|
lib/pattern.c not having dependency on fio.h enables it to be
a stand-alone library, which is useful for debugging purpose.
In fact, most of the files under lib/ directory do things this way.
This requires the previous commit.
--
# cat ./test6.c
#include <stdio.h>
#include "lib/pattern.h"
int main(void) {
/* just to see if it compiles */
paste_format_inplace(NULL, 0, NULL, 0, NULL);
return 0;
}
# gcc -Wall -g ./test6.c ./lib/pattern.c ./lib/strntol.c
Signed-off-by: Tomohiro Kusumi <tkusumi@tuxera.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
|
|
Signed-off-by: Jens Axboe <axboe@fb.com>
|
|
The idea of this patch is to have several helpers to parse combined
pattern input, which can consists of strings, numbers and formats.
For example now pattern can be combined and look like this string:
input : 0xdeadbeef"123"0xdeadface
output: de ad be ef 31 32 33 de ad fa ce
or
input : -99"some string"0x66
output: 9d ff ff ff 73 6f 6d 65 20 73 74 72 69 6e 67 66
or with formats
input : 0xdeadface0xffff%o
output: de ad fa ce ff ff 00 00 00 00 00 00 00 00
where %o - offset of the block, reserved 8 bytes
Space for formats is reserved in output buffer.
When buffer will be ready to be written to disk - 'paste' callback
should be called for each pattern format. Each callback is responsible
for writing data inside the reserved space in the output buffer.
Format array can be extended at any time, all you need is to provide
the name of the format and correct 'paste' callback.
Signed-off-by: Roman Pen <r.peniaev@gmail.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
|