X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=diskutil.c;h=789071d197fcd2a4bd2abd9dfc01c1ae4235e954;hp=c3bcec928ac29a6a2b753b3ccf2eaeb583a29dab;hb=89556808ef14a30670390f0f52e5726ee00a1303;hpb=bd4d9bdc5097c3b35b5172508e1a2828296e01c2 diff --git a/diskutil.c b/diskutil.c index c3bcec92..789071d1 100644 --- a/diskutil.c +++ b/diskutil.c @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include @@ -18,8 +19,6 @@ static struct disk_util *last_du; 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); @@ -86,7 +85,7 @@ static int get_io_ticks(struct disk_util *du, struct disk_util_stat *dus) 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; @@ -247,7 +246,7 @@ static void find_add_disk_slaves(struct thread_data *td, char *path, * devices? */ linklen = readlink(temppath, slavepath, PATH_MAX - 1); - if (linklen < 0) { + if (linklen < 0) { perror("readlink() for slave device."); closedir(dirhandle); return; @@ -255,8 +254,10 @@ static void find_add_disk_slaves(struct thread_data *td, char *path, 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; } @@ -365,7 +366,7 @@ static int find_block_dir(int majdev, int mindev, char *path, int link_ok) 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;