Add support for file appends
Add option file_append (bool). If set, fio will append to a file
instead of operate within the size of it. This is similar to
setting offset= to the size of each file.
Signed-off-by: Jens Axboe <axboe@fb.com>
diff --git a/options.c b/options.c
index 4ff4c9b..4a54c98 100644
--- a/options.c
+++ b/options.c
@@ -1002,6 +1002,15 @@
return ret;
}
+static int str_buffer_compress_cb(void *data, unsigned long long *il)
+{
+ struct thread_data *td = data;
+
+ td->flags |= TD_F_COMPRESS;
+ td->o.compress_percentage = *il;
+ return 0;
+}
+
static int str_verify_pattern_cb(void *data, const char *input)
{
struct thread_data *td = data;
@@ -1606,6 +1615,16 @@
.group = FIO_OPT_G_INVALID,
},
{
+ .name = "file_append",
+ .lname = "File append",
+ .type = FIO_OPT_BOOL,
+ .off1 = td_var_offset(file_append),
+ .help = "IO will start at the end of the file(s)",
+ .def = "0",
+ .category = FIO_OPT_C_FILE,
+ .group = FIO_OPT_G_INVALID,
+ },
+ {
.name = "offset",
.lname = "IO offset",
.alias = "fileoffset",
@@ -3118,7 +3137,7 @@
.name = "buffer_compress_percentage",
.lname = "Buffer compression percentage",
.type = FIO_OPT_INT,
- .off1 = td_var_offset(compress_percentage),
+ .cb = str_buffer_compress_cb,
.maxval = 100,
.minval = 0,
.help = "How compressible the buffer is (approximately)",