Further integration of 64-bit time changes Signed-off-by: Charles Manning <cdhmanning@gmail.com>
Added support for 64 bit time to yaffs direct. These changes still need to be applied to the kernel and rtems.
Some clean up and more modular cache management Signed-off-by: Charles Manning <cdhmanning@gmail.com>
Move cache handling into its own file Signed-off-by: Charles Manning <cdhmanning@gmail.com>
Handle cleanup when remounting rw after mounting read-only Deferend clean ups were not happening properly. Thanks to andriy.grytsenko@globallogic.com for providing a patch that forms the babsis of these changes. Signed-off-by: Charles Manning <cdhmanning@gmail.com>
Fix copyright Signed-off-by: Charles Manning <cdhmanning@gmail.com>
Clean up some compilation warnings for VxWorks Signed-off-by: Charles Manning <cdhmanning@gmail.com>
Compilation clean up Signed-off-by: Charles Manning <cdhmanning@gmail.com>
yaffs2: Yaffs endian support Allow the forcing of endians so that Yaffs can be used on mixed endian machines, or a flash image can be extracted and used elsewhere. Signed-off-by: Charles Manning <cdhmanning@gmail.com>
Change checkpoint object to using a bitfield This is done to support changing to support endian manipulation. Signed-off-by: Charles Manning <cdhmanning@gmail.com>
Add ability to hide lost_n_found directory Some people don't want it showing up in the directory structure. Signed-off-by: Charles Manning <cdhmanning@gmail.com>
Write object headers with stored file extents Previously file object headers were being written with file extents rather than stored extents. This could lead to situations where the data in the cache was not yet written to flash but had been accounted for in the object header file size. Under power fail this could cause zero-filled blobs at the end of a file. This change tracks the stored file size and only write object headers reflecting the extents of the file that has actually been stored to flash, thus avoiding the holes. Signed-off-by: Charles Manning <cdhmanning@gmail.com>
Change enums to u32 for stored fields enum sizes are not fixed, so it is better to specify an actual sized storage element. Signed-off-by: Charles Manning <cdhmanning@gmail.com>
Yaffs: Change cache policy When the cache is full and a new cache entry is needed, then space has to be made. This is sometimes termed push out. Until now, the push out involved finding the least recently used cache entry then pushing out all entries in the same file. This had the unintended consequence of making "bursty" writes and forcing extra reads under some conditions. Since the same code path was being used for fsync() and flushing, this also meant that flushing a file caused the file to be thrown out of the cache. That is not a very useful thing to do. These changes are twofold: 1. Only push out the LRU cache entry, rather than the whole file. This makes for a "smoother" push out. It also saves some reads. 2. Flushing a file no longer invalidates the file in cache, it just writes dirty cache entries. This makes better use of the cache. Signed-off-by: Charles Manning <cdhmanning@gmail.com>
yaffs: Clean up bitfield types It happens that the C spec says compilers can choose whether to treat int bitfields as signed or unsigned. In some cases, int was being used and signed was expected. The IAR ARM compiler in particular treats int bitfields as unsigned. Clean up these plus a few other bitfield usages to make the size and type explicit. Thanks to ChungKang Hu for identifying this issue. Signed-off-by: Charles Manning <cdhmanning@gmail.com>
yaffs-direct: Add reldir and reldev interfaces These interfaces allow far more flexibility in the way Yaffs Direct is hooked up to an RTOS VFS. The "normal" interface requires a fully, qualified path, which is a pain to achieve in some RTOSs. The new interfaces allow calls to be done with paths relative to a directory or to a device. This tends to make some RTOS integration cleaner. Example yaffs_open("/mountpoint-name/dir/file",...); now has two alternatives: yaffs_open_reldir(root_dir,"dir/file",...); or yaffs_open_reldev(dev, "dir/file",...); Signed-off-by: Charles Manning <cdhmanning@gmail.com>
Change the object type if it turns out to be wrong during a scan This might result in some files ending up in lost but at least we can get the file system to mount. Signed-off-by: Charles Manning <cdhmanning@gmail.com>
Merge branch 'master' of ssh://aleph1.co.uk/home/aleph1/git/yaffs2
Add some yaffs debug functions for inspecting run-time state. Signed-off-by: Charles Manning <cdhmanning@gmail.com>
Initialise device properly when doing a format. Signed-off-by: Charles Manning <cdhmanning@gmail.com>