From 47f07ddc7d3354cd6f985b6468989e5e699c4b53 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Mon, 11 Feb 2013 14:35:43 +0100 Subject: [PATCH] Turn f->engine_data into a 64-bit value Even on 32-bit platforms, we store (uint64_t) -1 in there for some cases to make it be 'invalid'. Signed-off-by: Jens Axboe --- engines/binject.c | 12 ++++++------ file.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/engines/binject.c b/engines/binject.c index 7b8522a4..fb190620 100644 --- a/engines/binject.c +++ b/engines/binject.c @@ -69,7 +69,7 @@ static unsigned int binject_read_commands(struct thread_data *td, void *p, one_more: events = 0; for_each_file(td, f, i) { - bf = (struct binject_file *) f->engine_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) @@ -104,7 +104,7 @@ static int fio_binject_getevents(struct thread_data *td, unsigned int min, * Fill in the file descriptors */ for_each_file(td, f, i) { - bf = (struct binject_file *) f->engine_data; + bf = (struct binject_file *) (uintptr_t) f->engine_data; /* * don't block for min events == 0 @@ -153,7 +153,7 @@ static int fio_binject_getevents(struct thread_data *td, unsigned int min, if (!min) { for_each_file(td, f, i) { - bf = (struct binject_file *) f->engine_data; + bf = (struct binject_file *) (uintptr_t) f->engine_data; fcntl(bf->fd, F_SETFL, bd->fd_flags[i]); } } @@ -167,7 +167,7 @@ static int fio_binject_getevents(struct thread_data *td, unsigned int min, 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 = (struct binject_file *) io_u->file->engine_data; + struct binject_file *bf = (struct binject_file *) (uintptr_t) io_u->file->engine_data; int ret; ret = write(bf->fd, buc, sizeof(*buc)); @@ -181,7 +181,7 @@ static int fio_binject_prep(struct thread_data *td, struct io_u *io_u) { struct binject_data *bd = td->io_ops->data; struct b_user_cmd *buc = &io_u->buc; - struct binject_file *bf = (struct binject_file *) io_u->file->engine_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"); @@ -323,7 +323,7 @@ err_unmap: static int fio_binject_close_file(struct thread_data *td, struct fio_file *f) { - struct binject_file *bf = (struct binject_file *) f->engine_data; + struct binject_file *bf = (struct binject_file *) (uintptr_t) f->engine_data; if (bf) { binject_unmap_dev(td, bf); diff --git a/file.h b/file.h index 95ecefe7..eb0688c5 100644 --- a/file.h +++ b/file.h @@ -97,7 +97,7 @@ struct fio_file { /* * For use by the io engine */ - uintptr_t engine_data; + uint64_t engine_data; /* * if io is protected by a semaphore, this is set -- 2.25.1