[Yaffs] Yaffs and MTD

Ian McDonnell ian at brightstareng.com
Tue Dec 13 14:33:59 GMT 2005


On Tuesday 13 December 2005 04:53, André Tousch wrote:
> Thank you; another question : why do we need to choose between
> yaffs and   yaffs2 at mount time? Why does not
> yaffs_read_super determine the filesystem type depending on
> the page size?

You can do this, I tweeked the yaffs2 code to do just that:


yaffs_fs.c:

                T(YAFFS_TRACE_OS,(" erase %p\n",mtd->erase));
                T(YAFFS_TRACE_OS,(" read %p\n",mtd->read));
                T(YAFFS_TRACE_OS,(" write %p\n",mtd->write));
                T(YAFFS_TRACE_OS,(" readoob %p\n",mtd->read_oob));
                T(YAFFS_TRACE_OS,(" writeoob %p\n",mtd->write_oob));
                T(YAFFS_TRACE_OS,(" block_isbad %p\n",mtd->block_isbad));
                T(YAFFS_TRACE_OS,(" block_markbad %p\n",mtd->block_markbad));
                T(YAFFS_TRACE_OS,(" oobblock %d\n",mtd->oobblock));
                T(YAFFS_TRACE_OS,(" oobsize %d\n",mtd->oobsize));
                T(YAFFS_TRACE_OS,(" erasesize %d\n",mtd->erasesize));
                T(YAFFS_TRACE_OS,(" size %d\n",mtd->size));


>                if (yaffsVersion == 1 && mtd->oobblock == 2048) {
>                        printk(KERN_INFO "yaffs: auto selecting yaffs2\n");
>                        yaffsVersion = 2;
>                }

                if(yaffsVersion == 2)
                {
                        // Check for version 2 style functions
                        if(!mtd->erase ||
                           !mtd->block_isbad ||
                           !mtd->block_markbad ||
                           !mtd->read  ||
                           !mtd->write ||



More information about the yaffs mailing list