Drop struct thread_data dependency from os headers
authorTomohiro Kusumi <tkusumi@tuxera.com>
Tue, 23 May 2017 18:44:46 +0000 (21:44 +0300)
committerJens Axboe <axboe@fb.com>
Wed, 24 May 2017 02:02:42 +0000 (20:02 -0600)
commit1ed84d86e0e357fd525c91ee41c0a56d4a71ef85
treede321f303b9acc71146489f5a5600803d7da2c32
parenta3e594123de4a010776b6fc2aaac75de35c5251a
Drop struct thread_data dependency from os headers

Since os/os.h is included by fio.h before other functions/structures
are even defined, it's better for os/os*.h not to have dependency on
those (in this case it's struct thread_data and duplicated td_fill_
rand_seeds() prototypes) unless really needed. os/os*.h are basically
collections of small wrappers over syscalls/etc whose idea is similar
but with difference interface among supported platforms, thus they
normally don't need to have dependency on fio functions/structures,
and in fact they're normally designed that way.

This commit gets rid of struct thread_data argument from an inlined
function init_random_state(), which was needed only to call another
function td_fill_rand_seeds(td). This can simply be called from
setup_random_seeds() after init_random_state() without making any
functional difference. Also rename init_random_state() to
init_random_seeds() as it only initializes random seeds now.

With this commit, struct thread_data is completely gone from os/.
struct fio_file is still there, but this is needed by Windows where
the idea of fd differs from unix like in general.

Signed-off-by: Tomohiro Kusumi <tkusumi@tuxera.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
init.c
os/os-windows.h
os/os.h