[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RFC: generalize jffs2_nand_flash_setup



Hello,

Below is a patch to fs.c to remove an unneeded if statement around
jffs2_nand_flash_setup that I would like to get applied to the CVS
tree.  I have two reasons for this.

One is that the if (jffs2_cleanmarker_oob(c)) is unneeded since the
jffs2_nand_flash_setup function is #defined to (0) unless
CONFIG_JFFS2_FS_NAND is set.

The other reason is, I see some benefit in generalizing
jffs2_nand_flash_setup into something that can be used for more than
just NAND flash.  The comment in that code says "NAND (or other bizarre)
flash... do setup accordingly".  Well, I have the "other bizarre" flash
case because I am using NOR flash with transparent ECC.  This requires
some of the same things that NAND does (mainly the wbuf), but it doesn't
have OOB data like NAND, so CONFIG_JFFS2_FS_NAND can't be used directly.

jffs2_nand_flash_setup could be renamed jffs2_flash_setup so that it is
more general, and adding support for bizarre flashes is easier.  MTD
already supports some of these flashes (see cfi_cmdset_0020.c), so now
it's just a matter of getting JFFS2 support there.

Let me know if you see benefit in doing something like this.  Either
way, something like it has to be done for my setup so I thought I would
see if it was useful to others.

thx,
josh

Index: fs/jffs2/fs.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/fs.c,v
retrieving revision 1.39
diff -a -u -r1.39 fs.c
--- fs/jffs2/fs.c       14 Apr 2004 12:57:54 -0000      1.39
+++ fs/jffs2/fs.c       29 Apr 2004 14:28:00 -0000
@@ -474,12 +474,10 @@
        c->cleanmarker_size = sizeof(struct jffs2_unknown_node);
        /* Joern -- stick alignment for weird 8-byte-page flash here */

-       if (jffs2_cleanmarker_oob(c)) {
-               /* NAND (or other bizarre) flash... do setup accordingly
*/
-               ret = jffs2_nand_flash_setup(c);
-               if (ret)
-                       return ret;
-       }
+       /* NAND (or other bizarre) flash... do setup accordingly */
+       ret = jffs2_nand_flash_setup(c);
+       if (ret)
+               return ret;

        c->inocache_list = kmalloc(INOCACHE_HASHSIZE * sizeof(struct
jffs2_inode_cache *), GFP_KERNEL);
        if (!c->inocache_list) {




To unsubscribe from this list: send the line "unsubscribe jffs-dev" in
the body of a message to majordomo@xxxxxxx.com