[Yaffs] [PATCH YAFFS2 05/15] conditionalize-internals-read_super

Luc Van Oostenryck luc.vanoostenryck at looxix.net
Thu Jul 28 00:00:07 BST 2005


Move the internals read_super() functions near the declaration of

they corresponding fs_type declaration so that their compilation are properly conditionalized.


-- Luc Van Oostenryck
-------------- next part --------------
diff --git a/fs/yaffs2/yaffs_fs.c b/fs/yaffs2/yaffs_fs.c
--- a/fs/yaffs2/yaffs_fs.c
+++ b/fs/yaffs2/yaffs_fs.c
@@ -154,13 +154,6 @@ static int yaffs_statfs(struct super_blo
 #endif
 static void yaffs_read_inode (struct inode *inode);
 
-//#if defined(CONFIG_KERNEL_2_5)
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
-static struct super_block *yaffs_read_super(struct file_system_type * fs, int flags, const char *dev_name, void *data);
-#else
-static struct super_block *yaffs_read_super(struct super_block * sb, void * data, int silent);
-#endif
-
 static void yaffs_put_inode (struct inode *inode);
 static void yaffs_delete_inode(struct inode *);
 static void yaffs_clear_inode(struct inode *);
@@ -1613,29 +1606,15 @@ static struct super_block *yaffs_interna
 }
 
 
-static int yaffs_internal_read_super_ram(struct super_block * sb, void * data, int silent)
-{
-	 return yaffs_internal_read_super(1,1,sb,data,silent) ? 0 : -1;
-}
+
+#ifdef CONFIG_YAFFS_MTD_ENABLED
+//#if defined(CONFIG_KERNEL_2_5)
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
 static int yaffs_internal_read_super_mtd(struct super_block * sb, void * data, int silent)
 {
 	 return yaffs_internal_read_super(1,0,sb,data,silent) ? 0 : -1;
 }
 
-static int yaffs2_internal_read_super_ram(struct super_block * sb, void * data, int silent)
-{
-	 return yaffs_internal_read_super(2,1,sb,data,silent) ? 0 : -1;
-}
-static int yaffs2_internal_read_super_mtd(struct super_block * sb, void * data, int silent)
-{
-	 return yaffs_internal_read_super(2,0,sb,data,silent) ? 0 : -1;
-}
-
-
-
-#ifdef CONFIG_YAFFS_MTD_ENABLED
-//#if defined(CONFIG_KERNEL_2_5)
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
 static struct super_block *yaffs_read_super(struct file_system_type * fs, int flags, const char *dev_name, void *data)
 {
 
@@ -1666,6 +1645,11 @@ static DECLARE_FSTYPE(yaffs_fs_type, "ya
 #ifdef CONFIG_YAFFS2_MTD_ENABLED
 
 #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
+static int yaffs2_internal_read_super_mtd(struct super_block * sb, void * data, int silent)
+{
+	 return yaffs_internal_read_super(2,0,sb,data,silent) ? 0 : -1;
+}
+
 static struct super_block *yaffs2_read_super(struct file_system_type * fs, int flags, const char *dev_name, void *data)
 {
 
@@ -1697,6 +1681,11 @@ static DECLARE_FSTYPE(yaffs2_fs_type, "y
 #ifdef CONFIG_YAFFS_RAM_ENABLED
 
 #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
+static int yaffs_internal_read_super_ram(struct super_block * sb, void * data, int silent)
+{
+	 return yaffs_internal_read_super(1,1,sb,data,silent) ? 0 : -1;
+}
+
 static struct super_block *yaffs_ram_read_super(struct file_system_type * fs, int flags, const char *dev_name, void *data)
 {
 
@@ -1725,6 +1714,11 @@ static DECLARE_FSTYPE(yaffs_ram_fs_type,
 #ifdef CONFIG_YAFFS2_RAM_ENABLED
 
 #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
+static int yaffs2_internal_read_super_ram(struct super_block * sb, void * data, int silent)
+{
+	 return yaffs_internal_read_super(2,1,sb,data,silent) ? 0 : -1;
+}
+
 static struct super_block *yaffs2_ram_read_super(struct file_system_type * fs, int flags, const char *dev_name, void *data)
 {
 



More information about the yaffs mailing list