static int fio_sgio_get_bs(struct thread_data *td, unsigned int *bs)
{
struct sgio_data *sd = td->io_ops->data;
- struct io_u *io_u;
+ struct io_u io_u;
struct sg_io_hdr *hdr;
unsigned char buf[8];
int ret;
- io_u = __get_io_u(td);
- io_u->file = td->files[0];
- assert(io_u);
+ memset(&io_u, 0, sizeof(io_u));
+ io_u.file = td->files[0];
- hdr = &io_u->hdr;
- sgio_hdr_init(sd, hdr, io_u, 0);
+ hdr = &io_u.hdr;
+ sgio_hdr_init(sd, hdr, &io_u, 0);
memset(buf, 0, sizeof(buf));
hdr->cmdp[0] = 0x25;
hdr->dxferp = buf;
hdr->dxfer_len = sizeof(buf);
- ret = fio_sgio_doio(td, io_u, 1);
- if (ret) {
- put_io_u(td, io_u);
+ ret = fio_sgio_doio(td, &io_u, 1);
+ if (ret)
return ret;
- }
*bs = (buf[4] << 24) | (buf[5] << 16) | (buf[6] << 8) | buf[7];
- put_io_u(td, io_u);
return 0;
}