[PATCH] sysfs layout fix for md
authorJens Axboe <axboe@suse.de>
Thu, 26 Jan 2006 19:04:48 +0000 (11:04 -0800)
committerJens Axboe <axboe@suse.de>
Thu, 26 Jan 2006 19:04:48 +0000 (11:04 -0800)
fio.c

diff --git a/fio.c b/fio.c
index 2fb7da9b76c22190e09e39efacd266572b29f63a..9dd8e249122ddfc75122cebb1fbca58d0901a06a 100644 (file)
--- a/fio.c
+++ b/fio.c
@@ -1599,17 +1599,23 @@ static void init_disk_util(struct thread_data *td)
                return;
 
        /*
-        * if this is inside a partition dir, jump back to parent
+        * for md/dm, there's no queue dir. we already have the right place
         */
-       sprintf(tmp, "%s/queue", foo);
+       sprintf(tmp, "%s/stat", foo);
        if (stat(tmp, &st)) {
-               p = dirname(foo);
-               sprintf(tmp, "%s/queue", p);
+               /*
+                * if this is inside a partition dir, jump back to parent
+                */
+               sprintf(tmp, "%s/queue", foo);
                if (stat(tmp, &st)) {
-                       fprintf(stderr, "unknown sysfs layout\n");
-                       return;
+                       p = dirname(foo);
+                       sprintf(tmp, "%s/queue", p);
+                       if (stat(tmp, &st)) {
+                               fprintf(stderr, "unknown sysfs layout\n");
+                               return;
+                       }
+                       sprintf(foo, "%s", p);
                }
-               sprintf(foo, "%s", p);
        }
 
        disk_util_add(dev, foo);