On Sunday 21 January 2007 23:16, Aubrey Li wrote: > > So long as the kernel folk don't speed up on the number of > > arbitrary changes they make, we should not experience too > > much further problems. Right now we support all flavours > > from 2.4.something to current with only a few (44 by my > > count)  KERNEL_VERSION #ifs in yaffs_fs.c. I really don't > > think we're anywhere near crumbling point yet. > > Well, it's really a big headache. Obviously kernel folk will > change the framework/API etc constantly. I'm thinking of if > yaffs is accepted into kernel, it will be released in > different version. Perhaps some additional levels of abstraction or simple factoring out of some code segments in functional areas that have too many ifdefs will help manage the situation. Is it amazing how portable and change-resilient code can be once the right pattern and abstraction is reached. Unfortunately I don't have time to work in this myself at the moment. But please don't give up with the 2.4 interface -- there are surely many more 2.4-based products out there that need to be supported at this time, than 2.6. If need be, and if it comes down to it, the line can be drawn between the yaffs_guts and yaffs_fs functions and we have yaffs_fs_24.c and yaffs_fs_26.c as two distinct implementations and simply have the makefile pick the appropriate file(s). But we can do better than that (see first paragraph). [BTW, this is the same issue at the bottom with MTD]. -imcd