Charles,

I've pulled a current snapshot from the git tree (ID 388ad45f27ef3288d2f1240a4e94d5849cf8201b) and when I tried to compile it into a 2.6.32 kernel for my OMAP board, compilation fails with:

fs/yaffs2/yaffs_linux_allocator.c: In function 'yaffs_InitialiseRawTnodesAndObjects':
fs/yaffs2/yaffs_linux_allocator.c:106: error: implicit declaration of function 'yaffs_DeviceToContext'
fs/yaffs2/yaffs_linux_allocator.c:106: error: invalid type argument of '->' (have 'int')


Grepping through the yaffs2 code for "yaffs_DeviceToContext", there's no declaration for it.  Looking around for other uses of mount_id, I tried replacing yaffs_DeviceToContext with yaffs_DeviceToLC, and the world builds w/o error, but when I try to mount my NAND device (Micron 2KB block), the kernel oopses quite hard:

OMAP-35x# cat /proc/mtd                                                         
dev:    size   erasesize  name                                                  
mtd0: 00800000 00020000 "NOR fs #1"                                             
mtd1: 00020000 00020000 "NoLo-NAND"                                             
mtd2: 00220000 00020000 "Lboot-NAND"                                            
mtd3: 00c80000 00020000 "NAND fs #1"                                            
mtd4: 0f100000 00020000 "NAND fs #2"                                            
mtd5: 00040000 00020000 "u-boot Env-NAND"                                       
OMAP-35x# mkdir /mnt/yaffs                                                      
OMAP-35x# mount -t yaffs /dev/mtdblock4 /mnt/yaffs                              
yaffs: dev is 32505860 name is "mtdblock4"                                      
yaffs: passed flags ""                                                          
yaffs: Attempting MTD mount of 31.4,"mtdblock4"                                 
yaffs: auto selecting yaffs2                                                    
slab error in kmem_cache_destroy(): cache `yaffs_o_1': Can't free all objects   
[<c0037584>] (unwind_backtrace+0x0/0xdc) from [<c00ace10>] (kmem_cache_destroy+0x88/0xf0)                                                                       
[<c00ace10>] (kmem_cache_destroy+0x88/0xf0) from [<c016d694>] (yaffs_DeinitialiseRawTnodesAndObjects+0x70/0xdc)                                                 
[<c016d694>] (yaffs_DeinitialiseRawTnodesAndObjects+0x70/0xdc) from [<c016544c>] (yaffs_DeinitialiseTnodesAndObjects+0xc/0x1c)                                  
[<c016544c>] (yaffs_DeinitialiseTnodesAndObjects+0xc/0x1c) from [<c016a26c>] (yaffs_GutsInitialise+0x584/0x85c)                                                 
[<c016a26c>] (yaffs_GutsInitialise+0x584/0x85c) from [<c0163ea0>] (yaffs_internal_read_super+0x8e8/0xb68)                                                       
[<c0163ea0>] (yaffs_internal_read_super+0x8e8/0xb68) from [<c0164168>] (yaffs_internal_read_super_mtd+0x1c/0x2c)                                                
[<c0164168>] (yaffs_internal_read_super_mtd+0x1c/0x2c) from [<c00b1790>] (get_sb_bdev+0x114/0x16c)                                                              
[<c00b1790>] (get_sb_bdev+0x114/0x16c) from [<c01613f4>] (yaffs_read_super+0x18/0x20)                                                                           
[<c01613f4>] (yaffs_read_super+0x18/0x20) from [<c00b0810>] (vfs_kern_mount+0x4c/0xd0)                                                                          
[<c00b0810>] (vfs_kern_mount+0x4c/0xd0) from [<c00b08d8>] (do_kern_mount+0x34/0xd8)                                                                             
[<c00b08d8>] (do_kern_mount+0x34/0xd8) from [<c00c4fd8>] (do_mount+0x5ec/0x64c) 
[<c00c4fd8>] (do_mount+0x5ec/0x64c) from [<c00c50bc>] (sys_mount+0x84/0xc4)     
[<c00c50bc>] (sys_mount+0x84/0xc4) from [<c0031ec0>] (ret_fast_syscall+0x0/0x2c)
kmem_cache_create: duplicate cache yaffs_o_1                                    
[<c0037584>] (unwind_backtrace+0x0/0xdc) from [<c00acfc0>] (kmem_cache_create+0x148/0x45c)                                                                      
[<c00acfc0>] (kmem_cache_create+0x148/0x45c) from [<c016d598>] (yaffs_InitialiseRawTnodesAndObjects+0x130/0x1bc)                                                
[<c016d598>] (yaffs_InitialiseRawTnodesAndObjects+0x130/0x1bc) from [<c01659ac>] (yaffs_InitialiseTnodesAndObjects+0x18/0x4c)                                   
[<c01659ac>] (yaffs_InitialiseTnodesAndObjects+0x18/0x4c) from [<c016a2a4>] (yaffs_GutsInitialise+0x5bc/0x85c)                                                  
[<c016a2a4>] (yaffs_GutsInitialise+0x5bc/0x85c) from [<c0163ea0>] (yaffs_internal_read_super+0x8e8/0xb68)                                                       
[<c0163ea0>] (yaffs_internal_read_super+0x8e8/0xb68) from [<c0164168>] (yaffs_internal_read_super_mtd+0x1c/0x2c)                                                
[<c0164168>] (yaffs_internal_read_super_mtd+0x1c/0x2c) from [<c00b1790>] (get_sb_bdev+0x114/0x16c)                                                              
[<c00b1790>] (get_sb_bdev+0x114/0x16c) from [<c01613f4>] (yaffs_read_super+0x18/0x20)                                                                           
[<c01613f4>] (yaffs_read_super+0x18/0x20) from [<c00b0810>] (vfs_kern_mount+0x4c/0xd0)                                                                          
[<c00b0810>] (vfs_kern_mount+0x4c/0xd0) from [<c00b08d8>] (do_kern_mount+0x34/0xd8)                                                                             
[<c00b08d8>] (do_kern_mount+0x34/0xd8) from [<c00c4fd8>] (do_mount+0x5ec/0x64c) 
[<c00c4fd8>] (do_mount+0x5ec/0x64c) from [<c00c50bc>] (sys_mount+0x84/0xc4)     
[<c00c50bc>] (sys_mount+0x84/0xc4) from [<c0031ec0>] (ret_fast_syscall+0x0/0x2c)
yaffs cache creation failed                                                     
==>> yaffs bug: fs/yaffs2/yaffs_linux_allocator.c 160                           

At this point I have to ask:

1) What should I use in yaffs_linux_allocator to replace DeviceToLinuxContext()?

2) If I guessed correctly by using DeviceToLC, then why does the kernel oops?

3) Have you built/tested the current git head on a Linux system?

Thanks in advance!