#include <sys/time.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/sysmacros.h>
#include <dirent.h>
#include <libgen.h>
#include <math.h>
static struct fio_mutex *disk_util_mutex;
-FLIST_HEAD(disk_list);
-
static struct disk_util *__init_per_file_disk_util(struct thread_data *td,
int majdev, int mindev, char *path);
static void update_io_tick_disk(struct disk_util *du)
{
struct disk_util_stat __dus, *dus, *ldus;
- struct timeval t;
+ struct timespec t;
if (!du->users)
return;
* devices?
*/
linklen = readlink(temppath, slavepath, PATH_MAX - 1);
- if (linklen < 0) {
+ if (linklen < 0) {
perror("readlink() for slave device.");
closedir(dirhandle);
return;
slavepath[linklen] = '\0';
sprintf(temppath, "%s/%s/dev", slavesdir, slavepath);
+ if (access(temppath, F_OK) != 0)
+ sprintf(temppath, "%s/%s/device/dev", slavesdir, slavepath);
if (read_block_dev_entry(temppath, &majdev, &mindev)) {
- perror("Error getting slave device numbers.");
+ perror("Error getting slave device numbers");
closedir(dirhandle);
return;
}
return 0;
while ((dir = readdir(D)) != NULL) {
- char full_path[256];
+ char full_path[257];
if (!strcmp(dir->d_name, ".") || !strcmp(dir->d_name, ".."))
continue;