2009-02-22  Andrew Lunn  <andrew.lunn@ascom.ch>

	* cdl/jffs2.cdl: Add include-fixed to the system include files we
	should search. Without this gcc 4.3 breaks.

2009-01-12  Jonathan Larmour  <jifl@eCosCentric.com>

	* tests/jffs2-fileio1.c (jffs2_fileio1): When attempting mount
	of second device, actually use correct device name!

2008-06-09  Jonathan Larmour  <jifl@eCosCentric.com>

	* cdl/jffs2.cdl (CYGPKG_FS_JFFS2_CFLAGS_ADD): Conditionalise use of
	workaround for building with native linux tools so that it only
	applies when using synth target. Otherwise it can cause problems
	with some other third-party builds of the toolchain.

2008-04-02  Xinghua Yang <yxinghua@sunnorth.com.cn>
            Taiyun  Wang <taiyun@sunnorth.com.cn>
            Andrew Lunn <andrew.lunn@ascom.ch>

	* cdl/jffs2.cdl: Use CYGPKG_FS_JFFS2_RET_DIRENT_DTYPE to control
	whether jffs2 sets file type in jffs2_fo_dirread.
	* src/fs-ecos.c: Set file type in jffs2_fo_dirread.
	* tests/jffs2_1.c: Test the new d_type in dirent when present.
	
2007-10-24  Jonathan Larmour  <jifl@eCosCentric.com>

	* cdl/jffs2.cdl (CYGOPT_FS_JFFS2_ERASE_PENDING_ON_MOUNT): Make inactive
	if no write support, rather than requiring write support.
	(CYGOPT_FS_JFFS2_SECERASE): Don't activate if no write support.
	* src/dir-ecos.c (jffs2_lookup): silence signedness warnings.
	(jffs2_create): Not used if no write support.
	* src/flashio.c (jffs2_flash_read): Make write buffer unsigned char
	array to silence warnings.
	* src/fs-ecos.c: Conditionalise various unused functions if no write
	support - without linker section gc, links fail otherwise.
	(find_entry): Silence signedness warnings.
	(filldir): Ditto.
	(jffs2_fo_dirread): Ditto.
	* src/nodelist.c (jffs2_add_fd_to_list): Ditto.
	* src/nodemgmt.c: Conditionalise various unused functions if no write
	support.
	(jffs2_mark_node_obsolete): Don't try to make physical changes if no
	write support.
	* src/os-ecos.h: jffs2_flash_read now takes buffer as unsigned char
	array.
	(jffs2_flush_wbuf_pad): Silence "statement has no effect" warning.
	* src/read.c (jffs2_read_dnode): Silence signedness warnings.
	(jffs2_getlink): Not used with eCos, so ifdef out.
	* tests/jffs2-fseek1.c (main): Silence warnings when using SHOW_RESULT
	on a file position.

2007-08-09  Jonathan Larmour  <jifl@eCosCentric.com>

	* tests/jffs2_3.c (SHOW_RESULT): don't cast _res to unsigned if
	wanting to see if it's negative!
	(check_file): use correct error value with SHOW_RESULT.
	* tests/jffs2-secerase1.c: Ditto.

2007-07-27  Jonathan Larmour  <jifl@eCosCentric.com>

	* src/fs-ecos.c (jffs2_ops_rename): Fix return code sign. Fixes
	bug #1000428.

2007-07-25  Jonathan Larmour  <jifl@eCosCentric.com>

	* include/linux/jffs2_fs_sb.h (JFFS2_SB_FLAG_COMPLETING_OBSOLETES): 
	Define new flag for build phase where partially obsoleted nodes get
	properly obsoleted on the medium. Also add JFFS2_SB_FLAG_SCANNING
	and JFFS2_SB_FLAG_BUILDING in line with recent JFFS2 master sources.
	* src/build.c (jffs2_build_filesystem): Set above flags appropriately
	for each build phase.
	Add extra pass 1a to mark node refs that were requested to be obsoleted
	mid-scan to be obsoleted in memory after scan phase (pass 1) completion.
	Add pass 4 to properly obsolete nodes on medium that scan or build
	phases had wanted to mark obsoleted.
	* src/nodemgmt.c (jffs2_mark_node_obsolete): If in scan phase, add to
	scan_refs_to_obsolete list only after we've checked it isn't already
	obsolete. If in COMLETING_OBSOLETES phase, skip to correct part of
	function to mark on medium. If in build phase, exit early, adding
	node ref to scan_refs_to_obsolete, for later removal from medium in
	pass 4.
	Above changes are all part of fix for bug #1000426.

	* cdl/jffs2.cdl: Default JFFS2 test offset to same as generic flash
	package test offsets.	

2007-07-23  Jonathan Larmour  <jifl@eCosCentric.com>

	* src/gcthread.c (jffs2_set_gc_thread_wait_ticks): Really use provided
	ticks.
	(jffs2_garbage_collect_thread): Use sb ticks var, not constant.

2007-07-03  Jonathan Larmour  <jifl@eCosCentric.com>

	* src/gcthread.c (jffs2_garbage_collect_thread): Fix typo.

	* include/cyg/fs/jffs2/jffs2.h: New file to provide exported definitions.
	* src/fs-ecos.c: Rework change of 2007-07-02 for run-time gc thread
	tick delay change to work via cyg_fs_getinfo()/cyg_fs_setinfo()
	rather than ioctl.
	(jffs2_getinfo): Add FS_INFO_JFFS2_GET_GC_THREAD_TICKS support.
	(jffs2_setinfo): Add FS_INFO_JFFS2_SET_GC_THREAD_TICKS support.
	(jffs2_fo_ioctl): Revert 2007-07-02 changes.
	* src/os-ecos.h: Include above new jffs2.h header file to provide
	FS_INFO defines, and remove ioctl defines.
	* doc/jffs2.sgml: Adapt docs revised gc thread delay change API.

2007-07-02  Jonathan Larmour  <jifl@eCosCentric.com>

	* tests/jffs2-fileio1.c: Test O_TRUNC.

	* src/fs-ecos.c (jffs2_fo_ioctl): Add support for
	JFFS2_IOCTL_SET_GC_THREAD_TICKS and
	JFFS2_IOCTL_GET_GC_THREAD_TICKS ioctls.

	* src/gcthread.c (jffs2_set_gc_thread_wait_ticks): New function
	to allow above ioctl.
	(jffs2_get_gc_thread_wait_ticks): Ditto.
	(jffs2_start_garbage_collect_thread): Init wait ticks in sb.
	
	* src/os-ecos.h: Add s_gc_thread_wait_ticks to struct super_block,
	and prototype above gcthread.c new functions. Define new ioctl
	values.

	* doc/jffs2.sgml: Document new options from 2007-06-29 change, and
	above ioctl calls to set gc thread delay.

2007-06-29  Jonathan Larmour  <jifl@eCosCentric.com>

	* cdl/jffs2.cdl: Add new options
	CYGSEM_JFFS2_GC_THREAD_CAN_ERASE and
	CYGOPT_FS_JFFS2_ERASE_PENDING_ON_MOUNT.
	* src/fs-ecos.c (jffs2_mount): Follow
	CYGOPT_FS_JFFS2_ERASE_PENDING_ON_MOUNT setting.
	* src/gc.c (jffs2_garbage_collect_pass_complete_checks): Clarify
	explantory comment about return codes.
	(jffs2_garbage_collect_pass): Trivial tidy.
	(jffs2_garbage_collect_pristine): Note deletion dirents, and don't
	handle them as pristine after all. Fix for bug #1000413.
	* src/gcthread.c (jffs2_garbage_collect_thread): Follow
	CYGSEM_JFFS2_GC_THREAD_CAN_ERASE setting and call
	jffs2_erase_pending_blocks() if so.
	* tests/jffs2-secerase1.c (find_magic_in_flash): If get partial
	match, be sure to update overall count of how many bytes to check.

2007-06-28  John Dallaway  <jld@ecoscentric.com>

	* cdl/jffs2.cdl: Fix logic of nios2-elf-gcc 3.4.1 workaround.

2007-06-26  John Dallaway  <jld@ecoscentric.com>

	* cdl/jffs2.cdl: Workaround compiler optimisation bug when building
	gc.c using nios2-elf-gcc 3.4.1.

2007-06-22  Jonathan Larmour  <jifl@eCosCentric.com>

	* src/fs-ecos.c (jffs2_setinfo): Correct use of alloc_sem
	depending on jffs2_garbage_collect_pass_complete_checks()
	return code.
	* tests/jffs2-secerase1.c: Provide fallback rand() implementation
	if ISO one isn't around.
	* tests/jffs2_3.c: Ditto.	

2007-06-20  Jonathan Larmour  <jifl@eCosCentric.com>

	* src/gcthread.c (jffs2_suspend_garbage_collection_by_thread): 
	Correct assertion. Fix for bug #1000410.
	(jffs2_resume_garbage_collection_by_thread): Ditto.

2007-05-17  Jonathan Larmour  <jifl@eCosCentric.com>

	* cdl/jffs2.cdl: GC_THREAD requires write ability.
	
	* src/fs-ecos.c (jffs2_umount): Suspend garbage collection
	done by GC thread with FS unlocked before starting real
	unmounting procedure. This avoids race conditions.
	Resume thread GC if needed (in practice it wouldn't have
	been able to run anyway).
	* src/gcthread.c: Add ability to suspend/resume GC done
	by thread, thereby avoiding some race conditions when
	umounting.
	* src/os-ecos.h: Declare new
	jffs2_suspend_garbage_collection_by_thread and
	jffs2_resume_garbage_collection_by_thread functions.	

2007-05-15  Jonathan Larmour  <jifl@eCosCentric.com>

	* doc/jffs2.sgml: Document secure erase, garbage collection
	and gc thread, and misc doc improvements.

	* tests/jffs2_3.c (gc_test): test for GC thread should be #ifdef,
	not #if.

	* tests/jffs2-secerase1.c (se_test): Ditto.
	Also, tweak iterations for better progress display.
	Add extra info line to say what's happening in phase 1, and
	indicate phase 2.

2007-05-14  Jonathan Larmour  <jifl@eCosCentric.com>

	* cdl/jffs2.cdl: Add secure erase option.
	* tests/jffs2-secerase1.c: Add new test for secure erase.
	* src/fs-ecos.c (jffs2_umount): Only clear cyg_cdir_mtab_entry
	when definitely unmounting.
	(jffs2_secerase_do_potential_erases, jffs2_secerase_gc_block):
	New functions providing secure erase implementation.
	(jffs2_setinfo): Support secure erase.
	* src/gc.c (jffs2_garbage_collect_pass): Split out two new
	functions: jffs2_garbage_collect_pass_complete_checks to do
	CRC check part, and  jffs2_garbage_collect_pass_gc_block.
	Munge error code passing and locking in accordance.
	* src/gcthread.c (jffs2_garbage_collect_thread): Change fs
	locking - determine mte up front, and then unlock thread
	mutex before locking fs, to prevent deadlock.
	* src/os-ecos.h (struct super_block): s_gc_thread_shared_data
	has to be volatile.
	Declare jffs2_garbage_collect_pass_complete_checks() and
	jffs2_garbage_collect_pass_gc_block() from gc.c for use by
	fs-ecos.c secure erase.
	
	* tests/jffs2-fileio1-legacy.c (main): Cannot opendir "".
	Use "." instead.
	* tests/jffs2-fileio1.c: Silence lots of warnings.
	* tests/jffs2_3.c: Reduce iterations - too long for normal
	use. Someone can change by hand if want soak testing.
	(create_file): buffer is large, so make it static to prevent
	stack overflow.	

2007-05-09  Jonathan Larmour  <jifl@eCosCentric.com>

	* tests/jffs2-fileio1.c: Cannot opendir "". Use "." instead.

	* tests/jffs2-2t1f.cxx: Silence warnings.
	* tests/jffs2-2t2f.cxx: Ditto.

	* src/gcthread.c: Rework implementation - flag-based approach cannot
	work reliably - race conditions on termination. Use CV+mutex instead.
	* src/os-ecos.h: Remove unused members. Allocate structures needed
	for above change.
	* tests/jffs2_3.c: Give GC thread more of a chance to run, although
	only bother if CYGOPT_FS_JFFS2_GC_THREAD on.

2007-05-08  Jonathan Larmour  <jifl@eCosCentric.com>

	* Import garbage collection thread support from public CVS associated
	with this changelog entry:
  2004-11-14  Per Hedblom  <perhedblom@abem.se>
              Andrew Lunn  <andrew.lunn@ascom.ch> 
          
          * src/os-ecos.h: Added gc thread support
          * src/fs-ecos.c: Removed some includes
          * cdl/jffs2.cdl: Added gc thread support
          * tests/jffs2_3.c: New test to exercise the garbage collect code.
	  [And not mentioned...] src/gcthread.c: New file.

	After the above import:
	* cdl/jffs2.cdl: Improve CDL for above. Add jffs2_3 test. Use
	GC_THREAD in option names consistently.
	* src/gc.c (jffs2_garbage_collect_pristine): Fix mistake in
	assignment within expression.
	* src/nodemgmt.c (jffs2_mark_node_obsolete): Free inocache for unused
	inodes.
	* tests/jffs2-fileio1.c (SHOW_RESULT): Make string format match test
	infra expection.
	(prepare_device): Silence warning.
	* tests/jffs2_3.c: Many improvements, including: Add device
	preparation. Also better test device selection, better adaptation
	to configury. Add a window for GC thread to operate. Clear up
	iteration use. Don't require POSIX CRCs.
  	
2007-04-30  Nick Garnett  <nickg@ecoscentric.com>

	* src/fs-ecos.c (jffs2_umount): Update with new force argument.

2007-04-27  Jonathan Larmour  <jifl@eCosCentric.com>

	* src/fs-ecos.c (jffs2_ops_unlink): Set dir to root if called with
	NULL dir.
	(jffs2_ops_mkdir, jffs2_ops_rmdir, jffs2_ops_rename, jffs2_ops_link,
	jffs2_opendir, jffs2_chdir, jffs2_stat, jffs2_getinfo): Ditto.	

2007-01-24  Jonathan Larmour  <jifl@eCosCentric.com>

	* src/nodemgmt.c (jffs2_mark_node_obsolete): If mid-mount, don't
	really try to mark obsolete, but instead put on a list to obsolete
	later. Otherwise dirents for which there are subsequent deletion
	dirents will be found during the scan phase, but not be obsoleted
	on the medium.

	* src/build.c (jffs2_build_filesystem): Once safe to do so, obsolete
	nodes needing to be obsoleted but found during scan.

	* include/linux/jffs2_fs_sb.h: Add scan_refs_to_obsolete member to
	track raw node refs to obsolete which had been found during scan.

	* tests/testaux.hxx: operator new override cannot be static.

2006-12-14  Jonathan Larmour  <jifl@eCosCentric.com>

	* cdl/jffs2.cdl (CYGNUM_FS_JFFS2_ICACHE_SIZE): New option to allow
	unused inodes to persist longer in cache.
	* src/compr_rtime.c (jffs2_rtime_compress): Fix comparison for
	*dstlen == 1.
	* src/fs-ecos.c (icache_evict): Use CYGNUM_FS_JFFS2_ICACHE_SIZE
	to only evict inodes until we reach the size wanted. Fix for
	bug 1000350.
	(jffs2_umount): Fix debug message.
	(new_inode): Register additional i_cache use.
	(jffs2_iput): Register removal from i_cache.
	* src/os-ecos.h: Define i_cache_used counter in struct super_block,
	to count usage of inode cache.
	* src/nodelist.c (jffs2_get_inode_nodes): Don't access ref->next_in_ino
	after ref may have been obsoleted, and therefore freed.
	Ensure *highest_version only set when we're definitely using this node
	especially only if it's passed its CRC checks.
	Partial fix for bug 1000351.

2006-12-08  Jonathan Larmour  <jifl@eCosCentric.com>

	* src/nodemgmt.c (jffs2_mark_node_obsolete): Do not coalesce obsolete
	node with following physical node if it is in use as part of an
	inode. Fixes first part of bug 1000351.

2006-11-23  Jonathan Larmour  <jifl@eCosCentric.com>

	* src/fs-ecos.c: Force CYG_SYNCMODE_IO_FILESYSTEM locking for now.
	Resolves bug 1000343.

2006-10-23  Jonathan Larmour  <jifl@eCosCentric.com>

	* src/fs-ecos.c (jffs2_mount): Don't overwrite error code of close
	op when	returning error. Fix for bug 1000330.

2006-10-19  Jonathan Larmour  <jifl@eCosCentric.com>

	* doc/jffs2.sgml: Improve documentation on number of spare blocks
	required.

2006-06-05  Jonathan Larmour  <jifl@eCosCentric.com>

	* tests/jffs2-fileio1.c (jffs2_fileio1): Ensure CYG_TEST_INIT only
	called once.

2006-05-08  Jonathan Larmour  <jifl@eCosCentric.com>

	* src/build.c (jffs2_build_remove_unlinked_inode): Don't use
	next_in_ino field after jffs2_mark_node_obsolete() as it gets
	cleared. Fix for bug #1000275.

2006-04-24  Jonathan Larmour  <jifl@eCosCentric.com>

	* src/fs-ecos.c (jffs2_umount): Ensure we only close after optional
	re-locking.

2006-04-19  Jonathan Larmour  <jifl@eCosCentric.com>

	* cdl/jffs2.cdl: Add new CYGSEM_FS_JFFS2_UNLOCK_FLASH option to
	automatically unlock (and when unmounted, relock) flash blocks.
	* doc/jffs2.sgml: Clarify GC space requirements by giving numbers.
	* src/fs-ecos.c (jffs2_read_super): Implement
	CYGSEM_FS_JFFS2_UNLOCK_FLASH.
	(jffs2_umount): Likewise.
	* tests/jffs2-fileio1.c: Split main test routine into a subroutine,
	and call it twice from main() or cyg_start(), second time not
	erasing the device in order to sanity check remounting.
	Don't mount on /, mount on /j, otherwise we can't unmount /
	properly at end as it's the CWD.

2006-04-18  Jonathan Larmour  <jifl@eCosCentric.com>

	* src/fs-ecos.c (jffs2_mount): Only look up device if needed to avoid
	increasing its ref count.

2006-04-05  John Dallaway  <jld@ecoscentric.com>

	* cdl/jffs2.cdl: Add reference to package documentation.

2006-03-29  Jonathan Larmour  <jifl@eCosCentric.com>

	* tests/jffs2-2t1f.cxx (prepare_device): Silence warning.
	* tests/jffs2-2t2f.cxx (prepare_device): Ditto.
	* tests/jffs2-fileio1.c (prepare_device): Unlock flash if needed.
	* tests/jffs2-fseek1.c (prepare_device): Ditto.

2005-12-21  Jonathan Larmour  <jifl@eCosCentric.com>

	* tests/jffs2-2t2f.cxx: Unlock flash if needed.
	* tests/jffs2-2t1f.cxx: Ditto.

2005-06-17  Jonathan Larmour  <jifl@eCosCentric.com>

	* tests/jffs2-2t1f.cxx (checkfile): Silence a warning.

2005-02-28  Jonathan Larmour  <jifl@eCosCentric.com>

	* cdl/jffs2.cdl: Set RedBoot workspace heap size to be large enough
	if it's used.

2005-02-25  Andrew Lunn  <andrew.lunn@ascom.ch>

	* src/fs-ecos.c (jffs2_truncate_file): Correctly truncate a file
	when opening it with O_TRUNC. Test case from Knud Woehler.

2005-01-21  Jonathan Larmour  <jifl@eCosCentric.com>

	* doc/jffs2.sgml: Add documentation.

	* tests/jffs2-2t1f.cxx: Trim unnecessary test prerequisites. Use
	C linkage for cyg_start in NA case. 
	* tests/jffs2-2t2f.cxx: Ditto.
	* cdl/jffs2.cdl: Allow override of fixed flash test offsets even with
	FIS after all.

2005-01-19  John Dallaway  <jld@ecoscentric.com>

	* cdl/jffs2.cdl: Specify executable name of JFFS2 tests for
	compatibility with the eCos Configuration Tool.

2005-01-19  Jonathan Larmour  <jifl@eCosCentric.com>

	* Miscellaneous changes.

2004-12-10  Per Hedblom  <per.hedblom@abem.se>

	* src/fs-ecos.c: Use filesystem locking not file locking otherwise
	the node cache can be corrupted by multiple operations on
	different files at the same time.

2004-11-11  Andrew Lunn <andrew.lunn@ascom.ch>

	* Merge from public MTD.
	
2004-11-11  Andrew Lunn <andrew.lunn@ascom.ch>

	* src/build.c: Removed Oyvind Harboe's patch from 2004-04-19 
	since it was rejected upstream.
	
2004-10-20  Per Hedblom  <perhedblom@abem.se>

	* src/fs-ecos.c (jffs2_open): Call iput on dir node if
	jffs2_create fails.
	* src/fs-ecos.c (jffs2_umount): use jffs2_free_full_dirent instead
	of free.

2004-10-07  Knud Woehler <knud.woehler@microplex.de>

	* src/fs-ecos.c (find_entry): jffs2_lookup may return error codes.
	Check added.

2004-09-16  Dirk Eibach  <eibach@gdsys.de>
2004-09-19  Andrew Lunn  <andrew.lunn@ascom.ch>

	* cdl/jffs2.cdl: Fixed outdated definitions for compression options.
	* src/fs-ecos.c: Added missing calls for jffs2_compressors_init()
        and jffs2_compressors_exit() 

2004-08-13  Andrew Lunn  <andrew.lunn@ascom.ch>

	* src/compr.h: Committed this file which if forgot yesterday.

2004-08-12  Andrew Lunn <andrew.lunn@ascom.ch>
	    Gary Thomas <gary@mlbassoc.com>

	* Merge from public MTD.
	
2004-07-14  Andrew Lunn  <andrew.lunn@ascom.ch>

	* tests/fileio1.c (main): If we have two filesystem configured
	mount the second one on /mnt and list the root of it.
	* src/fs-ecos.c (jffs2_fo_write): Fixed a typo in a debug print 
	which is normally disabled.

2004-07-12  Andrew Lunn  <andrew.lunn@ascom.ch>

	* src/fs-ecos.c (jffs2_fo_lseek): Put back part of the fix for
	lseeking past the end of the file which was removed during the last
	merge with MTD.

2004-07-10  Andrew Lunn  <andrew.lunn@ascom.ch>

	* src/flashio.c (jffs2_flash_erase): Minor update for new
	flash API.

2004-04-19  Oyvind Harboe <oyvind.harboe@zylin.com>
	
	* src/build.c: JFFS2 can now be used as a write-once, read many mode
	for really small flash disks, e.g. configuration parameters.
	
2004-04-21  Gary Thomas  <gary@mlbassoc.com>

	* src/fs-ecos.c: Merge from public MTD - verify file position
	after each operation (safety check).

2004-04-06  Andrew Lunn  <andrew.lunn@ascom.ch>

	* src/fs-ecos.c (jffs2_extend_file): Fix creation of hole inode's
	* src/fs-ecos.c (jffs2_fo_lseek): Allow seeking past EOF.
	* tests/fseek1.c (main): fseek and simple test of a hole in a file
	* cdl/jffs2.cdl: Added new test program fseek1.
	
2004-03-31  David Woodhouse  <dwmw2@infradead.org>

	* src/fs-ecos.c (jffs2_fo_write): Set ri.isize so that non-append
	writes don't truncate the file.
	
2004-03-03  Thomas Koeller  <thomas.koeller@baslerweb.com>

        * src/fs-ecos.c: 
	Make JFFS2 honor O_TRUNC flag (again) when opening files with read
	Access.

2004-03-17  Oyvind Harboe <oyvind.harboe@zylin.com>

	* src/fs-ecos.c: 
	With CYGOPT_FS_JFFS2_WRITE=1, file creation failed. The problem
	was introduced in fs-ecos.c 1.20
	
2004-03-11  Oyvind Harboe <oyvind.harboe@zylin.com>
	
	* src/fs-ecos.c:
	  Fixed umount memory leak. root->jffs2_i.dents where not freed.
	
2004-02-20  Vincent Catros  <Vincent.Catros@elios-informatique.fr>

	* src/fs-ecos.c :
	(jffs2_find) Policy to skip path separator is no longer
	"if '/' then skip" but "while '/' then skip" allowing
	multi '/' separators (i.e : /tmp////foo).
	(find_entry) Policy to detect end of path is no longer
	"if '\0' then end_of_path"
	but "while '/' skip it and then if '\0' then end_of_path"
	allowing path terminated with any number of '/'
	(i.e : chdir(/tmp///)).

2004-03-03  Thomas Koeller  <thomas.koeller@baslerweb.com>

       * src/fs-ecos.c:
       Make JFFS2 honor O_TRUNC flag when opening files /w read access.

2004-02-17  David Woodhouse  <dwmw2@infradead.org>

	* src/fs-ecos.c:
	Don't re-initialise the already-locked f->sem. It makes eCos unhappy. 

2004-01-27  David Woodhouse  <dwmw2@infradead.org>

	* src/write.c: 
	Fix bug noted by Howard Gray; dirents belong to, and should dirty, 
	the _parent_inode, not the child (which may be zero in the case 
	of an unlink).

2004-01-09  Thomas Koeller  <thomas.koeller@baslerweb.com>

       * src/fs-ecos.c: Fixed inode reference counting in jffs2_ops_link().

2004-01-05  Thomas Koeller  <thomas.koeller@baslerweb.com>

	* cdl/jffs2.cdl: Re-added CYGPKG_FS_JFFS2_CFLAGS_REMOVE that had been
	removed by previous change.
	
2003-11-26  David Woodhouse  <dwmw2@infradead.org>

	JFFS2 cleanup and import of newer code. Remove last vestiges of
	Linuxisms such as 'struct inode' from the core code, leaving eCos
	with no excuse, and renaming the eCos 'struct inode' to make that
	point. Fix i_count handling throughout. Clean up remaining Linuxisms
	such as 'struct qstr' to the point where jffs2port.h can be removed.
	Add skeleton for background garbage-collect thread. Fix compression
	so that it's actually called, and even with the right pointers. Turn
	on -Werror again. Zero tolerance is a good thing. Make the i_mode
	conversion functions non-inline to avoid warnings. Fix namespace
	pollution (of all but ^jffs2_* at least). Move physical flash I/O
	functions into separate file flashio.c for relatively easy
	substitution. Various other cruftectomy.

2003-11-25  Andrew Lunn  <andrew.lunn@ascom.ch>

	* src/fs-ecos.c: ARM gcc 3.2.3 is also broken. Complain with any
	ARM gcc 3.2 compiler.

2003-11-21  Thomas Koeller  <thomas.koeller@baslerweb.com>

        * cdl/jffs2.cdl: Do not require zlib package if no
	compression configured.

2003-11-20  Thomas Koeller  <thomas.koeller@baslerweb.com>

        * cdl/jffs2.cdl:
        * src/malloc-ecos.c:
        * src/fs-ecos.c: Allocate jffs2_raw_node_ref structs
        from pool or malloc depending on a CDL configuration.

2003-11-20  David Woodhouse <dwmw2@infradead.org>

        * Rearrangement of the compression code into a cleaner API
	which can be disabled under control from CDL.
	
2003-10-14  Thomas Koeller  <thomas.koeller@baslerweb.com>

        * src/os-ecos.h: Made definition of CONFIG_JFFS2_FS_DEBUG
        conditional, so it can be overwritten by a -D compiler
        option.
                                                                               
2003-09-23  Thomas Koeller  <thomas.koeller@baslerweb.com>
                                                                               
        * src/fs-ecos.c: Another umount() fix.

2003-09-23  Andrew Lunn  <andrew.lunn@ascom.ch>

        * src/fs-ecos.c: Added test to detect known broken ARM compiler

2003-09-23  Thomas Koeller  <thomas.koeller@baslerweb.com>

        * src/fs-ecos.c: Fixed broken hard link creation.
        
2003-09-23  Andrew Lunn     <andrew.lunn@ascom.ch>

        * src/fs-ecos.c: Minor optimization of previous patch.
        
2003-09-21  Thomas Koeller  <thomas.koeller@baslerweb.com>
            Andrew Lunn     <andrew.lunn@ascom.ch>

        * src/fs-ecos.c: Do not decrement mount count for unsuccessful
        umount attempts.

2003-09-19  Thomas Koeller  <thomas.koeller@baslerweb.com>

        * src/fs-ecos.c: Another inode number fix.

2003-09-18  Thomas Koeller  <thomas.koeller@baslerweb.com>

        * src/fs-ecos.c: Inode number returned by stat() was bogus.

2003-07-27  Andrew Lunn  <andrew.lunn@ascom.ch>

        * src/os-ecos.h: Added new #defines require for the recent jffs2
        import.

2003-07-27  Michael Checky  <Michael_Checky@ThermoKing.com>
 
        * src/fs-ecos.c: Changed the return error code to be negative as
        expected by jffs2_flash_read() and jffs2_flash_write().
        
2003-04-23  Bob Koninckx  <bob.koninckx@mech.kuleuven.ac.be>

        * src/fs-ecos.c: mtab -> cyg_mtab. Ditto cyg_mtab_end. 

2003-03-25  Thomas Koeller  <thomas.koeller@baslerweb.com>

        * src/fs-ecos.c
        Fixed segmentation fault when unmounting file system.

2003-02-24  Jonathan Larmour  <jifl@eCosCentric.com>

        * cdl/jffs2.cdl: Fix doc link.

2003-02-05  Jonathan Larmour  <jifl@eCosCentric.com>

        * cdl/jffs2.cdl: Remove unused flash geometry CDL options.

2003-02-04  Gary Thomas  <gary@mlbassoc.com> on behalf of
2003-02-04  David Woodhouse <dwmw2@cambridge.redhat.com>        

        * src/write.c: 
        * src/scan.c: 
        * src/readinode.c: 
        * src/read.c: 
        * src/pushpull.h: 
        * src/os-ecos.h: 
        * src/nodemgmt.c: 
        * src/nodelist.h: 
        * src/nodelist.c: 
        * src/malloc-ecos.c: 
        * src/jffs2port.h: 
        * src/gc.c: 
        * src/file-ecos.c: 
        * src/erase.c: 
        * src/dir-ecos.c: 
        * src/compr_zlib.c: 
        * src/compr_rubin.c: 
        * src/compr_rtime.c: 
        * src/compr.c: 
        * src/build.c: 
        * cdl/jffs2.cdl: Update to latest public JFFS2 codebase.

        * src/list.h: 
        * src/jffs2_fs_sb.h: 
        * src/jffs2_fs_i.h: 
        * src/jffs2.h: 
        * src/jffs2.c: 
        * src/crc32.h: 
        * src/background.c: Removed/renamed file(s).

        * src/fs-ecos.c: 
        * include/linux/jffs2_fs_sb.h: 
        * include/linux/jffs2_fs_i.h: 
        * include/linux/jffs2.h: New file(s).

2002-12-06  Andrew Lunn  <andrew.lunn@ascom.ch>

        * cdl/jffs2.cdl: Implements the CYGINT_IO_FILEIO_FS interface.

2002-10-11  Andrew Lunn  <andrew.lunn@ascom.ch>

        * src/crc32.h (crc32): Use the CRC package for crc calculation
        * tests/romfileio1.c (main): Pass the name of the device to mount

2002-05-20  Jonathan Larmour  <jlarmour@redhat.com>

        * src/LICENCE: New file. Contains license for JFFS2, now GPL+exception.
        * src/background.c: Point at LICENSE file instead of existing text.
        * src/build.c: Ditto.
        * src/compr.c: Ditto.
        * src/compr_rtime.c: Ditto.
        * src/compr_rubin.c: Ditto.
        * src/compr_zlib.c: Ditto.
        * src/dir-ecos.c: Ditto.
        * src/erase.c: Ditto.
        * src/file-ecos.c: Ditto.
        * src/gc.c: Ditto.
        * src/jffs2.h: Ditto.
        * src/list.h: Ditto.
        * src/malloc-ecos.c: Ditto.
        * src/nodelist.c: Ditto.
        * src/nodelist.h: Ditto.
        * src/nodemgmt.c: Ditto.
        * src/os-ecos.h: Ditto.
        * src/pushpull.h: Ditto.
        * src/read.c: Ditto.
        * src/readinode.c: Ditto.
        * src/scan.c: Ditto.
        * src/write.c: Ditto.

2002-01-28  David Woodhouse  <dwmw2@cambridge.redhat.com>

        * src/super-ecos.c: Removed.
        * src/jffs2.c: Merge jffs2_write_super() and jffs2_put_super() into
        the routines from which they were called, put jffs2_read_super()
        in as a static function with a view to doing same RSN.
        * src/jffs2port.h: Remove prototypes of functions that died.
        * cdl/jffs2.cdl: Remove super-ecos.c
        * src/dir-ecos.c src/write.c: Increase highest_version _before_
        assigning to new node, not after.
        
2002-01-27  David Woodhouse  <dwmw2@cambridge.redhat.com>

        * src/read.c (jffs2_read_inode_range): Deal correctly with
        non-page-aligned read requests. We have to deal with the 
        case where we want to read from somewhere other than the
        beginning of a frag. 
        * src/jffs2.c (jffs2_fo_read): Use jffs2_read_inode_range
        instead of jffs2_readpage.

2002-01-25  Jonathan Larmour  <jlarmour@redhat.com>

        * cdl/jffs2.cdl: We want CYGPKG_IO_FILEIO_INODE.
        * src/dir-ecos.c (jffs2_symlink): Remove. eCos doesn't support symlinks.
        (jffs2_mknod): Similar.
        (jffs2_mkdir): Don't call d_instantiate - its a nop.
        (jffs2_rename): Ditto.
        * src/file-ecos.c (jffs2_commit_write): Don't set blocks.
        * src/jffs2.c (jffs2_flash_writev): Rewrite to only write aligned
        quantities to flash.
        * src/jffs2port.h: Lots of decrufting.
        * src/os-ecos.h: Ditto (a bit).
        * src/readinode.c (jffs2_read_inode): Don't set blocks/blksize in inode.
        * src/write.c (jffs2_new_inode): Ditto when __ECOS.
        (jffs2_write_dnode): don't call writev with extra vectors
        unnecessarily.
        * src/super-ecos.c (jffs2_statfs): Remove - unused.

2002-01-25  David Woodhouse  <dwmw2@cambridge.redhat.com>

        * src/super-ecos.c: Cruftectomy.
        * src/compr*.[ch] src/pushpull.h: Namespace cleanups merged from
        mainstream sources. Bit push functions made inline.
        * src/pushpull.c: Removed.
        * cdl/jffs2.c: Remove reference to pushpull.c
        * src/file-ecos.c: Cruftectomy. Lots of unused stuff here.
        * src/jffs2.c src/jffs2port.h: Remove some functions from jffs2.c
        which are no longer used, move some others to jffs2port.h as
        inline functions so they don't pollute the namespace.

2002-01-24  Jonathan Larmour  <jlarmour@redhat.com>

        * tests/fileio1.c: Check in listdir that the number of dirents is
        correct, taking into account existing files in case it's live.

        * src/dir-ecos.c (jffs2_readdir): move to....

        * src/jffs2.c (jffs2_fo_dirread): here. And fix the return code
        in the process so it now works.
        (filldir): Make inline and simpler.
        * src/jffs2port.h: remove filldir related stuff.

2002-01-24  David Woodhouse  <dwmw2@cambridge.redhat.com>

        * src/dir-ecos.c: Cruftectomy. Remove most of the stuff that was
        commented out. Remove jffs2_do_{create,link,unlink} to write.c
        * src/write.c: Add jffs2_do_{create,link,unlink} as in mainline.
        * src/nodelist.h: Prototypes for the above.
        * src/jffs2port.h: Don't include <pkgconf/kernel.h>. 
        
2002-01-23  Jonathan Larmour  <jlarmour@redhat.com>

        * src/jffs2.c (jffs2_mount): Allow multiple FSs, and integration
        with flash block device.
        (jffs2_flash_read): Use flash block device.
        (jffs2_flash_erase): Ditto.
        (jffs2_flash_write): Ditto.
        (do_flash_init): Remove - now done by block device layer
        * src/list.h: Remove and reimplement from scratch to avoid GPL.
        * src/os-ecos.h: Keep flash block dev handle in superblock.
        eCos does support obsoleting as it isn't NAND only.
        * src/dir-ecos.c (jffs2_readdir): Return correct value on success.
        Merge in changes mutatis mutandis from between v1.49 and v1.51 of
        dir.c in main repository.
        * cdl/jffs2.cdl: CYGPKG_MEMALLOC more accurately CYGINT_ISO_MALLOC.
        Only jffs2.c needs to be in libextras.a
        Requires Flash block devices as an alternative for hardcoding
        the sector size, flash size and base address.
        * src/super-ecos.c (jffs2_read_super): Use flash block device for
        sector and flash sizes.
        * tests/fileio1.c: mount using block device (defined by CDL).
        No need to init here - done by flash block device layer.
        
2002-01-21  David Woodhouse  <dwmw2@cambridge.redhat.com>

        * src/read.c: Obtain inode lock around reading symlink target.
        * src/dir-ecos.c: Fix the long-standing up() without down() in
        jffs2_readdir() when only the '.' and '..' entries are read, from
        v1.52 of master dir.c. Merge copyright date change from v1.50 - note
        that the portability cleanups from v1.51 aren't yet merged.
        * src/os-ecos.h: Add jffs2_can_mark_obsolete() and the macros
        for getting at generic inode fields from a struct jffs2_inode_info*
        * src/nodemgmt.c: Remove an #ifndef __ECOS and use 
        jffs2_can_mark_obsolete() instead.
        * src/jffs2port.h: up() is cyg_drv_mutex_unlock() not _release()
        * src/gc.c: Merge portability cleanups - get rid of a lot of
        references to 'struct inode'. Also include the attempt at NAND
        support in jffs2_garbage_collect_deletion_dirent().
        
2002-01-11  David Woodhouse  <dwmw2@cambridge.redhat.com>

        * src/jffs2port.h: Switch semaphore emulation to cyg_drv_mutex_t,
        remove some kernel includes which seem gratuitous.
        * cdl/jffs2.cdl: Require CYGPKG_MEMALLOC
        * src/compr_zlib.c src/compr.c: Merge changes from mainline code
        to make mkfs.jffs2 compile again.
        
2002-01-10  David Woodhouse  <dwmw2@cambridge.redhat.com>

        * src/jffs2.c: The 'mode' arg passed to jffs2_open() shouldn't
        have been called 'mode'. It's 'oflags'. You have to make up a 
        mode for the newly-created file yourself.
        * src/nodelist.h src/read.c: Fix jffs2_getlink() so it takes
        portable arguments, not a dentry. Move it to read.c and symlink.c
        becomes obsolete.
        * src/symlink-ecos.c: Removed.
        * cdl/jffs2.cdl: Remove symlink-ecos.c

2002-01-09  David Woodhouse  <dwmw2@cambridge.redhat.com>

        * Import updated JFFS2 sources into eCos tree.

2000-08-28  Dominic Ostrowski (dominic.ostrowski@3glab.com)

        * started on port of JFFS2 using ramfs as a template
        
//===========================================================================
// ####GPLCOPYRIGHTBEGIN####                                                
// -------------------------------------------                              
// This file is part of eCos, the Embedded Configurable Operating System.   
// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2006, 2007, 2008 Free Software Foundation, Inc.
// Copyright (C) 2004, 2006, 2007, 2008 eCosCentric Limited                 
//
// This program is free software; you can redistribute it and/or modify     
// it under the terms of the GNU General Public License as published by     
// the Free Software Foundation; either version 2 or (at your option) any   
// later version.                                                           
//
// This program is distributed in the hope that it will be useful, but      
// WITHOUT ANY WARRANTY; without even the implied warranty of               
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU        
// General Public License for more details.                                 
//
// You should have received a copy of the GNU General Public License        
// along with this program; if not, write to the                            
// Free Software Foundation, Inc., 51 Franklin Street,                      
// Fifth Floor, Boston, MA  02110-1301, USA.                                
// -------------------------------------------                              
// ####GPLCOPYRIGHTEND####                                                  
//===========================================================================
        

