Skip to contentSkip to conversation

remove devfs special casing from disk_name

RFC PATCH New Christoph Hellwig 1 participant 1 message May 4, 2003

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 remove devfs special casing from disk_name

Currently disk_name() does some special casing to print the devfs pathname for a gendisk instead of the disk_name as used all over the kernel (which is the same/similar to the old-style device name but not in any way connected to it). There's two problems with this

a) the devfs name is often too long for BDEVNAME_SIZE and thus gets truncated by snprintf
b) having the kernel behave differently depending on whether devfs is compiled in or not is a bad thing. One of my goals for 2.5 is that devfs has no effect on the kernel except creating the devfs entries.

If there's some reason you can't live with the change below please speak up (and no, "the devfs name looks prettier" or "it would confuse Aunt Tillie" are not good enough arguments).

fs/partitions/check.c +0 -13
@@ -96,19 +96,6 @@
 
 char *disk_name(struct gendisk *hd, int part, char *buf)
 {
-#ifdef CONFIG_DEVFS_FS
-	if (hd->devfs_name[0] != '\0') {
-		if (part)
-			snprintf(buf, BDEVNAME_SIZE, "%s/part%d",
-					hd->devfs_name, part);
-		else if (hd->minors != 1)
-			snprintf(buf, BDEVNAME_SIZE, "%s/disc", hd->devfs_name);
-		else
-			snprintf(buf, BDEVNAME_SIZE, "%s", hd->devfs_name);
-		return buf;
-	}
-#endif
-
 	if (!part)
 		snprintf(buf, BDEVNAME_SIZE, "%s", hd->disk_name);
 	else if (isdigit(hd->disk_name[strlen(hd->disk_name)-1]))