X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=stat.c;h=e43a336108f0f78c18dcc28d5baf6cd1859b576c;hp=7f38d96da7093d90c1af1eac5d51d0b3b6777bfa;hb=53cdc6864f7471b28cc9b40a5314ab43e5b1cb5e;hpb=aad39f4a045ea562c8e4b93db194d65d1e3570db;ds=sidebyside diff --git a/stat.c b/stat.c index 7f38d96d..e43a3361 100644 --- a/stat.c +++ b/stat.c @@ -187,6 +187,7 @@ static int find_block_dir(dev_t dev, char *path) void init_disk_util(struct thread_data *td) { + struct fio_file *f; struct stat st; char foo[256], tmp[256]; dev_t dev; @@ -195,7 +196,11 @@ void init_disk_util(struct thread_data *td) if (!td->do_disk_util) return; - if (!stat(td->file_name, &st)) { + /* + * Just use the same file, they are on the same device. + */ + f = &td->files[0]; + if (!stat(f->file_name, &st)) { if (S_ISBLK(st.st_mode)) dev = st.st_rdev; else @@ -204,7 +209,7 @@ void init_disk_util(struct thread_data *td) /* * must be a file, open "." in that path */ - strcpy(foo, td->file_name); + strcpy(foo, f->file_name); p = dirname(foo); if (stat(p, &st)) { perror("disk util stat");