Use union for per file engine private data storage
authorTomohiro Kusumi <tkusumi@tuxera.com>
Tue, 7 Mar 2017 20:13:07 +0000 (22:13 +0200)
committerJens Axboe <axboe@fb.com>
Fri, 10 Mar 2017 21:43:37 +0000 (14:43 -0700)
commit710bf9c592b849935e1bcc56ffc805fa1d5f9365
tree2108c7790857f45f5663612a9f7a08b2cb043ba1
parentbf651609cda6c8968edb49d80efe7ee007983f61
Use union for per file engine private data storage

fio_file::engine_data has been used by i/o engines to either keep
the offset or point to engine specific private data with casts.

This commit changes it to a union consists of void* and uint64_t
so get/set of offset/pointer can be done without casts (which is
a common technique used even within this same struct).

This may break external engines on compile time, but fio generally
doesn't care about breakage on external engines (no guarantees on
api/abi compatibility) anyway.

Also confirmed this compiles with pmemblk enabled.

Signed-off-by: Tomohiro Kusumi <tkusumi@tuxera.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
engines/glusterfs_sync.c
engines/pmemblk.c
engines/sync.c
file.h
filesetup.c