X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=engines%2Ffusion-aw.c;h=0bc5c0b32ddf00d2dec489e1fe9a5861335a3854;hb=cb44aa1f72811770d50e1ba5da3d96f2beb51025;hp=9aac43a9af3216300bf5fd2ac50cb81a0384cd56;hpb=d79db1222039e906dd49ae290daa59701f4e2385;p=fio.git diff --git a/engines/fusion-aw.c b/engines/fusion-aw.c index 9aac43a9..0bc5c0b3 100644 --- a/engines/fusion-aw.c +++ b/engines/fusion-aw.c @@ -22,16 +22,14 @@ #include "../fio.h" -#ifdef FIO_HAVE_FUSION_AW - -#include +#include /* Fix sector size to 512 bytes independent of actual sector size, just like * the linux kernel. */ #define SECTOR_SHIFT 9 #define SECTOR_SIZE (1U<file->file_data; + struct acs_engine_data *d = + (struct acs_engine_data *) io_u->file->engine_data; if (io_u->ddir != DDIR_WRITE) { td_vmsg(td, -EIO, "only writes supported", "io_u->ddir"); @@ -88,7 +87,6 @@ static int queue(struct thread_data *td, struct io_u *io_u) goto out; } else { io_u->error = 0; - io_u->file->file_pos = io_u->offset + rc; rc = FIO_Q_COMPLETED; } @@ -102,7 +100,7 @@ out: static int open_file(struct thread_data *td, struct fio_file *f) { int rc; - struct acs_file_data *d = NULL; + struct acs_engine_data *d = NULL; d = malloc(sizeof(*d)); if (!d) { @@ -110,7 +108,7 @@ static int open_file(struct thread_data *td, struct fio_file *f) rc = -ENOMEM; goto error; } - f->file_data = d; + f->engine_data = (uintptr_t) d; rc = generic_open_file(td, f); @@ -119,7 +117,7 @@ out: error: f->fd = -1; - f->file_data = NULL; + f->engine_data = 0; if (d) free(d); @@ -128,9 +126,9 @@ error: static int close_file(struct thread_data *td, struct fio_file *f) { - if (f->file_data) { - free(f->file_data); - f->file_data = NULL; + if (f->engine_data) { + free((void *) f->engine_data); + f->engine_data = 0; } return generic_close_file(td, f); @@ -146,22 +144,6 @@ static struct ioengine_ops ioengine = { .flags = FIO_SYNCIO | FIO_RAWIO | FIO_MEMALIGN }; -#else /* !FUSION_HAVE_FUSION_AW */ - -static int fio_fusion_aw_eng_init(struct thread_data fio_unused *td) -{ - log_err("fio: fusion atomic write engine not available\n"); - return 1; -} - -static struct ioengine_ops ioengine = { - .name = "fusion-aw-sync", - .version = FIO_IOOPS_VERSION, - .init = fio_fusion_aw_eng_init, -}; - -#endif /* FUSION_HAVE_FUSION_AW */ - static void fio_init fio_fusion_aw_init(void) { register_ioengine(&ioengine);