patch-2.2.0-pre1 linux/fs/devices.c

Next file: linux/fs/fat/file.c
Previous file: linux/fs/dcache.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.132/linux/fs/devices.c linux/fs/devices.c
@@ -210,11 +210,11 @@
 		return 0;
 
 	printk(KERN_DEBUG "VFS: Disk change detected on device %s\n",
-		kdevname(dev));
+		bdevname(dev));
 
 	sb = get_super(dev);
 	if (sb && invalidate_inodes(sb))
-		printk("VFS: busy inodes on changed media..\n");
+		printk("VFS: busy inodes on changed media.\n");
 
 	invalidate_buffers(dev);
 
@@ -338,13 +338,35 @@
 };
 
 /*
- * Print device name (in decimal, hexadecimal or symbolic) -
- * at present hexadecimal only.
+ * Print device name (in decimal, hexadecimal or symbolic)
  * Note: returns pointer to static data!
  */
 char * kdevname(kdev_t dev)
 {
 	static char buffer[32];
 	sprintf(buffer, "%02x:%02x", MAJOR(dev), MINOR(dev));
+	return buffer;
+}
+
+char * bdevname(kdev_t dev)
+{
+	static char buffer[32];
+	const char * name = blkdevs[MAJOR(dev)].name;
+
+	if (!name)
+		name = "unknown-block";
+
+	sprintf(buffer, "%s(%d,%d)", name, MAJOR(dev), MINOR(dev));
+	return buffer;
+}
+
+char * cdevname(kdev_t dev)
+{
+	static char buffer[32];
+	const char * name = chrdevs[MAJOR(dev)].name;
+
+	if (!name)
+		name = "unknown-char";
+	sprintf(buffer, "%s(%d,%d)", name, MAJOR(dev), MINOR(dev));
 	return buffer;
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov