Remove/Move Linux specific sysfs_root field from thread_data
authorTomohiro Kusumi <tkusumi@tuxera.com>
Mon, 23 Jan 2017 15:13:11 +0000 (00:13 +0900)
committerJens Axboe <axboe@fb.com>
Mon, 23 Jan 2017 15:26:12 +0000 (08:26 -0700)
commitbd4d9bdc5097c3b35b5172508e1a2828296e01c2
treeca9f4cb7202405dc61c508c3c1373441ef82fefc
parent2a20eebccf88b3be2c56d4b5cd6cb4466b289e4f
Remove/Move Linux specific sysfs_root field from thread_data

struct thread_data is better without having a Linux specific field
(even if sysfs_root is simply unused on non Linux environment) given
that other Linux specific code such as diskutil/cgroup/blktrace/etc
are compiled only on Linux.

This commit uses td->files[0]->du->sysfs_root instead of td->sysfs_root,
but results the same from the way diskutil is currently implemented.
Besides being platform independent, it's also better in terms of data
structure since sysfs_root isn't always per-td attribute as mentioned
below.

For example, when N(>1) files are specified via filename= option
(e.g. filename=/dev/sdb:/dev/sdc for N=2), td:files is 1:N, therefore
td:du and td:du->sysfs_root are also 1:N in case of /dev/sdb:/dev/sdc,
however td:td->sysfs_root is obviously 1:1 which in this case means
td->sysfs_root is sysfs root for /dev/sdb (regardless of other files)
from the way td->sysfs_root is set only if it hasn't yet been set.

In other words, if filename=/dev/sdb:/dev/sdc is given, ioscheduler=
option only works against /dev/sdb, which could be different from what
users would expect, but this commit just removes sysfs_root from
struct thread_data without any functional change.

Signed-off-by: Tomohiro Kusumi <tkusumi@tuxera.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
backend.c
diskutil.c
filesetup.c
fio.h