Commit Graph

42 Commits

Author SHA1 Message Date
zhongan
5aa0e302a4 fs: add missing macro 'CONFIG_FS_HOSTFS' for 'NODFS_SUPPORT'.
When just enable 'CONFIG_FS_HOSTFS', NODFS_SUPPORT may not enable.

Change-Id: I8317f18bf3ceae873e29c027561948c17b4aab38
Signed-off-by: zhongan <zhongan@xiaomi.com>
2020-10-17 23:22:35 +08:00
YAMAMOTO Takashi
1078210f7f fs/mount/fs_mount.c: Remove a redandunt assignment
Found by clang-check:

mount/fs_mount.c:287:8: warning: Although the value stored to 'ret' is used in
      the enclosing expression, the value is never actually read from 'ret'
      (ret = find_blockdriver(source, mountflags, &drvr_inode)) >= 0)
       ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
2020-07-30 08:59:46 +02:00
Xiang Xiao
de33f86ae3 fs: Add nx_mount/nx_umount2 function
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-08 07:20:49 -06:00
Gregory Nutt
a4d6af8343 Check return from nxsem_wait_initialize()
Resolution of Issue 619 will require multiple steps, this part of the first step in that resolution:  Every call to nxsem_wait_uninterruptible() must handle the return value from nxsem_wait_uninterruptible properly.  This commit is only for those files under fs/inode.  Utility functions under fs/incode were modified so the changes do extend to other fs/ sub-directories as well.
2020-03-30 01:33:31 +01:00
Gregory Nutt
156963a903 Check return from nxsem_wait_initialize()
Resolution of Issue 619 will require multiple steps, this part of the first step in that resolution:  Every call to nxsem_wait_uninterruptible() must handle the return value from nxsem_wait_uninterruptible properly.  This commit is only for those files under fs/tmpfs and fs/spiffs.  Still do do:  The rest of fs/ and all of drivers/ and arch/.
2020-03-29 22:11:13 +01:00
Gregory Nutt
2b532ae4a8 fs/: Remove support for CONFIG_FS_READABLE 2020-03-22 08:24:07 -05:00
Xiang Xiao
68951e8d72 Remove exra whitespace from files (#189)
* Remove multiple newlines at the end of files
* Remove the whitespace from the end of lines
2020-01-31 09:24:49 -06:00
Gregory Nutt
bd3cc792ff fs/: Run all .c files under fs/ through tools/nxstyle. 2019-10-27 11:48:14 -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
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
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
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
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
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
0c9935f8ac FS: Remove inode_find_nofollow. Instead provide a bool nofollow argument to inode_find. 2017-02-04 11:46:54 -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
a1469a3e95 Add CONFIG_DEBUG_ERROR. Change names of *dbg() * *err() 2016-06-11 15:50:49 -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
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
f932b26db1 Add umount2(). umount() is now a macro that just calls umount2() with flags = 0. 2015-03-14 16:48:45 -06:00
Gregory Nutt
ae90309b36 Move fs/fs.h to fs/inode/inode.h and some to fs/driver/driver.h 2014-09-29 07:14:38 -06:00
Gregory Nutt
36a88638a4 Move mount-related files from fs/. to fs/mount/. 2014-09-28 11:28:17 -06:00