-static int fio_sgio_getevents(struct thread_data *td, int min, int max,
- struct timespec fio_unused *t)
+static int fio_sgio_getevents(struct thread_data *td, unsigned int min,
+ unsigned int max, struct timespec fio_unused *t)
struct sgio_data *sd = td->io_ops->data;
int left = max, ret, r = 0;
void *buf = sd->sgbuf;
unsigned int i, events;
struct sgio_data *sd = td->io_ops->data;
int left = max, ret, r = 0;
void *buf = sd->sgbuf;
unsigned int i, events;
static int fio_sgio_queue(struct thread_data *td, struct io_u *io_u)
{
struct sg_io_hdr *hdr = &io_u->hdr;
static int fio_sgio_queue(struct thread_data *td, struct io_u *io_u)
{
struct sg_io_hdr *hdr = &io_u->hdr;
- ret = fio_sgio_doio(td, io_u, io_u->ddir == DDIR_SYNC);
+ if (td->o.sync_io || td->o.odirect || ddir_sync(io_u->ddir))
+ do_sync = 1;
+
+ ret = fio_sgio_doio(td, io_u, do_sync);
static int fio_sgio_get_bs(struct thread_data *td, unsigned int *bs)
{
struct sgio_data *sd = td->io_ops->data;
static int fio_sgio_get_bs(struct thread_data *td, unsigned int *bs)
{
struct sgio_data *sd = td->io_ops->data;
- hdr = &io_u->hdr;
- sgio_hdr_init(sd, hdr, io_u, 0);
+ hdr = &io_u.hdr;
+ sgio_hdr_init(sd, hdr, &io_u, 0);
- if (!sd->type_checked && fio_sgio_type_check(td, f)) {
- generic_close_file(td, f);
+ if (sd && !sd->type_checked && fio_sgio_type_check(td, f)) {
+ ret = generic_close_file(td, f);
.cleanup = fio_sgio_cleanup,
.open_file = fio_sgio_open,
.close_file = generic_close_file,
.cleanup = fio_sgio_cleanup,
.open_file = fio_sgio_open,
.close_file = generic_close_file,