Commit Graph

25 Commits

Author SHA1 Message Date
Gregory Nutt be3dd0bac6 fs/: Fix various coding standard issues found while testing tools/nxstyle.c 2019-03-01 15:01:04 -06:00
Gregory Nutt a037aeec5d Trivial update to a comments and to SPIFFS comments and debug output. 2018-09-30 07:15:15 -06:00
Gregory Nutt d23c5e0d61 fs/spiffs: Add a check for an error in a return value. Improve some working in the TODO list. 2018-09-29 17:19:04 -06:00
Gregory Nutt cc539d7f95 fs/spiffs: Need to flush cache to FLASH when closing file. Also updates TODO list. 2018-09-29 15:04:11 -06:00
Gregory Nutt d8bfb4e3a2 fs/spiffs: Fix some disagreement between the NuttX wrapper and the core SPIFFS with regard to meaning of a return value. This was causing more writes than necessary and wasting FLASH space. 2018-09-29 11:01:46 -06:00
Gregory Nutt 5fad655982 configs/sim/spiffs/defconfig: Remove CONFIG_EXPERIMENTAL. 2018-09-28 20:05:42 -06:00
Gregory Nutt 6a12213fbb fs/spiffs: I have been test with apps/examples/fstest which provides a good exercise but of the FS internals but not of the user interface. I build an SPIFFS aware NSH configuration and found and fixed a number of glaring usability errors: (1) Missing logic to stat the SPIFFS root directory, (2) Confusion in use to two similarly named struct field... caused files to be unexpectedly deleted. (3) Fixed a sempahore deadlock condition. And (5) Fix /procfs/mount. It was unaware of the SPIFFS file system type. 2018-09-28 17:35:25 -06:00
Gregory Nutt e90723307e fs/spiffs: Fix an error in who the deferred 'unlink' is handling in close(). Modify read() and write behavior() so that they do not return so many partial reads and writes. 2018-09-28 13:21:44 -06:00
Gregory Nutt 294456fa20 fs/spiffs: Add logic to dump the logical context of the FLASH. 2018-09-28 11:23:42 -06:00
Gregory Nutt 2ca8c6682c fs/spiffs: fs/spiffs: Fix several bugs: (1) Fix bad statfs return values. (2) Fix an error in spiffs_unlink(). Fix an in error detection logic when closing a file. 2018-09-27 19:29:00 -06:00
Gregory Nutt 2d2dd5e9e3 fs/spiffs: Fix bad check for return value. In NuttX all values greater than or equeal to 0 are successes. 2018-09-27 14:24:46 -06:00
Gregory Nutt 1273f727c0 File System IOCTLs: Three new IOCTLS were added for SPIFFS, two of which were duplicates. 2018-09-27 12:25:23 -06:00
Gregory Nutt 65ef3acf70 fs/spiffs: Still uses some internal error codes that should be replaced with errors from errno.h. For now, I just added a mapping function before any value is returned to the caller: And of these detailed internal errors are simply mapped to -EFTYPE. Most are related to improper internal data structures so -ETYPE is possibly appropriate. Aslo SPIFFs is no longer is EXPERIMENTAL. Many things work but I the code is very immature and many things will not work. 2018-09-27 11:33:09 -06:00
Gregory Nutt 554745946d fs/spiffs: The MTD interfaces needs its own, dedicated page buffer for read-modify-write operations. It cannot share the normal 'working' page buffer because it is sometimes in-use when the MTD interface needs it. Also and more DEBUG output and controls for the MTD interface. 2018-09-27 09:35:58 -06:00
Gregory Nutt 7a2f70495a fs/spiffs: Fix yet another interface with NuttX MTD. This time, the calculation of the number of whole blocks. 2018-09-26 20:00:25 -06:00
Gregory Nutt 5cc68ad3b8 fs/spiffs: Fix yet another interface with NuttX MTD. This time, the calculatio of the terminal block number. 2018-09-26 18:30:46 -06:00
Gregory Nutt b4488a0549 fs/spiffs: Fix an error in write operation. examples/fstest now gets further before errors occur, but still does not work correctly. 2018-09-26 18:00:46 -06:00
Gregory Nutt 31e6fb561b fs/spiffs: Costmetic name changes more more consistency. 2018-09-26 15:50:55 -06:00
Gregory Nutt d59893a456 fs/spiffs: Fixes yet another SPIFFS/MTD interfacing bug. 2018-09-26 15:16:38 -06:00
Gregory Nutt 63ba200957 fs/spiffs: Correct error in MTD multi-block read/write logic. 2018-09-26 12:29:42 -06:00
Gregory Nutt 6d2cce99e1 fs/spiffs: Fix more problems found in testing. It is getting closer but examples/fstest is still showing problem. 2018-09-26 10:05:43 -06:00
Gregory Nutt 71eac2d530 fs/spiffs: Correct the MTD block write logic. 2018-09-25 18:05:45 -06:00
Gregory Nutt 9984e209ab fs/spiffs: Various fixes from initial testing. Still lots of issues. Also changes from further review to get better naming consistency and functional partitioning. 2018-09-25 16:19:03 -06:00
Gregory Nutt 8373784afe Squashed commit of the following:
fs/spiffs:  Finished review, update, and repartitioning of spiffs_core.c.

    fs/spiffs:  Converted macro SPIFFS_VALIDATE_OBJIX to a function.

    fs/spiffs:  Move SPIFFS_VALIDATE_DATA and SPIFFS_CHECK_RES macros inline.
2018-09-25 12:15:24 -06:00
Gregory Nutt ec498d2660 This commit brings in an inital port of the SPIFFS flash file system into NuttX. The file system is still untested at this point (and subject to some additional review). It is, however, marked EXPERIMENTAL should this should not cause a problem for anyone.
Squashed commit of the following:

    fs/spiffs:  Fix last compilation issue.  Now compiles without error.  It is still not quite ready for testing as there is additional code review that must be be performed.  It is now marked as EXPERIMENTAL so that it can be brought onto the master branch with little risk.

    fs/spiffs:  Remove some dead code.

    fs/spiffs:  Weak start of analysis of spiffs_nucleus.c.  Renamed to spiffs_core.c

    fs/spiffs:  Rename spiffs_nucleus.c to spiffs_core.c

    fs/spiffs:  Remove spiffs_config.h.  All configuration settings are now available in the SPIFFS Kconfig options.

    fs/spiffs:  Finished review, update, and repartitioning of spiffs_check.c.  Added spiffs_check.h.

    fs/spiffs:  Finished review, update, and repartitioning of spiffs_cache.c.  Added spiffs_cache.h.

    fs/spiffs:  Clean up some defines used in debug output statements.

    fs/spiffs:  Finished review, update, and repartitioning of spiffs_gc.c.  Added spiffs_gc.h.

    fs/spiffs:  Now that VFS interface is completed, I have begun the long march of repartitioning the remaining functionality, reviewing logic, identifying dead code, and cleaning up loose ends.

    fs/spiffs:  Initial integration of MTD interface, replacing the SPIFFS native flash interface.  Lots of open issues such as the use of pages vs. blocks vs. erase blocks and units of addresses, offsets, and lengths that are passed in function calls.  Remove SPIFFS_USE_MAGIC support.  That option (which default to OFF anyway), wrote a magic value at the beginning of every sector and support verifiable identification of the file system.  It was not being and used and removing it makes life simpler.

    fs/spiffs:  Remove semaphore lock on the file object structure.  Ultimately, the file access must modify the volume and access the volume structue which also has a exclusivity lock.  So use of the volume lock alone should be sufficient.

    Integrated the SPIFFS rename logic into the NuttX VFS.  Removed non-standard application calls or convert them to IOCTL commands.  These were converted to IOCTL commands:  (1) integrity check, (2) garbage collection, and (3) format flash.  These were removed:  (1) Integrity check callback.  These provided a lot of good information about the state of the file system, but such callbacks are not compatible with a POSIX compliant file system.  (2) Index maps.  The index maps were a performance improvement feature.  The user could provide the memory and request that a region of a a file use that memory for improved lookup performance when accessing parts of the file.  The fallback is the less performance lookup by traversing the FLASH memory.  (3) Removed the quick garbage collection interface (the code is still used internally).  Only the full garbage collection is available to the user application via IOCTL.

    configs/sim/spiffs:  A simulator configuration to use for testing SPIFFS.

    fs/spiffs:  Integrate SPIFFS logic into NuttX VFS bind() and unbind() methods.

    fs/mount/fs_mount.c:  Add SPIFFS to the list of drivers that require MTD vs block drivers.

    fs/spiffs:  Trivial changes, mostly from analysis of how to integrate the rename() VFS method.

    fs/spiffs:  Connect NuttX VFS unlink method to the SPIFFS_remove() function.  Lots of name-changing.

    fs/spiffs:  Remove non-standard errno support.  Remove bogus SPIFFS_LOCK() and SPIFFS_UNLOCK() macros.

    fs/spiffs:  Add NuttX VFS implementation for statfs() method.  Clean up some of the accumulating compilation problems.

    fs/spiffs:  Add stat(), truncate() methods.  Dummy out unsupport mkdir() and rmdir() methods.

    fs/spiffs:  Replace some of the custom error numbers with standard error numbers.

    fs/spiffs:  Hooks read(), write(), fstat(), ioctl(), opendir(), closedir(), rewindif(), and readdir() into the NuttX VFS.

    fs/spiffs:  Beginning the organization to work with the NuttX VFS.  Lots of things are get broken!

    fs/spiffs:  Add spiffs.c which will be the interface between SPIFFS and NuttX.  No very close at present, however.

    fs/spiffs:  Clean up some compile problems introduced by coding standard changes.

    fs/spiffs:  A little closer to NuttX coding standard.

    fs/spiffs:  Ran tools/indent.sh against all files.  Closer to NuttX coding standard, but needs a lot more effort to be fully compliant.

    fs/spiffs:  This commit brings in version 0.3.7 of Peter Anderson's SPIFFS.  The initial commit includes the core FS files (with some definitions destributed to their correct header files) and hooks into the build system.
2018-09-24 18:05:09 -06:00