Commit Graph

1088 Commits

Author SHA1 Message Date
Gregory Nutt
706b20a49f fs/vfs/fs_read.c: Elimnate a warning noted by Anonymouns in Issue 124. 2018-10-12 14:58:21 -06:00
Gregory Nutt
4391b51cd3 fs/procfs/fs_procfsproc.c: Change output of the env file so that it looks more like output from the 'env' command. Documentation/NuttShell.html: Document the new NSH 'env' command. 2018-09-30 11:15:28 -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
Gregory Nutt
91410573ef fs/mount/fs_mount.c: Correct an error introduced in the last commit (but only when file systems that need MTD drivers are included. 2018-09-22 14:39:11 -06:00
Gregory Nutt
992b293122 Squashed commit of the following:
fs/driver and fs/mount:  Add mount() support for file systems that require MTD drivers (vs. block drivers).
    fs/drivers:  Add support for named MTD drivers in the psuedo file system.  This will, eventually, allow us to mount file systems that need MTD drivers without having to fake an intervening block driver.
2018-09-22 14:20:18 -06:00
Gregory Nutt
913d013d8f Revert last change to the TODO list. There is no issue. 2018-09-19 12:15:04 -06:00
Gregory Nutt
94f26c0220 fs/inode/fs_fileclose.c: Move file_close() a separate file. It no longer makes since for it to cohabitate with file_detach(). 2018-09-15 13:19:14 -06:00
Gregory Nutt
3a4984a40b Rename file_close_detached() to juse file_close() for better consistency in naming. 2018-09-15 13:04:56 -06:00
Gregory Nutt
a7fd58c4db Squashed commit of the following:
many locations:  Change occurences of open() followed by file_detach() to file_open().  Change most non-controversion calls to open() to nx_open().

    fs/inode/fs_fileopen.c:  Flesh out file_open() with some interim, placeholder logic.

    fs/inode/fs_fileopen.c:  Add a framework for a file_open() implementation (no real logic in place yet).

    fs/vfs/fs_open.c:  Add nx_open() which is the same as open() except that it does not create a cancellation point nor does it modify the errno variable.
2018-09-15 10:49:41 -06:00
EunBong Song
a279815434 fs/smartfs/smartfs_smart.c: Current sector should have a space for next entry size. If not, we should move to next sector. 2018-09-14 06:36:55 -06:00
Gregory Nutt
fc127fd297 sched/signal: Add a generic signal notification facility. Modify the custom IOB available notifier so that it is now just a wrapper around this generic signal notification. This generic signal notification faility will, eventually, be used to support network polling.
Squashed commit of the following:

    mm/iob:  The IOB available notifier is now just a wrapper around the common signal notifier.

    sched/signal:  Add a generic signal notification facility.

    sched/signal/sig_evthread.c:  More trivial naming changes.

    sched/signal:  Rename nxsig_notification() to nxsig_evthread() to make forthcoming naming additions more consistent.
2018-09-09 08:32:37 -06:00
Gregory Nutt
33e3fb7a70 Correct mispellings of pseudo. Update some comments in signal.h. 2018-09-05 11:56:14 -06:00
Gregory Nutt
a7265d71c6 This commit adds support for default signal actions for SIGSTOP, SIGSTP, and SIGCONT.
Squashed commit of the following:

    Add procfs support to show stopped tasks.  Add nxsig_action() to solve a chicken and egg problem:  We needed to use sigaction to set default actions, but sigaction() would refuse to set actions if the default actions could not be caught or ignored.

    sched/signal:  Add configuration option to selectively enabled/disable default signal actions for SIGSTOP/SIGSTP/SIGCONT and SIGKILL/SIGINT.  Fix some compilation issues.

    sched/sched:  Okay.. I figured out a way to handle state changes that may occur while they were stopped. If a task/thread was already blocked when SIGSTOP/SIGSTP was received, it will restart in the running state.  I will appear that to the task/thread that the blocked condition was interrupt by a signal and returns the EINTR error.

    sched/group and sched/sched:  Finish framework for continue/resume logic.

    sched/signal:  Roughing out basic structure to support task suspend/resume
2018-08-30 10:27:18 -06:00
Gregory Nutt
d88cb93d95 fs/vfs and fs/inode: Trivial typo fixes gleaned from the fileopen branch. 2018-08-29 16:01:56 -06:00
Xiang Xiao
70a0bf0849 Squashed commit of the following:
fs/partition/fs_partition.c:  Add PTABLE parser

    fs/partion:  Add a partition parser framework

    fs/driver/fs_blockpartition.c:  Add register_blockpartition for block partition
2018-08-28 07:30:21 -06:00
Gregory Nutt
05faba2514 include/nuttx/fs/fs.h: ... conflicting types for file_fstat(). 2018-08-26 16:13:09 -06:00
dongjianli
56883eef3b fs/vfs/fs_poll.c: Add poll use in kernel space. 2018-08-26 13:44:07 -06:00
Xiang Xiao
3f50451046 fs/vfs/fs_fcntl.c, net/socket/net_dupsd.c, and net/socket/net_vfcntl.c: Add file_fcntl, psock_fcntl, and psock_dupsd for use within the kernel. 2018-08-26 13:31:18 -06:00
ligd
aa52c457cc fs/vfs/fs_fstat.c: Add file_fstat() function for internal OS use. 2018-08-26 13:26:37 -06:00
anchao
6361f93fda fs/vfs/fs_select.c: Make select be more consistent with Linux man page: 'The timeout
... Some code calls select() with all three sets empty, nfds zero, and a non-NULL timeout as a fairly portable way to sleep with subsecond precision.'
2018-08-26 13:19:28 -06:00
Xiang Xiao
3be976fd34 fs/mount/mount.h: Fix warning, 'No newline at end of file' 2018-08-26 13:13:11 -06:00
zhangyuan7
37b9bbbdef fs/nfs: Update nfs mount to VER3 2018-08-26 13:11:24 -06:00
anchao
18e5e75008 fs/romfs/fs_romfsutil.c: Make romfs_devread32 more portable 2018-08-26 13:03:01 -06:00
ligd
a0f7d7d014 fs/hostfs/hostfs.c: Add re-try when hostfs mount() fails 2018-08-26 12:22:08 -06:00
Xiang Xiao
3616a0fd06 fs/hostfs/hostfs.c: Ensure f_type is equal to HOSTFS_MAGIC. 2018-08-26 12:13:58 -06:00
ligd
8c4cf3f2c9 fs/hostfs/hostfs.c: Support remote directory names without a trailing '/' 2018-08-26 12:12:16 -06:00
Xiang Xiao
be542d530a fs/hostfs/Kconfig: Remove ARCH_SIM dependence since other architectures (e.g., arm semihosting) could support hostfs too 2018-08-26 12:10:54 -06:00