unsigned int queued;
unsigned int head;
unsigned int tail;
+
+ struct cmdprio cmdprio;
};
struct libaio_options {
struct thread_data *td;
unsigned int userspace_reap;
- struct cmdprio cmdprio;
+ struct cmdprio_options cmdprio_options;
unsigned int nowait;
};
-static int str_cmdprio_bssplit_cb(void *data, const char *input)
-{
- struct libaio_options *o = data;
- struct thread_data *td = o->td;
- struct cmdprio *cmdprio = &o->cmdprio;
-
- return fio_cmdprio_bssplit_parse(td, input, cmdprio);
-}
-
static struct fio_option options[] = {
{
.name = "userspace_reap",
.lname = "high priority percentage",
.type = FIO_OPT_INT,
.off1 = offsetof(struct libaio_options,
- cmdprio.percentage[DDIR_READ]),
+ cmdprio_options.percentage[DDIR_READ]),
.off2 = offsetof(struct libaio_options,
- cmdprio.percentage[DDIR_WRITE]),
+ cmdprio_options.percentage[DDIR_WRITE]),
.minval = 0,
.maxval = 100,
.help = "Send high priority I/O this percentage of the time",
.lname = "Asynchronous I/O priority class",
.type = FIO_OPT_INT,
.off1 = offsetof(struct libaio_options,
- cmdprio.class[DDIR_READ]),
+ cmdprio_options.class[DDIR_READ]),
.off2 = offsetof(struct libaio_options,
- cmdprio.class[DDIR_WRITE]),
+ cmdprio_options.class[DDIR_WRITE]),
.help = "Set asynchronous IO priority class",
.minval = IOPRIO_MIN_PRIO_CLASS + 1,
.maxval = IOPRIO_MAX_PRIO_CLASS,
.lname = "Asynchronous I/O priority level",
.type = FIO_OPT_INT,
.off1 = offsetof(struct libaio_options,
- cmdprio.level[DDIR_READ]),
+ cmdprio_options.level[DDIR_READ]),
.off2 = offsetof(struct libaio_options,
- cmdprio.level[DDIR_WRITE]),
+ cmdprio_options.level[DDIR_WRITE]),
.help = "Set asynchronous IO priority level",
.minval = IOPRIO_MIN_PRIO,
.maxval = IOPRIO_MAX_PRIO,
{
.name = "cmdprio_bssplit",
.lname = "Priority percentage block size split",
- .type = FIO_OPT_STR_ULL,
- .cb = str_cmdprio_bssplit_cb,
- .off1 = offsetof(struct libaio_options, cmdprio.bssplit),
+ .type = FIO_OPT_STR_STORE,
+ .off1 = offsetof(struct libaio_options,
+ cmdprio_options.bssplit_str),
.help = "Set priority percentages for different block sizes",
.category = FIO_OPT_C_ENGINE,
.group = FIO_OPT_G_LIBAIO,
static inline void fio_libaio_cmdprio_prep(struct thread_data *td,
struct io_u *io_u)
{
- struct libaio_options *o = td->eo;
- struct cmdprio *cmdprio = &o->cmdprio;
+ struct libaio_data *ld = td->io_ops_data;
+ struct cmdprio *cmdprio = &ld->cmdprio;
if (fio_cmdprio_set_ioprio(td, cmdprio, io_u)) {
io_u->iocb.aio_reqprio = io_u->ioprio;
struct io_u *io_u)
{
struct libaio_data *ld = td->io_ops_data;
- struct libaio_options *o = td->eo;
fio_ro_check(td, io_u);
return FIO_Q_COMPLETED;
}
- if (o->cmdprio.mode != CMDPRIO_MODE_NONE)
+ if (ld->cmdprio.mode != CMDPRIO_MODE_NONE)
fio_libaio_cmdprio_prep(td, io_u);
ld->iocbs[ld->head] = &io_u->iocb;
*/
if (!(td->flags & TD_F_CHILD))
io_destroy(ld->aio_ctx);
+
+ fio_cmdprio_cleanup(&ld->cmdprio);
free(ld->aio_events);
free(ld->iocbs);
free(ld->io_us);
{
struct libaio_data *ld;
struct libaio_options *o = td->eo;
- struct cmdprio *cmdprio = &o->cmdprio;
int ret;
ld = calloc(1, sizeof(*ld));
td->io_ops_data = ld;
- ret = fio_cmdprio_init(td, cmdprio);
+ ret = fio_cmdprio_init(td, &ld->cmdprio, &o->cmdprio_options);
if (ret) {
td_verror(td, EINVAL, "fio_libaio_init");
return 1;