[PATCH] Added '-' and '_' in dev IDs in devmap file; output dev name, not numbers
authorAlan David Brunelle <Alan.Brunelle@hp.com>
Thu, 21 Sep 2006 07:15:41 +0000 (09:15 +0200)
committerJens Axboe <axboe@kernel.dk>
Thu, 21 Sep 2006 07:15:41 +0000 (09:15 +0200)
Signed-off-by: Alan D. Brunelle <Alan.Brunelle@hp.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
btt/devmap.c
btt/output.c

index 5de57e82b749fec19a0741d963727154ecb78a6f..2227617b78dc9fbaf8f0118d75a27a6e2d7041bf 100644 (file)
@@ -55,7 +55,7 @@ int dev_map_read(char *fname)
                return 1;
        }
 
-       while (fscanf(fp, "%255[a-zA-Z0-9 :.,/]\n", line) == 1) {
+       while (fscanf(fp, "%255[a-zA-Z0-9 :.,/_-]\n", line) == 1) {
                if (strstr(line, "Device") != NULL) continue;
                if (sscanf(line, "%s %s %u %u %u %u %s %s %u %u %s",
                                &dm.device[0], &dm.model[0], &dm.host, &dm.bus,
index 969ccaed7c65dc3c6f4bf224f206e2d59ffb5a70..86dbc583beb453cd9eceb370a0341e674d640e84 100644 (file)
@@ -90,14 +90,11 @@ void __output_avg2(FILE *ofp, char *hdr, struct avgs_info *ap)
 
 char *make_dev_hdr(char *pad, size_t len, struct d_info *dip)
 {
-       if (dip->map == NULL) {
+       if (dip->map == NULL)
                snprintf(pad, len, "(%3d,%3d)", 
                         MAJOR(dip->device), MINOR(dip->device));
-       }
-       else {
-               snprintf(pad, len, "[%3d,%3d]",
-                       dip->map->host, dip->map->target);
-       }
+       else
+               snprintf(pad, len, "%s", dip->map->device);
 
        return pad;
 }