yaffsfs.c: Fix NULL dereference in yaffs_unmount2_reldev() Signed-off-by: Charles Manning <cdhmanning@gmail.com>
Added comments to yaffs_DoUtimre Signed-off-by: Timothy Manning <codedraughtsman@users.noreply.github.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>
yaffs direct: Fix opening of a directory. If opening a directory using yaffs_open(), Yaffs Direct was checking that the file was being opened with O_RDONLY. In fact those flags should actually be ignored and it should be treated as if opened O_RDONLY. Therefore override flags if opening a directory. Signed-off-by: Charles Manning <cdhmanning@gmail.com>
Compilation clean up Signed-off-by: Charles Manning <cdhmanning@gmail.com>
Further extensions for VxWorks wrapper Signed-off-by: Charles Manning <cdhmanning@gmail.com>
Some changes to get VxWorks wrapper working Signed-off-by: Charles Manning <cdhmanning@gmail.com>
yaffs direct: Fix wrong condition for O_CREAT | O_EXCL Thanks Chris for pointing this out. Signed-off-by: Charles Manning <cdhmanning@gmail.com>
yaffs: Add handling for . and .. at end of path yaffs_opendir("/nand/x/./") or yaffs_opendir("/nand/x/../") were not working, but yaffs_opendir("/nand/x/.") and yaffs_opendir("/nand/x/..") were. Make them all work. Signed-off-by: Charles Manning <cdhmanning@gmail.com>
yaffs: Fix yaffs_readdir when dereferencing a symlink If the directory is a symlink then follow the symlink. eg yaffs_mount("/nand/"); yaffs_symlink("x", "/nand/sym"); yaffs_mkdir("/nand/x",0666); After that: yaffs_opendir("/nand/sym/") works, but opendir("/nand/sym") fails because the symlink itself is found. Fix by dereferencing the symlink in yaffs_opendir(). Thanks to Trent Lillehaugen for finding that. Signed-off-by: Charles Manning <cdhmanning@gmail.com>
Fix directory look up. Thanks to Trent Lillehaugen for new algorithm: Let's say I have two yaffs partitions: "/" and "/foo". If I call, yaffs_mkdir("/foobar", 0), yaffsfs_FindDevice will match the path with the "/foo" partition. I would expect it to match "/" instead. It will also match "/fo/o/bar" with "/foo", again I think it should match with "/". Signed-off-by: Charles Manning <cdhmanning@gmail.com>
yaffs direct: Add some missing reldev functions Signed-off-by: Charles Manning <cdhmanning@gmail.com>
Some yaffsfs cleanups for WinCE Signed-off-by: Charles Manning <cdhmanning@gmail.com>
yaffs direct: Expose background garbage collection Expose background garbage collection and add a demo pthread implementation of background gc. 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>
yaffs-direct: Fix object leak caused by defered free The change to dtest.c adds a test case that was leaking objects. The change to yaffsfs.c fixes this. This leak was triggered by sequences of the following form: yaffs_open(file_name, ...); /* create obj */ ... yaffs_unlink(file_name); yaffs_close(file_name); When the file was closed, obj->my_inode was not NULL when yaffs_del_obj() is called, therefore the object was not released properly. The fix "unstitches" the object before the call to yaffs_del_obj(), so that obj->my_inode is NULL and the object freeing is done correctly. Signed-off-by: Charles Manning <cdhmanning@gmail.com>
Initialise device properly when doing a format. Signed-off-by: Charles Manning <cdhmanning@gmail.com>
Add new functions to read directories with an fd. Signed-off-by: Charles Manning <cdhmanning@gmail.com>