yaffs2.git
11 months agoMerge remote-tracking branch 'origin/time_upgrade' into 64_and_32_bit_time_tests
Timothy Manning [Fri, 23 Jul 2021 01:50:06 +0000 (13:50 +1200)]
Merge remote-tracking branch 'origin/time_upgrade' into 64_and_32_bit_time_tests

11 months agoAdded a README to basic-tests
Timothy Manning [Thu, 1 Jul 2021 03:09:14 +0000 (15:09 +1200)]
Added a README to basic-tests

Signed-off-by: Timothy Manning <codedraftsman@gmail.com>
11 months agoRenamed timothy_tests to stress_tests
Timothy Manning [Thu, 1 Jul 2021 02:53:16 +0000 (14:53 +1200)]
Renamed timothy_tests to stress_tests

Signed-off-by: Timothy Manning <codedraftsman@gmail.com>
11 months agoAdded a makefile to run all the unit tests.
Timothy Manning [Thu, 1 Jul 2021 02:28:05 +0000 (14:28 +1200)]
Added a makefile to run all the unit tests.

Signed-off-by: Timothy Manning <codedraftsman@gmail.com>
11 months agoMoved unit tests into their own folder.
Timothy Manning [Tue, 29 Jun 2021 03:49:34 +0000 (15:49 +1200)]
Moved unit tests into their own folder.

Signed-off-by: Timothy Manning <codedraftsman@gmail.com>
11 months agoAdded test target to makefile.
Timothy Manning [Tue, 29 Jun 2021 03:40:36 +0000 (15:40 +1200)]
Added test target to makefile.

Signed-off-by: Timothy Manning <codedraftsman@gmail.com>
11 months agoAdded a test target to makefile
Timothy Manning [Tue, 29 Jun 2021 03:36:40 +0000 (15:36 +1200)]
Added a test target to makefile

Signed-off-by: Timothy Manning <codedraftsman@gmail.com>
11 months agoRemoved obsolete test from linux_tests.
Timothy Manning [Tue, 29 Jun 2021 03:24:57 +0000 (15:24 +1200)]
Removed obsolete test from linux_tests.

Signed-off-by: Timothy Manning <codedraftsman@gmail.com>
11 months agoRemoved obsolete timothy_test/yaffs_and_linux_mirror_tests
Timothy Manning [Tue, 29 Jun 2021 03:07:57 +0000 (15:07 +1200)]
Removed obsolete timothy_test/yaffs_and_linux_mirror_tests

Signed-off-by: Timothy Manning <codedraftsman@gmail.com>
11 months agoUpdated timothy_tests/stress_tester
Timothy Manning [Tue, 29 Jun 2021 02:56:45 +0000 (14:56 +1200)]
Updated timothy_tests/stress_tester

Updated the mount point's path.
Broke out some commonly used shared functions and defines into a
shared file.

Signed-off-by: Timothy Manning <codedraftsman@gmail.com>
11 months agoRemoved old test from timothy_tests/quick_tests
Timothy Manning [Fri, 25 Jun 2021 03:11:45 +0000 (15:11 +1200)]
Removed old test from timothy_tests/quick_tests

Linux now allows directories to be opened.
When quick_tests were written, open was supposed to
return the error code EISDIR.

Signed-off-by: Timothy Manning <codedraftsman@gmail.com>
11 months agoUpdated is_yaffs_working_test_fix
Timothy Manning [Fri, 25 Jun 2021 02:39:45 +0000 (14:39 +1200)]
Updated is_yaffs_working_test_fix

Added pthread library to the makefile and changed
the mountpoint to the new "yflash2".

Signed-off-by: Timothy Manning <codedraftsman@gmail.com>
11 months agoFixed segfault in yaffs_guts
Timothy Manning [Thu, 24 Jun 2021 02:39:00 +0000 (14:39 +1200)]
Fixed segfault in yaffs_guts

Remounting a device would cause a segfault because the
device's temp_buffer would not be reinitialised. Resulting
in a null pointer being called as a function, creating the segfault.

Signed-off-by: Timothy Manning <codedraftsman@gmail.com>
11 months agoEnhanced printf statements in is_yaffs_working_tests
Timothy Manning [Fri, 4 Jun 2021 04:58:59 +0000 (16:58 +1200)]
Enhanced printf statements in is_yaffs_working_tests

Signed-off-by: Timothy Manning <codedraftsman@gmail.com>
11 months agoFixed mountpoint path for is_yaffs_working_test
Timothy Manning [Fri, 4 Jun 2021 04:49:31 +0000 (16:49 +1200)]
Fixed mountpoint path for is_yaffs_working_test

The old path "/yaffs2/" seem to have been removed.

Signed-off-by: Timothy Manning <codedraftsman@gmail.com>
11 months agoAdded -lpthread to is_yaffs_working_tests's makefile
Timothy Manning [Fri, 4 Jun 2021 04:46:56 +0000 (16:46 +1200)]
Added -lpthread to is_yaffs_working_tests's makefile

Also removed dead code.

Signed-off-by: Timothy Manning <codedraftsman@gmail.com>
12 months agoAdded endianness support for YTIME_T
Timothy Manning [Thu, 3 Jun 2021 22:21:27 +0000 (10:21 +1200)]
Added endianness support for YTIME_T

Added a inline function that handles swapping the Endianness for YTIME_T.

Signed-off-by: Timothy Manning <codedraughtsman@users.noreply.github.com>
12 months agoAdded comments to yaffs_DoUtimre
Timothy Manning [Thu, 3 Jun 2021 22:18:59 +0000 (10:18 +1200)]
Added comments to yaffs_DoUtimre

Signed-off-by: Timothy Manning <codedraughtsman@users.noreply.github.com>
12 months agoChanged some tabs to spaces.
Timothy Manning [Thu, 3 Jun 2021 22:17:27 +0000 (10:17 +1200)]
Changed some tabs to spaces.

Signed-off-by: Timothy Manning <codedraughtsman@users.noreply.github.com>
12 months agoCreated a new test to check the size of YTIME_T
Timothy Manning [Wed, 2 Jun 2021 21:45:12 +0000 (09:45 +1200)]
Created a new test to check the size of YTIME_T

12 months agoAdded support for 64 bit time to yaffs direct.
Timothy Manning [Mon, 31 May 2021 22:49:45 +0000 (10:49 +1200)]
Added support for 64 bit time to yaffs direct.

These changes still need to be applied to the kernel and rtems.

12 months agoAdded some comments to dtest.c
codedraughtsman [Mon, 31 May 2021 05:11:05 +0000 (17:11 +1200)]
Added some comments to dtest.c

Also expanded some of the printf description text.

12 months agoFixed timothy_tests/quick_tests
codedraughtsman [Mon, 31 May 2021 04:29:11 +0000 (16:29 +1200)]
Fixed timothy_tests/quick_tests

One of the string buffers was to small and would not compile.
The string buffer's size was increased and it all compliles.

Note: the tests still fail due to a unrelated segfault, currently
fixing this.

12 months agoIndex the block state string list because the order was wrong.
Charles Manning [Tue, 25 May 2021 22:45:13 +0000 (10:45 +1200)]
Index the block state string list because the order was wrong.

Thanks to Cory Wiltshire for pointing out the problem and proposing
a fix.

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
12 months agokernel Makefile won't work after moving cache handling into a separated file.
Luca (Wei) Chen [Tue, 25 May 2021 21:27:57 +0000 (09:27 +1200)]
kernel Makefile won't work after moving cache handling into a separated file.

Signed-off-by: Luca (Wei) Chen <wei@cvluca.com>
13 months agoyaffs_guts.c : Fix missing temporary buffers when doing yaffs format on inband tags.
Charles Manning [Sat, 15 May 2021 00:33:36 +0000 (12:33 +1200)]
yaffs_guts.c : Fix missing temporary buffers when doing yaffs format on inband tags.

The low level init was not setting up temporary buffers. This was causing yaffs_format
to crash in the case of formating a device with inband tags.

Solution is to move the temporary buffer creation into low level init.

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
13 months agoNew yaffs2_image_maker tool to work with 4kB pages - still under test
Charles Manning [Tue, 11 May 2021 04:32:26 +0000 (16:32 +1200)]
New yaffs2_image_maker tool to work with 4kB pages - still under test

This appears to be working but more testing required.

The tool now takes two new parameters for modifying the bytes per page
and pages per block.

For instance to create an inband tags image using 4kB virtual pages (ie. 32
virtual pages per block) try:

./yaffs2_image_maker -i test-dir2 -o outimage -w working_file -I -c 4096  -B 32

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
14 months agoyaffs_image_maker: Add ability to handle oob tags and no tags ecc
Charles Manning [Fri, 26 Mar 2021 01:59:43 +0000 (14:59 +1300)]
yaffs_image_maker: Add ability to handle oob tags and no tags ecc

This still has some limits - it assumes 2k pages.

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
15 months agoAdd a README for the image maker
Charles Manning [Thu, 18 Mar 2021 00:38:19 +0000 (13:38 +1300)]
Add a README for the image maker

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
15 months agoAdd endian feature to image maker and do some tidy up.
Charles Manning [Thu, 18 Mar 2021 00:24:54 +0000 (13:24 +1300)]
Add endian feature to image maker and do some tidy up.

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
15 months agoAdd an image maker tool that generates image files for 2k page * 64 devices
Charles Manning [Wed, 17 Mar 2021 22:53:23 +0000 (11:53 +1300)]
Add an image maker tool that generates image files for 2k page * 64 devices

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
15 months agoSome clean up and more modular cache management
Charles Manning [Tue, 16 Mar 2021 23:10:16 +0000 (12:10 +1300)]
Some clean up and more modular cache management

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
23 months agoAdd CONFIG_YAFFS_NO_YAFFS1 flag to remove yaffs1 code when not needed
Charles Manning [Thu, 9 Jul 2020 02:16:29 +0000 (14:16 +1200)]
Add CONFIG_YAFFS_NO_YAFFS1 flag to remove yaffs1 code when not needed

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
23 months agoMove cache code to own file
Charles Manning [Thu, 9 Jul 2020 01:34:12 +0000 (13:34 +1200)]
Move cache code to own file

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
23 months agoMove cache handling into its own file
Charles Manning [Thu, 9 Jul 2020 01:31:03 +0000 (13:31 +1200)]
Move cache handling into its own file

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
23 months agoAdd CONFIG_YAFFS_SMALL_RAM to reduce RAM footprint
Charles Manning [Thu, 9 Jul 2020 01:28:23 +0000 (13:28 +1200)]
Add CONFIG_YAFFS_SMALL_RAM to reduce RAM footprint

Reduce number of handles and search contexts.

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
23 months agoAdd CONFIG_YAFFS_NO_TRACE to turn off all tracing
Charles Manning [Thu, 9 Jul 2020 01:24:30 +0000 (13:24 +1200)]
Add CONFIG_YAFFS_NO_TRACE to turn off all tracing

This allows a foootprint reduction.

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
2 years agoyaffs-vfs-multi.c: Handle search context properly to prevent leaking
Charles Manning [Thu, 25 Jun 2020 04:01:27 +0000 (16:01 +1200)]
yaffs-vfs-multi.c: Handle search context properly to prevent leaking

Fix potential memory leak due to search context not being closed properly.

Thank you to George Pee for reporting this issue.

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
2 years agoAdd malloc monitoring to get a sense of RAM use
Charles Manning [Fri, 19 Jun 2020 01:52:21 +0000 (13:52 +1200)]
Add malloc monitoring to get a sense of RAM use

Note this should only be monitoring the malloc usage by Yaffs, not the
malloc usage in things like flash simulators which are not relevant in
real systems.

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
2 years agoBegign bug: Fix incorrect return value
Charles Manning [Fri, 19 Jun 2020 01:43:45 +0000 (13:43 +1200)]
Begign bug: Fix incorrect return value

The return value was not being used, but it was wrong.

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
2 years agoMerge branch 'sizeofsizeof'
Charles Manning [Fri, 15 May 2020 02:36:57 +0000 (14:36 +1200)]
Merge branch 'sizeofsizeof'

Fix two bugs:

sizeof(sizeof(hdr)) used instaed of sizeof(hr)

remounting a read-only fs in rw did not clean up defered operations
properly.

2 years agoAdd some RTEMS notes
Charles Manning [Fri, 15 May 2020 02:35:17 +0000 (14:35 +1200)]
Add some RTEMS notes

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
2 years agoHandle cleanup when remounting rw after mounting read-only
Charles Manning [Fri, 15 May 2020 01:57:54 +0000 (13:57 +1200)]
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>
2 years agoMake buffers larger to stop compiler complaining
Charles Manning [Fri, 15 May 2020 01:44:10 +0000 (13:44 +1200)]
Make buffers larger to stop compiler complaining

The buffers were not overflowing, but the check was complaining.

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
2 years agofix wrong use of sizeof in yaffs_checkpt_close
liaohua [Thu, 23 Apr 2020 03:30:20 +0000 (11:30 +0800)]
fix wrong use of sizeof in yaffs_checkpt_close

There is a distinct bug that sizeof was used incorrectly,
causing the judgment to be ineffective and always flushing checkpt buffer.

Signed-off-by: liaohua <liaohua4@huawei.com>
2 years agoAdd test to dereference symlink rtems-merge
Charles Manning [Thu, 19 Mar 2020 03:04:35 +0000 (16:04 +1300)]
Add test to dereference symlink

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
2 years agoAdd more basic tests and some clean up.
Charles Manning [Thu, 19 Mar 2020 02:15:24 +0000 (15:15 +1300)]
Add more basic tests and some clean up.

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
2 years agoAdd stats to flash simulator
Charles Manning [Thu, 19 Mar 2020 02:14:30 +0000 (15:14 +1300)]
Add stats to flash simulator

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
2 years agortems yests: FSX
Charles Manning [Tue, 17 Mar 2020 19:51:12 +0000 (08:51 +1300)]
rtems yests: FSX

Add readme and some tweaks.

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
2 years agoAdd fsx file test and split up basic tests.
Charles Manning [Tue, 17 Mar 2020 03:45:01 +0000 (16:45 +1300)]
Add fsx file test and split up basic tests.

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
2 years agortems support: Rudimentary test harness now working.
Charles Manning [Fri, 13 Mar 2020 03:33:23 +0000 (16:33 +1300)]
rtems support: Rudimentary test harness now working.

Lots more test cases to add.

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
2 years agoMakefile.rtems: Add a few missing files
Charles Manning [Fri, 13 Mar 2020 01:33:31 +0000 (14:33 +1300)]
Makefile.rtems: Add a few missing files

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
2 years agoyaffs_tagsmarshall.c: Fix prototype dependency
Charles Manning [Fri, 13 Mar 2020 01:32:24 +0000 (14:32 +1300)]
yaffs_tagsmarshall.c: Fix prototype dependency

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
2 years agortems_yaffs: Remove unnecessary flushing of symlink
Charles Manning [Thu, 12 Mar 2020 23:26:37 +0000 (12:26 +1300)]
rtems_yaffs: Remove unnecessary flushing of symlink

Flushing only has meaning on regular files which have cached data.
Symlinks do not have any cached data, therefore flushing has no purpose. Remove.

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
2 years agortems-yaffs: Checkpoint the filesystem at unmount time
Jonathan Brandmeyer [Thu, 12 Mar 2020 23:01:06 +0000 (12:01 +1300)]
rtems-yaffs: Checkpoint the filesystem at unmount time

Adding a checkpoint greatly reduces the amount of time required to mount
the filesystem on the next boot.  After a clean unmount, remount time
is only a second or few.  After an unclean reboot, remount time requires
a scan of the filesystem, which can take a few minutes.

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
2 years agortems_yaffs: Add symlink support
Jonathan BrandMeyer [Thu, 12 Mar 2020 22:54:55 +0000 (11:54 +1300)]
rtems_yaffs: Add symlink support

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
2 years agortems-yaffs: Modes to freshen to latest Yaffs and build in yaffs2/rtems
Charles Manning [Thu, 6 Feb 2020 22:20:32 +0000 (11:20 +1300)]
rtems-yaffs: Modes to freshen to latest Yaffs and build in yaffs2/rtems

Makefile uses symlinks to files outside yaffs2/rtems aso that rtems can be built without
modifying the directory structure and deleting files.

Various tweaks needed to support changes in function prototypes.

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
2 years agoImport rtems wrapper from rtems git
Sebastian Huber [Thu, 6 Feb 2020 20:03:41 +0000 (09:03 +1300)]
Import rtems wrapper from rtems git

https://git.rtems.org/sebh/rtems-yaffs2.git/
Commit:  23be2ac372173ecf701a0a

Most of this work was authored by

Sebastian Huber <sebastian.huber@embedded-brains.de>
Sebastien Bourdeauducq <sebastien@milkymist.org>

Note that the RTEMS licencing applies to all the rtems wrapper code.

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
2 years agofix memory leak when /proc/yaffs is read
Charles Manning [Mon, 21 Oct 2019 19:46:14 +0000 (08:46 +1300)]
fix memory leak when /proc/yaffs is read

Thanks to Jisheng Zhang <Jisheng.Zhang@synaptics.com> for supplying this patch

There is a kernel memory leak observed when the proc file /proc/yaffs
is read. This reason is that in yaffs_proc_open, single_open is called
and the respective release function is not called during release.

Fix with correct release function - single_release().

Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
3 years agoFix race yaffs_flush_inodes against iput
chengchao [Mon, 28 Jan 2019 03:19:15 +0000 (11:19 +0800)]
Fix race yaffs_flush_inodes against iput

needs inode->i_sb->s_inode_list_lock protects
  inode->i_sb->s_inodes, inode->i_sb_list

Signed-off-by: chengchao <chengchao@kedacom.com>
3 years agoAkiko: Fix Yaffs Linux compilation for 4.9 to 4.19
Charles Manning [Tue, 15 Jan 2019 00:00:17 +0000 (13:00 +1300)]
Akiko: Fix Yaffs Linux compilation for 4.9 to 4.19

Thanks Akiko for supplying this patch

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
3 years agoOnly load name if read succeeds
Charles Manning [Mon, 14 Jan 2019 23:58:21 +0000 (12:58 +1300)]
Only load name if read succeeds

Thanks Akiko for supplying this patch.

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
3 years agoMerge branch 'master' of ssh://www.aleph1.co.uk/home/aleph1/git/yaffs2
Charles Manning [Mon, 6 Aug 2018 21:48:35 +0000 (09:48 +1200)]
Merge branch 'master' of ssh://aleph1.co.uk/home/aleph1/git/yaffs2

3 years agoClean up some version dependencies
Charles Manning [Mon, 6 Aug 2018 21:48:11 +0000 (09:48 +1200)]
Clean up some version dependencies

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
3 years agoFix hang caused by returning with lock held
Charles Manning [Mon, 23 Jul 2018 05:04:23 +0000 (17:04 +1200)]
Fix hang caused by returning with lock held

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
3 years agoFix building for mkyaffsimage and mkyaffs2image
Charles Manning [Mon, 23 Jul 2018 03:26:09 +0000 (15:26 +1200)]
Fix building for mkyaffsimage and mkyaffs2image

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
4 years agoFix copyright
Charles Manning [Mon, 26 Feb 2018 04:34:01 +0000 (17:34 +1300)]
Fix copyright

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
4 years agoClean up some compilation warnings for VxWorks aleph1-release
Charles Manning [Fri, 11 Aug 2017 04:28:05 +0000 (16:28 +1200)]
Clean up some compilation warnings for VxWorks

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
5 years agoAdd Adre's patch for Linux 4.9
Charles Manning [Sun, 7 May 2017 22:02:11 +0000 (10:02 +1200)]
Add Adre's patch for Linux 4.9

Kudos to Andre Renaud <andre@ignavus.net>

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
5 years agoAdd struct definition to yaffs_nameval header
Charles Manning [Thu, 6 Apr 2017 02:11:05 +0000 (14:11 +1200)]
Add struct definition to yaffs_nameval header

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
5 years agoyaffs direct: Fix opening of a directory.
Charles Manning [Mon, 3 Apr 2017 04:49:42 +0000 (16:49 +1200)]
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>
5 years agoChanges to test scripts
Charles Manning [Sat, 3 Dec 2016 05:47:16 +0000 (18:47 +1300)]
Changes to test scripts

These just clean up a few things.

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
5 years agoFix yaffs_endian.h for Linux
Charles Manning [Sat, 3 Dec 2016 05:43:00 +0000 (18:43 +1300)]
Fix yaffs_endian.h for Linux

Yaffs loff_t is kept as loff_t and converted into Y_LOFF_T when
when exported for Yaffs Direct.

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
5 years agoChanges to enable Linux 4.8 compilation
Andre Renaud [Tue, 25 Oct 2016 01:18:11 +0000 (14:18 +1300)]
Changes to enable Linux 4.8 compilation

5 years agotimothy-tests: Fix paths for wrongly failing tests
Charles Manning [Fri, 8 Jul 2016 01:50:44 +0000 (13:50 +1200)]
timothy-tests: Fix paths for wrongly failing tests

All pass now.

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
5 years agotimothy-tests: Change mountpoint names to match test framework
Charles Manning [Fri, 8 Jul 2016 01:30:52 +0000 (13:30 +1200)]
timothy-tests: Change mountpoint names to match test framework

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
5 years agoGet timothy quick tests building cleanly.
Charles Manning [Fri, 8 Jul 2016 00:43:57 +0000 (12:43 +1200)]
Get timothy quick tests building cleanly.

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
5 years agoMore compilation clean up
Charles Manning [Wed, 6 Jul 2016 22:09:48 +0000 (10:09 +1200)]
More compilation clean up

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
5 years agoCompilation clean up
Charles Manning [Wed, 6 Jul 2016 21:30:35 +0000 (09:30 +1200)]
Compilation clean up

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
5 years agoChean up nand test script
Charles Manning [Tue, 5 Jul 2016 04:47:41 +0000 (16:47 +1200)]
Chean up nand test script

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
5 years agoyaffs2: Yaffs endian support
Charles Manning [Sat, 2 Jul 2016 00:11:34 +0000 (12:11 +1200)]
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>
5 years agoChange checkpoint object to using a bitfield
Charles Manning [Tue, 14 Jun 2016 02:30:01 +0000 (14:30 +1200)]
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>
6 years agoAdd ability to hide lost_n_found directory
Charles Manning [Mon, 6 Jun 2016 02:16:07 +0000 (14:16 +1200)]
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>
6 years agoSplit qsort from the main Yaffs Direct base
Charles Manning [Sun, 1 May 2016 19:23:33 +0000 (07:23 +1200)]
Split qsort from the main Yaffs Direct base

Use the system qsort if available. If not, then add in the
optional qsort.c

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
6 years agoWrite object headers with stored file extents charles_experiment
Charles Manning [Mon, 7 Mar 2016 19:03:06 +0000 (08:03 +1300)]
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>
6 years agoyaffs_vfs_multi.c: Some cleanups
Charles Manning [Mon, 7 Mar 2016 18:51:02 +0000 (07:51 +1300)]
yaffs_vfs_multi.c: Some cleanups

Remove some build time strings so that the binary deos not change
every time the code is compiled.

Add some support for kernel changes

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
6 years agoChange enums to u32 for stored fields
Charles Manning [Wed, 2 Mar 2016 02:27:31 +0000 (15:27 +1300)]
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>
6 years agoAdd usr mode flags
Charles Manning [Sun, 6 Dec 2015 06:25:48 +0000 (19:25 +1300)]
Add usr mode flags

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
6 years agoFurther extensions for VxWorks wrapper
Charles Manning [Wed, 11 Nov 2015 03:51:28 +0000 (16:51 +1300)]
Further extensions for VxWorks wrapper

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
6 years agoSome changes to get VxWorks wrapper working
Charles Manning [Thu, 22 Oct 2015 20:05:56 +0000 (09:05 +1300)]
Some changes to get VxWorks wrapper working

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
7 years agoyaffs: Remove unnecessary variable from checkpooint reading
Charles Manning [Mon, 1 Jun 2015 22:17:57 +0000 (10:17 +1200)]
yaffs: Remove unnecessary variable from checkpooint reading

No point in tracking ok if we're also going to break.

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
7 years agoyaffs: Keep checkpt rd/wr buffers
Charles Manning [Mon, 1 Jun 2015 21:52:23 +0000 (09:52 +1200)]
yaffs: Keep checkpt rd/wr buffers

Continual malloc/free on some systemcs can cause fragmentation. Better
to just allocate the buffers once and hold unto them.

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
7 years agoyaffs: Remove unused variable
Charles Manning [Sun, 31 May 2015 00:11:09 +0000 (12:11 +1200)]
yaffs: Remove unused variable

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
7 years agoyaffs direct: Fix wrong condition for O_CREAT | O_EXCL
Charles Manning [Sat, 30 May 2015 23:45:03 +0000 (11:45 +1200)]
yaffs direct: Fix wrong condition for O_CREAT | O_EXCL

Thanks Chris for pointing this out.

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
7 years agoyaffs: Clean up defeated conditional.
Charles Manning [Thu, 28 May 2015 21:09:48 +0000 (09:09 +1200)]
yaffs: Clean up defeated conditional.

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
7 years agoyaffs: Add handling for . and .. at end of path
Charles Manning [Thu, 21 May 2015 21:54:08 +0000 (09:54 +1200)]
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>
7 years agoAdd some more basic tests
Charles Manning [Thu, 21 May 2015 21:52:52 +0000 (09:52 +1200)]
Add some more basic tests

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
7 years agoyaffs: Fix yaffs_readdir when dereferencing a symlink
Charles Manning [Thu, 21 May 2015 05:27:01 +0000 (17:27 +1200)]
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>
7 years agoFix directory look up.
Charles Manning [Tue, 19 May 2015 22:21:52 +0000 (10:21 +1200)]
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>
7 years agoyaffs: fix missing checkpooint on yaffs remount
Charles Manning [Sun, 17 May 2015 08:02:46 +0000 (20:02 +1200)]
yaffs: fix missing checkpooint on yaffs remount

For yaffs file system, the mode of reading or writing is restricted at
four pointer where are mnt->mnt_flags,mnt->mnt_sb->s_flags,mtd->flags
and dev->read_only,the first three is used handle file and file
system(eg,remount) operation, and last one(dev->read_only) almost is used
handle checkpoint of yaffs2. However, in current code, the dev->read_only
only can be changed at first time when the yaffs2 file system is mounted,
later it can't be changed again(eg,mount -o remount), the result is that
the checkpoint's saving operation always can't succeed if you set readonly
mode for yaffs2 file system when it is mounted at the first time.

To fix this issue, we implement yaffs_remount_fs() which allows the
rootfs to be remounted as r/w.

Also fix one missing argument in yaffs_flush_whole_cache() call.

Signed-off-by: Wenlin Kang <wenlin.kang@windriver.com>