o->compress_percentage = le32_to_cpu(top->compress_percentage);
o->compress_chunk = le32_to_cpu(top->compress_chunk);
o->dedupe_percentage = le32_to_cpu(top->dedupe_percentage);
- o->skip_bad = le32_to_cpu(top->skip_bad);
o->block_error_hist = le32_to_cpu(top->block_error_hist);
o->replay_align = le32_to_cpu(top->replay_align);
o->replay_scale = le32_to_cpu(top->replay_scale);
top->compress_chunk = cpu_to_le32(o->compress_chunk);
top->dedupe_percentage = cpu_to_le32(o->dedupe_percentage);
top->block_error_hist = cpu_to_le32(o->block_error_hist);
- top->skip_bad = cpu_to_le32(o->skip_bad);
top->replay_align = cpu_to_le32(o->replay_align);
top->replay_scale = cpu_to_le32(o->replay_scale);
top->per_job_logs = cpu_to_le32(o->per_job_logs);
#include <mtd/mtd-user.h>
#include "../fio.h"
+#include "../optgroup.h"
#include "../verify.h"
#include "../oslib/libmtd.h"
struct mtd_dev_info info;
};
+struct fio_mtd_options {
+ void *pad; /* avoid off1 == 0 */
+ unsigned int skip_bad;
+};
+
+static struct fio_option options[] = {
+ {
+ .name = "skip_bad",
+ .lname = "Skip operations against bad blocks",
+ .type = FIO_OPT_BOOL,
+ .off1 = offsetof(struct fio_mtd_options, skip_bad),
+ .help = "Skip operations against known bad blocks.",
+ .hide = 1,
+ .def = "0",
+ .category = FIO_OPT_C_ENGINE,
+ .group = FIO_OPT_G_MTD,
+ },
+ {
+ .name = NULL,
+ },
+};
+
static int fio_mtd_maybe_mark_bad(struct thread_data *td,
struct fio_mtd_data *fmd,
struct io_u *io_u, int eb)
{
struct fio_file *f = io_u->file;
struct fio_mtd_data *fmd = FILE_ENG_DATA(f);
+ struct fio_mtd_options *o = td->eo;
int local_offs = 0;
int ret;
(int)fmd->info.eb_size - eb_offs);
char *buf = ((char *)io_u->buf) + local_offs;
- if (td->o.skip_bad) {
+ if (o->skip_bad) {
ret = fio_mtd_is_bad(td, fmd, io_u, eb);
if (ret == -1)
break;
.close_file = fio_mtd_close_file,
.get_file_size = fio_mtd_get_file_size,
.flags = FIO_SYNCIO | FIO_NOEXTEND,
+ .options = options,
+ .option_struct_size = sizeof(struct fio_mtd_options),
};
static void fio_init fio_mtd_register(void)
.category = FIO_OPT_C_IO,
.group = FIO_OPT_G_IO_FLOW,
},
- {
- .name = "skip_bad",
- .lname = "Skip operations against bad blocks",
- .type = FIO_OPT_BOOL,
- .off1 = offsetof(struct thread_options, skip_bad),
- .help = "Skip operations against known bad blocks.",
- .hide = 1,
- .def = "0",
- .category = FIO_OPT_C_IO,
- .group = FIO_OPT_G_MTD,
- },
{
.name = "steadystate",
.lname = "Steady state threshold",
fio_fp64_t latency_percentile;
unsigned block_error_hist;
- unsigned int skip_bad;
unsigned int replay_align;
unsigned int replay_scale;
fio_fp64_t latency_percentile;
uint32_t block_error_hist;
- uint32_t skip_bad;
uint32_t replay_align;
uint32_t replay_scale;