[Yaffs] yaffs on Linux 2.6.9 - patch 6 of 7

Frank Rowand frowand@mvista.com
Thu, 16 Dec 2004 17:36:44 -0800


This is a multi-part message in MIME format.
--------------040607000007070406020601
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit


--------------040607000007070406020601
Content-Type: text/plain;
 name="yaffs_kernel_06_kdevname.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="yaffs_kernel_06_kdevname.patch"

Index: linux-2.6.9/fs/yaffs/yaffs_fs.c
===================================================================
--- linux-2.6.9.orig/fs/yaffs/yaffs_fs.c
+++ linux-2.6.9/fs/yaffs/yaffs_fs.c
@@ -54,13 +54,15 @@
 #include <asm/statfs.h>
 #define UnlockPage(p) unlock_page(p)
 #define Page_Uptodate(page)	test_bit(PG_uptodate, &(page)->flags)
-//#define kdevname(x) cdevname(to_kdev_t(x))
-#define kdevname(x) "(unavailable)"	// temporary fix
+#define yaffs_devname(sb, buf) bdevname(sb->s_bdev, buf)
 
 #else
 
 #include <linux/locks.h>
 
+#define BDEVNAME_SIZE 1
+#define yaffs_devname(sb, buf) kdevname(sb->s_dev)
+
 #endif
 
 
@@ -1301,6 +1303,7 @@
 	struct inode * inode;
 	struct dentry * root;
 	yaffs_Device *dev;
+	char bdevname_buf[BDEVNAME_SIZE];
 	
 	sb->s_magic = YAFFS_MAGIC;
 	sb->s_op = &yaffs_super_ops;
@@ -1309,10 +1312,12 @@
 		printk(KERN_INFO"yaffs: sb is NULL\n");
 	else if(!sb->s_dev)
 		printk(KERN_INFO"yaffs: sb->s_dev is NULL\n");
-	else if(! kdevname(sb->s_dev))
-		printk(KERN_INFO"yaffs: kdevname is NULL\n");
+	else if(! yaffs_devname(sb, bdevname_buf))
+		printk(KERN_INFO"yaffs: yaffs_devname is NULL\n");
 	else
-		printk(KERN_INFO"yaffs: dev is %d name is \"%s\"\n", sb->s_dev, kdevname(sb->s_dev));
+		printk(KERN_INFO"yaffs: dev is %u.%u name is \"%s\"\n",
+		       MAJOR(sb->s_dev), MINOR(sb->s_dev),
+		       yaffs_devname(sb, bdevname_buf));
 
 	
 
@@ -1379,7 +1384,7 @@
 		struct mtd_info *mtd;
 		
 		printk(KERN_DEBUG "yaffs: Attempting MTD mount on %u.%u, \"%s\"\n",
-		 MAJOR(sb->s_dev),MINOR(sb->s_dev),kdevname(sb->s_dev));
+		 MAJOR(sb->s_dev),MINOR(sb->s_dev),yaffs_devname(sb, bdevname_buf));
 			
 		// Check it's an mtd device.....
 		if(MAJOR(sb->s_dev) != MTD_BLOCK_MAJOR)

--------------040607000007070406020601--