patch-1.3.28 linux/fs/devices.c

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

diff -u --recursive --new-file v1.3.27/linux/fs/devices.c linux/fs/devices.c
@@ -139,7 +139,7 @@
  * People changing diskettes in the middle of an operation deserve
  * to loose :-)
  */
-int check_disk_change(dev_t dev)
+int check_disk_change(kdev_t dev)
 {
 	int i;
 	struct file_operations * fops;
@@ -152,8 +152,8 @@
 	if (!fops->check_media_change(dev))
 		return 0;
 
-	printk(KERN_DEBUG "VFS: Disk change detected on device %d/%d\n",
-					MAJOR(dev), MINOR(dev));
+	printk(KERN_DEBUG "VFS: Disk change detected on device %s\n",
+		kdevname(dev));
 	for (i=0 ; i<NR_SUPER ; i++)
 		if (super_blocks[i].s_dev == dev)
 			put_super(super_blocks[i].s_dev);
@@ -266,3 +266,15 @@
 	NULL,			/* truncate */
 	NULL			/* permission */
 };
+
+/*
+ * Print device name (in decimal, hexadecimal or symbolic) -
+ * at present hexadecimal only.
+ * 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;
+}

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this