one_more:
events = 0;
for_each_file(td, f, i) {
- bf = f->file_data;
+ bf = (struct binject_file *) (uintptr_t) f->engine_data;
ret = read(bf->fd, p, left * sizeof(struct b_user_cmd));
if (ret < 0) {
if (errno == EAGAIN)
* Fill in the file descriptors
*/
for_each_file(td, f, i) {
- bf = f->file_data;
+ bf = (struct binject_file *) (uintptr_t) f->engine_data;
/*
* don't block for min events == 0
if (!min) {
for_each_file(td, f, i) {
- bf = f->file_data;
+ bf = (struct binject_file *) (uintptr_t) f->engine_data;
fcntl(bf->fd, F_SETFL, bd->fd_flags[i]);
}
}
static int fio_binject_doio(struct thread_data *td, struct io_u *io_u)
{
struct b_user_cmd *buc = &io_u->buc;
- struct binject_file *bf = io_u->file->file_data;
+ struct binject_file *bf = (struct binject_file *) (uintptr_t) io_u->file->engine_data;
int ret;
ret = write(bf->fd, buc, sizeof(*buc));
{
struct binject_data *bd = td->io_ops->data;
struct b_user_cmd *buc = &io_u->buc;
- struct binject_file *bf = io_u->file->file_data;
+ struct binject_file *bf = (struct binject_file *) (uintptr_t) io_u->file->engine_data;
if (io_u->xfer_buflen & (bf->bs - 1)) {
log_err("read/write not sector aligned\n");
static int fio_binject_close_file(struct thread_data *td, struct fio_file *f)
{
- struct binject_file *bf = f->file_data;
+ struct binject_file *bf = (struct binject_file *) (uintptr_t) f->engine_data;
if (bf) {
binject_unmap_dev(td, bf);
free(bf);
- f->file_data = NULL;
+ f->engine_data = 0;
return generic_close_file(td, f);
}
bf = malloc(sizeof(*bf));
bf->bs = bs;
bf->minor = bf->fd = -1;
- f->file_data = bf;
+ f->engine_data = (uintptr_t) bf;
if (binject_map_dev(td, bf, f->fd)) {
err_close:
.open_file = fio_binject_open_file,
.close_file = fio_binject_close_file,
.get_file_size = generic_get_file_size,
- .flags = FIO_RAWIO | FIO_BARRIER,
+ .flags = FIO_RAWIO | FIO_BARRIER | FIO_MEMALIGN,
};
#else /* FIO_HAVE_BINJECT */