Commit Graph

55 Commits

Author SHA1 Message Date
Gregory Nutt 1fd6c432fc configs/makerlisp/nsh/defconfig: Enable Procfs, RTC, and SPI-based SD support. Various fixes under arch/z80/src/ez80 for a clean compile. 2019-06-16 14:45:38 -06:00
Xiang Xiao 579b38b760 fs/mount and fs/unionfs: Support mount unionfs from nsh command. 2019-03-19 08:39:05 -06:00
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 a64869aa67 CONFIG_NFILE_DESCRIPTORS=0 can no longer be used to disable the file system. NuttX with no file system does not make sense.
Squashed commit of the following:

    configs/:  The few configurations that formerly set CONFIG_NFILE_DESCRIPTORS=0 should not default, rather they should set the number of descriptors to 3.
    fs/:  Remove all conditional logic based on CONFIG_NFILE_DESCRIPTORS == 0
    tools/:  Tools updates for changes to usage of CONFIG_NFILE_DESCRIPTORS.
    syscall/:  Remove all conditional logic based on CONFIG_NFILE_DESCRIPTORS == 0
    libs/:  Remove all conditional logic based on CONFIG_NFILE_DESCRIPTORS == 0
    include/:  Remove all conditional logic based on CONFIG_NFILE_DESCRIPTORS == 0
    drivers/:  Remove all conditional logic based on CONFIG_NFILE_DESCRIPTORS == 0
    Documentation/:  Remove all references to CONFIG_NFILE_DESCRIPTORS == 0
    binfmt/:  Remove all conditional logic based on CONFIG_NFILE_DESCRIPTORS == 0
    arch/:  Remove all conditional logic based on CONFIG_NFILE_DESCRIPTORS == 0
    net/:  Remove all conditional logic based on CONFIG_NFILE_DESCRIPTORS == 0
    sched/:  Remove all conditional logic based on CONFIG_NFILE_DESCRIPTORS == 0
    sched/Kconfig:  CONFIG_NFILE_DESCRIPTORS may no longer to set to a value less than 3
    configs/:  Remove all settings for CONFIG_NFILE_DESCRIPTORS < 3
2019-02-11 12:09:26 -06:00
Xiang Xiao af5e479fb5 fs/littlefs: VFS wrapper improvement: (1) Support block device interface, (2) support ioctl, stat and sync file operation, (3) support forceformat and autoformat option, (4) update file->f_pos and dir->fd_position, (5)remote the internal struct from dir, and (6) emove mtd byte read/write requirement. 2019-01-27 12:31:28 -06:00
Xiang Xiao 5708a1ac73 fs/mount and fs/romfs: Add support to mount a ROMFS volume using an MTD driver interface using the standard mount() operation. 2019-01-27 12:07:37 -06:00
lihaichen 87a5e4cd2d Addes the ARM mbed littlefs to NuttX
Squashed commit of the following:

Author: Gregory Nutt <gnutt@nuttx.org>
    fs/littlefs:  Fix some compilation errors.
    fs/littlefs:  Brings code a little closer to NuttX coding standard.  Not 100%, but closer.
    fs/littlefs:  Convert all C++ style comments to C comments.

Author: lihaichen <li8303@163.com>

    fs/littlefs:  Adds port of the mbed littlefs.

    depends on !DISABLE_MOUNTPOINT && MTD_BYTE_WRITE

        register_mtddriver("/dev/w25", mtd, 0755, NULL);
        mount("/dev/w25", "/w25", "littlefs", 0, NULL);
2019-01-09 14:26:51 -06:00
Gregory Nutt 9d09b5aad7 Eliminate a warning found in build testing. 2018-11-09 13:23:12 -06:00
Xiang Xiao f40a1c6749 fs/mount/fs_mount.c mount: Add support for mounting a file system with either a block or an MTD driver. 2018-11-08 09:51:06 -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 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
Xiang Xiao 3be976fd34 fs/mount/mount.h: Fix warning, 'No newline at end of file' 2018-08-26 13:13:11 -06:00
Gregory Nutt dfd2d218e3 fs/mount/fs_automount.c: Ignore return values from work_cancel(). 2018-06-27 06:30:05 -06:00
Gregory Nutt 8e6afb958a net/udp: If the interface index of the device bound to a UDP socket is no longer valid because the device has been unregistered, then un-bind the UDP socket. 2018-06-26 06:53:13 -06:00
Michał Łyszczek 1d8fd9e034 fs/mount: Fix wrong size reported by df -h. Reason is that size in bytes is calculated always on uint32_t types and cards bigger than 4GB will overflow uint32_t type. Solution is to use uint64_t where possible. 2018-04-14 15:15:59 -06:00
Gregory Nutt 3ec02adee0 tools/genromfs.c: Improve check for empty directories. If the directory contains only unsupported, special files, then it is still empty. Fix some collection of statistics that was cause statfs() to return some incorrect values. Add logic to handle the case where the host and the target differ in endian-ness. fs/procfs: In show mountpoints, add support so that the CROMFS file system type is recognized. 2018-03-21 08:40:02 -06:00
Gregory Nutt 0478b5bce4 Addes CROMFS prototype. CROMFS is a commpressed, in-memory read-only file system based on LZF.
Squashed commit of the following:

    fs/cromfs:  Now depends on EXPERIMENTAL because it is not yet verified.
    fs/cromfs:  This commit brings the CROMFS file system to code complete.  Still completely untested.  Next steps:  Need a tool to generate CROMFS file system images and a test case under apps/
    fs/cromfs:  Add logic to traverse the in-memory file system nodes.
    fs/cromfs:  Add initial support for an in-memory, compressed, read-only file system.
2018-03-19 07:08:40 -06:00
Gregory Nutt 7cf88d7dbd Make sure that labeling is used consistently in all function headers. 2018-02-01 10:00:02 -06:00
Gregory Nutt da50646bcf sched/wdog: wd_start() is an internal OS function and should not set the errno value. Reviewed and updated every call to wd_start() to verify if return value is used and if so if the errno value is accessed. 2018-01-31 10:09:14 -06:00
Gregory Nutt 6e9039bb08 Squashed commit of the following:
fs/userfs:  This completes coding of the UserFS client and of the UserFS feature in general.  This feature is being merged to main now because I believe it is innocuous.  It is, however, untesed.  The next step will be to develop a test case to verify the feature.
    fs/userfs:  Completes the request logic for the UserFS client.  Still need the logic that receives the responses.
    fs/userfs:  Completes coding for most of the server side of the user filesystem logic.
    fs/userfs:  Big design changes, simplications. Use Unix domain local sockets instead of message queues.  Easier to transfer big data in local sockets than message queues.  Remove character drvier 'factory' it is not necessary.
    fs/userfs:  Minor reparitioning; volume private info does not need to be held on the OS client side.
    libc/userfs:  Add some of the server side logic.
    fs/userfs:  Add some UserFS initialization logic.
    fs/userfs:  Add frame work for the UserFS proxy.  Remove all references to a block driver.  There is no block dricer... what was I thinking?
    fs/userfs: Add some initialization of the character driver, 'factory' device.
    fs/userfs:  Rename from fusefs to userfs to that we don't stomp on someone else's cool name.
    Add a header file describing the fusefs interface.
2017-10-30 18:07:42 -06:00
Gregory Nutt 1ed816de4b Squashed commit of the following:
fs/mount:  Implements procfs /proc/fs/blocks and /proc/fs/usage files, replacing the NSH df command.
    fs/mount:  Implements procfs /proc/fs/mount file, replacing the NSH mount command when there are not arguments.
    fs/: Move prototype of foreach_mountpoint out of include/nuttx/fs/fs.h to fs/mount/mount.h.  Add framework for the mount procfs (initial commit is just a close of the net/route table procfs.
2017-10-26 13:33:08 -06:00
Gregory Nutt 45fd98da88 Add macros support that will eventually allow dynamic allocation of strings need to support soft links. 2017-02-05 14:25:45 -06:00
Gregory Nutt 8f2c7198ed inode_find: Now takes struct inode_desc_s type as input. This was necessary before that structure includes some data storage. It was used within inode_find(), but that means that the life of the data was the life of inode_find(). That data must persist longer. It is now provided by the caller so that the life of the data persists for the entire life of the caller. 2017-02-05 09:51:42 -06:00
Gregory Nutt 990bed903e Soft link: First cut fix for some soft link issues. The fix still has some issues of its own. 2017-02-04 16:35:49 -06:00
Gregory Nutt 0c9935f8ac FS: Remove inode_find_nofollow. Instead provide a bool nofollow argument to inode_find. 2017-02-04 11:46:54 -06:00
Gregory Nutt 36704b7d9c FS: Argument is now a structure describing the search. 2017-02-04 11:21:44 -06:00
Gregory Nutt a0f567f4a3 Update TODO, cosmetic changes, spelling -- US English spells it canceled and canceling vs cancelled and cancelling. No idea why. 2016-12-09 18:39:40 -06:00
Petteri Aimonen 69577eb0b7 libnx/nxglib: Fix handling of near-horizontal lines of width 1 in nxgl_splitline(). Missing handling for degenerate condition caused width 1 lines such as (0, 0) - (100, 10) to have gaps in the drawing. 2016-09-22 11:09:06 -06:00
Gregory Nutt 93b48ea70f Fix a logic error introduced with last commit 2016-09-22 08:50:47 -06:00
Gregory Nutt 8221c2da64 Corrects a bad assertion noted by Pierre-noel Bouteville. Also fixes a reference counting problem in an error condition: When the mountpoint inode is found but is not an appropriate mountpoint, the reference count on the inode was not being decremented. 2016-09-22 08:22:28 -06:00
Gregory Nutt 43eb04bb8f Without lowsyslog() *llinfo() is not useful. Eliminate and replace with *info(). 2016-06-20 11:59:15 -06:00
Gregory Nutt ad2f7b0119 fs/: Change some *err() message to *info() messages if what was a *dbg() message does not indicate and error condition. 2016-06-11 17:14:02 -06:00
Gregory Nutt a1469a3e95 Add CONFIG_DEBUG_ERROR. Change names of *dbg() * *err() 2016-06-11 15:50:49 -06:00
Gregory Nutt fc3540cffe Replace all occurrences of vdbg with vinfo 2016-06-11 11:59:51 -06:00
Sebastien Lorquet 3c594b5ba1 Allows the use of tmpfs when no block driver is available. This is correctly done to define NONBDFS but below the structure is not where it should be. 2016-05-11 06:48:30 -06:00
Gregory Nutt 972181697a fs_mount.c edited online with Bitbucket. Fix problem noted by David Sidrane. 2016-04-29 07:11:42 +00:00
Gregory Nutt 9008308b64 Remove some block comments before empty code sections 2016-04-11 18:16:04 -06:00
Gregory Nutt 0fb035f76b Standardize some naming in code section comments 2016-02-21 18:09:04 -06:00
Ken Pettit c0b9dcf8a9 fs/hostfs: Add a special file system for use with simulator that supports access to the host file system from the simulation. From Ken Petit 2015-11-25 08:26:26 -06:00
Gregory Nutt d359a5be13 TMPFS: Code complete, but not yet functional 2015-10-09 11:02:59 -06:00
Gregory Nutt af086c40ff Remove dangling whitespace 2015-10-04 15:28:54 -06:00
Gregory Nutt 0b12dbf95d Fix some spacing problems 2015-10-04 15:04:00 -06:00
Gregory Nutt cb9e27c3b0 Standardize naming used for public data and function groupings 2015-10-02 16:30:35 -06:00
Gregory Nutt cc7130b836 Correct a reference counting error in mq_open() 2015-09-23 10:34:08 -06:00
Gregory Nutt a25ad1417e Updte a README file 2015-06-12 08:46:54 -06:00
Gregory Nutt 4607a8435f FS: Add the ability to mount a file system on top of en existing node in the psuedo-file system 2015-06-11 10:10:25 -06:00
Gregory Nutt 8055ba4d03 Pass the umount2() flags to every unbind() implementation. That is where the the decision to umount or not will be made. 2015-03-14 17:22:02 -06:00
Gregory Nutt f932b26db1 Add umount2(). umount() is now a macro that just calls umount2() with flags = 0. 2015-03-14 16:48:45 -06:00