Lines Matching refs:td

64 static int fio_sgio_getevents(struct thread_data *td, unsigned int min,
67 struct sgio_data *sd = td->io_ops->data;
76 for_each_file(td, f, i) {
96 ret = poll(sd->pfds, td->o.nr_files, -1);
100 td_verror(td, errno, "poll");
105 if (pollin_events(sd->pfds, td->o.nr_files))
115 for_each_file(td, f, i) {
121 td_verror(td, errno, "read");
147 for_each_file(td, f, i) {
159 static int fio_sgio_ioctl_doio(struct thread_data *td,
162 struct sgio_data *sd = td->io_ops->data;
194 static int fio_sgio_doio(struct thread_data *td, struct io_u *io_u, int do_sync)
199 return fio_sgio_ioctl_doio(td, f, io_u);
204 static int fio_sgio_prep(struct thread_data *td, struct io_u *io_u)
207 struct sgio_data *sd = td->io_ops->data;
246 static int fio_sgio_queue(struct thread_data *td, struct io_u *io_u)
251 fio_ro_check(td, io_u);
253 if (td->o.sync_io || td->o.odirect || ddir_sync(io_u->ddir))
256 ret = fio_sgio_doio(td, io_u, do_sync);
266 td_verror(td, io_u->error, "xfer");
273 static struct io_u *fio_sgio_event(struct thread_data *td, int event)
275 struct sgio_data *sd = td->io_ops->data;
280 static int fio_sgio_get_bs(struct thread_data *td, unsigned int *bs)
282 struct sgio_data *sd = td->io_ops->data;
289 io_u.file = td->files[0];
300 ret = fio_sgio_doio(td, &io_u, 1);
308 static void fio_sgio_cleanup(struct thread_data *td)
310 struct sgio_data *sd = td->io_ops->data;
322 static int fio_sgio_init(struct thread_data *td)
328 sd->cmds = malloc(td->o.iodepth * sizeof(struct sgio_cmd));
329 memset(sd->cmds, 0, td->o.iodepth * sizeof(struct sgio_cmd));
330 sd->events = malloc(td->o.iodepth * sizeof(struct io_u *));
331 memset(sd->events, 0, td->o.iodepth * sizeof(struct io_u *));
332 sd->pfds = malloc(sizeof(struct pollfd) * td->o.nr_files);
333 memset(sd->pfds, 0, sizeof(struct pollfd) * td->o.nr_files);
334 sd->fd_flags = malloc(sizeof(int) * td->o.nr_files);
335 memset(sd->fd_flags, 0, sizeof(int) * td->o.nr_files);
336 sd->sgbuf = malloc(sizeof(struct sg_io_hdr) * td->o.iodepth);
337 memset(sd->sgbuf, 0, sizeof(struct sg_io_hdr) * td->o.iodepth);
339 td->io_ops->data = sd;
344 td->o.override_sync = 1;
348 static int fio_sgio_type_check(struct thread_data *td, struct fio_file *f)
350 struct sgio_data *sd = td->io_ops->data;
355 td_verror(td, errno, "ioctl");
362 td_verror(td, errno, "ioctl");
366 ret = fio_sgio_get_bs(td, &bs);
377 td->io_ops->getevents = NULL;
378 td->io_ops->event = NULL;
384 static int fio_sgio_open(struct thread_data *td, struct fio_file *f)
386 struct sgio_data *sd = td->io_ops->data;
389 ret = generic_open_file(td, f);
393 if (sd && !sd->type_checked && fio_sgio_type_check(td, f)) {
394 ret = generic_close_file(td, f);
423 static int fio_sgio_init(struct thread_data fio_unused *td)