2 * Note: This is similar to a very basic setup
5 * Specify fdp=1 (With char devices /dev/ng0n1)
18 static int fdp_ruh_info(struct thread_data *td, struct fio_file *f,
19 struct fio_ruhs_info *ruhs)
23 if (td->io_ops && td->io_ops->fdp_fetch_ruhs) {
24 ret = td->io_ops->fdp_fetch_ruhs(td, f, ruhs);
26 td_verror(td, errno, "fdp fetch ruhs failed");
27 log_err("%s: fdp fetch ruhs failed (%d)\n",
31 log_err("%s: engine (%s) lacks fetch ruhs\n",
32 f->file_name, td->io_ops->name);
37 static int init_ruh_info(struct thread_data *td, struct fio_file *f)
39 struct fio_ruhs_info *ruhs, *tmp;
42 ruhs = scalloc(1, sizeof(*ruhs) + 128 * sizeof(*ruhs->plis));
46 ret = fdp_ruh_info(td, f, ruhs);
48 log_info("fio: ruh info failed for %s (%d)\n",
53 if (ruhs->nr_ruhs > 128)
56 if (td->o.fdp_nrpli == 0) {
61 for (i = 0; i < td->o.fdp_nrpli; i++) {
62 if (td->o.fdp_plis[i] > ruhs->nr_ruhs) {
68 tmp = scalloc(1, sizeof(*tmp) + ruhs->nr_ruhs * sizeof(*tmp->plis));
74 tmp->nr_ruhs = td->o.fdp_nrpli;
75 for (i = 0; i < td->o.fdp_nrpli; i++)
76 tmp->plis[i] = ruhs->plis[td->o.fdp_plis[i]];
83 int fdp_init(struct thread_data *td)
88 for_each_file(td, f, i) {
89 ret = init_ruh_info(td, f);
96 void fdp_free_ruhs_info(struct fio_file *f)
104 void fdp_fill_dspec_data(struct thread_data *td, struct io_u *io_u)
106 struct fio_file *f = io_u->file;
107 struct fio_ruhs_info *ruhs = f->ruhs_info;
110 if (!ruhs || io_u->ddir != DDIR_WRITE) {
116 dspec = ruhs->plis[ruhs->pli_loc++ % ruhs->nr_ruhs];