From 64cb3e1035e2d6b32ed1390369501e4a7aec52a8 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Thu, 26 Jan 2006 11:04:48 -0800 Subject: [PATCH] [PATCH] sysfs layout fix for md --- fio.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/fio.c b/fio.c index 2fb7da9b..9dd8e249 100644 --- 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); -- 2.25.1