[PATCH] First cut at supporting > 1 file per job
This is likely very buggy, a simple test works though.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/stat.c b/stat.c
index 7f38d96..e43a336 100644
--- a/stat.c
+++ b/stat.c
@@ -187,6 +187,7 @@
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 @@
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 @@
/*
* 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");