[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[dm-devel] [PATCH] 2.4: Use bdevname() when generating STATUSTYPE_TABLE strings



When generating STATUSTYPE_TABLE strings, use bdevname() instead of kdevname()
so the device-name will match the ones generated in the 2.5 kernels. This
should keep the user-space tools simpler, since they will only have to parse
one form of the device-name strings.

diff -Naur linux-2.4.20-dm-7/drivers/md/dm-linear.c linux-2.4.20-evms-1.9.0-pre3/drivers/md/dm-linear.c
--- linux-2.4.20-dm-7/drivers/md/dm-linear.c	Tue Feb  4 14:28:39 2003
+++ linux-2.4.20-evms-1.9.0-pre3/drivers/md/dm-linear.c	Tue Feb  4 14:26:44 2003
@@ -87,7 +87,7 @@
 
 	case STATUSTYPE_TABLE:
 		snprintf(result, maxlen, "%s " SECTOR_FORMAT,
-			 kdevname(to_kdev_t(lc->dev->bdev->bd_dev)), lc->start);
+			 bdevname(lc->dev->dev), lc->start);
 		break;
 	}
 	return 0;
diff -Naur linux-2.4.20-dm-7/drivers/md/dm-snapshot.c linux-2.4.20-evms-1.9.0-pre3/drivers/md/dm-snapshot.c
--- linux-2.4.20-dm-7/drivers/md/dm-snapshot.c	Tue Feb  4 14:28:39 2003
+++ linux-2.4.20-evms-1.9.0-pre3/drivers/md/dm-snapshot.c	Tue Feb  4 14:26:44 2003
@@ -963,8 +958,8 @@
 		 * to make private copies if the output is to
 		 * make sense.
 		 */
-		strncpy(cow, kdevname(snap->cow->dev), sizeof(cow));
-		strncpy(org, kdevname(snap->origin->dev), sizeof(org));
+		strncpy(cow, bdevname(snap->cow->dev), sizeof(cow));
+		strncpy(org, bdevname(snap->origin->dev), sizeof(org));
 		snprintf(result, maxlen, "%s %s %c %ld", org, cow,
 			 snap->type, snap->chunk_size);
 		break;
@@ -1050,7 +1045,7 @@
 		break;
 
 	case STATUSTYPE_TABLE:
-		snprintf(result, maxlen, "%s", kdevname(dev->dev));
+		snprintf(result, maxlen, "%s", bdevname(dev->dev));
 		break;
 	}
 
diff -Naur linux-2.4.20-dm-7/drivers/md/dm-stripe.c linux-2.4.20-evms-1.9.0-pre3/drivers/md/dm-stripe.c
--- linux-2.4.20-dm-7/drivers/md/dm-stripe.c	Tue Feb  4 14:28:39 2003
+++ linux-2.4.20-evms-1.9.0-pre3/drivers/md/dm-stripe.c	Tue Feb  4 14:26:44 2003
@@ -221,7 +221,7 @@
 			offset +=
 			    snprintf(result + offset, maxlen - offset,
 				     " %s " SECTOR_FORMAT,
-		       kdevname(to_kdev_t(sc->stripe[i].dev->bdev->bd_dev)),
+				     bdevname(sc->stripe[i].dev->dev),
 				     sc->stripe[i].physical_start);
 		}
 		break;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]