[dm-devel] [PATCH] 2.6.0-test3: Use format_dev_t

Kevin Corry kevcorry at us.ibm.com
Thu Aug 14 15:04:01 UTC 2003


This patch changes dm-linear and dm-stripe to use the new format_dev_t(),
defined in include/linux/kdev_t.h, instead of bdevname() when printing target
parameters.

format_dev_t() is very similar to dm_bdevname() in 2.4 (which has also been
proposed for 2.6). The print formats used are:
dm_bdevname:  %03d:%03d
format_dev_t:  %u:%u

Is there a reason DM needs zero-filled, 3-digit numbers for major and minor?
If not, format_dev_t() seems like it will be the preferred method for printing
device numbers in 2.6.

http://linux.bkbits.net:8080/linux-2.5/related/include/linux/kdev_t.h?nav=index.html|src/|src/include|src/include/linux

-- 
Kevin Corry
kevcorry at us.ibm.com
http://evms.sourceforge.net/


--- linux-2.6.0-test3a/drivers/md/dm-linear.c	2003-08-08 23:37:20.000000000 -0500
+++ linux-2.6.0-test3b/drivers/md/dm-linear.c	2003-08-14 14:40:57.000000000 -0500
@@ -88,7 +88,7 @@
 
 	case STATUSTYPE_TABLE:
 		snprintf(result, maxlen, "%s " SECTOR_FORMAT,
-			 bdevname(lc->dev->bdev, b), lc->start);
+			 format_dev_t(b, lc->dev->bdev->bd_dev), lc->start);
 		break;
 	}
 	return 0;
--- linux-2.6.0-test3a/drivers/md/dm-stripe.c	2003-08-08 23:36:40.000000000 -0500
+++ linux-2.6.0-test3b/drivers/md/dm-stripe.c	2003-08-14 14:41:37.000000000 -0500
@@ -201,7 +201,7 @@
 			offset +=
 			    snprintf(result + offset, maxlen - offset,
 				     " %s " SECTOR_FORMAT,
-		       bdevname(sc->stripe[i].dev->bdev, b),
+				     format_dev_t(b, sc->stripe[i].dev->bdev->bd_dev),
 				     sc->stripe[i].physical_start);
 		}
 		break;





More information about the dm-devel mailing list