Commit Graph

46 Commits

Author SHA1 Message Date
Xiang Xiao dd631265c4 fs: Add g_ prefix for all global mountpt_operations instances
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-04-24 16:13:29 +02:00
Ville Juven 30bae2ca47 fs/cromfs: Fix faulty DEBUGASSERT() check
The logic being tested is wrong, obviously when accessing file the
driver private data has to be valid (open() has been called).
2023-04-21 10:29:08 -04:00
Xiang Xiao b0a0ba3ad7 fs: Move mmap callback before truncate in [file|mountpt]_operations
since mmap may exist in block_operations, but truncate may not,
moving mmap beforee truncate could make three struct more compatible

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-04 17:43:59 +02:00
Jukka Laitinen f33dc4df3f Change FIOC_MMAP into file operation call
- Add mmap into file_operations and remove it from ioctl definitions.
- Add mm_map structure definitions to support future unmapping
- Modify all drivers to initialize the operations struct accordingly

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-01-02 11:23:20 -03:00
Jukka Laitinen 41e9df2f3e Add ftruncate into file operation calls
- Add truncate into file_operations
- Move truncate to be common for mountpt_operations and file_operations
- Modify all drivers to initialize the operations struct accordingly

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-01-02 11:23:20 -03:00
Jiuzhu Dong fe17f747a7 fs/directory: move private directory information to filesystem
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-08-09 23:30:01 +08:00
Jiuzhu Dong 90db4daca9 fs/directory: update readdir interface for all filesystem
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-08-09 23:30:01 +08:00
vxj9800 bfde3c007d Add preprocessor directive __attribute__((packed)) to cromfs_node_s
This directive tells the compiler that cromfs_node_s might be located at a memory
address which is not word aligned. This resolves the hardFault caused by unaligned
memory access on armv6-m architecture which doesn't support it.
2022-06-01 12:09:37 +08:00
zhouliang3 1f53a058fa nuttx:Change fs strncpy to strlcpy to avoid losing'\0'
Signed-off-by: zhouliang3 <zhouliang3@xiaomi.com>
2021-12-30 18:06:00 +08:00
Xiang Xiao 307cc61893 fs: Add fchstat and chstat callback into mountpt_operations
and implement all status related change function. the individual
file system change will provide in other upcoming patchset.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I8fde9db8eba9586e9c8da078b67e020c26623cf4
2021-07-29 06:33:49 -03:00
David Sidrane 22b719945f fs:cromf Use inttypes in printing macros 2021-05-04 09:40:51 +01:00
Alin Jerpelea f9fb182809 Author: Gregory Nutt: update licenses to Apache
Update files from Gregory Nutt to Apache 2.0 license.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-02-05 12:15:56 -03:00
Jiuzhu Dong 13100cf248 fs/readdir: Must reserve a byte for the NUL terminator
Change-Id: I1df0c278d289b90cc54512c0ee256a95549785ca
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-01-26 18:22:35 -08:00
YAMAMOTO Takashi 4911b1121b fs/cromfs/fs_cromfs.c: Fix a syslog format 2020-11-24 22:31:33 -08:00
Xiang Xiao eb4121ce38 Change all 'Nuttx' to 'NuttX'
Unify the naming convention

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-10-20 01:45:06 -07:00
David Sidrane 2953880f5c fs_cromfs: Removed DEBUGASSERT on non-exiting var node 2020-08-20 14:10:02 +01:00
Gregory Nutt b256b2055f Add support to hard links to CROMFS
This will resolve numerous problems with the way that hard links, in particular "." and ".." are handled.  Instead of trying to fudge the stat flags, the correct implementation is to follow the hard link to the final link target node.  That is what must determine the attributes of the directory entry.
2020-08-11 07:48:08 -07:00
David Sidrane 2eccc960a9 fs_cromfs:Remove duplicate case intorduced by 67ef70d 2020-08-04 21:20:25 -05:00
Xiang Xiao 9dff16e0e4 fix nxstyle warning
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ieaf325c899d1c349d64dfa15bddcc32afd1fce42
2020-07-10 21:30:02 +01:00
Xiang Xiao 67ef70d460 vfs/dirread: Should return the same file type as lstat
by extend the possible value of d_type for the special file

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-07-07 13:41:10 +01:00
Xiang Xiao 91ed14c631 vfs/stat: Make the flag defintion more confirm POSIX standard
specified here:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_stat.h.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-07-07 13:41:10 +01:00
Xiang Xiao 23668a4b9b build: Remove the empty variable assignment
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-24 08:24:13 -06:00
Gregory Nutt 2b532ae4a8 fs/: Remove support for CONFIG_FS_READABLE 2020-03-22 08:24:07 -05:00
Xiang Xiao 80277d1630
Refine the preprocessor conditional guard style (#190) 2020-01-31 19:07:39 +01:00
Gregory Nutt b599aa0cee fs/cromfs/fs_cromfs.c: Back out an erroneous change I made during a code review. Noted by Jussi Kivilinna. 2019-12-02 08:44:50 -06:00
Gregory Nutt d2af57169b tools/nxstyle.c: Fix a rare false alarm that could occur if a variable or function name begins with the sub-string 'union' or 'struct'. misc fixes under fs/ and sched/ from application of current version of nxstyle. 2019-12-01 13:01:16 -06:00
Gregory Nutt bd3cc792ff fs/: Run all .c files under fs/ through tools/nxstyle. 2019-10-27 11:48:14 -06:00
Nathan Hartman 46aaec7ba0 Fix minor typos in docs and comments. 2019-09-29 12:52:20 -06:00
Gregory Nutt dd97fb991b This commit moves shared builtin information out of binfmt/libbuiltin and into libs/libc/builtin where it can be shared. This should permit builtin application in the PROTECTED build where binfmt/libbuiltin is not available in user space.
Squashed commit of the following:

    Correct some additional compile-related issues.

    Move  include/nuttx/binfmt/builtin.h to include/nuttx/lib/builtin.h.  Move apps/builtin/lib_builtin_forindex.c to libs/libc/builtin/lib_builtin_forindex.c.

    Move binfmt/libbuiltin to libs/libc/builtin.  There are calls made directly from apps/nshlib into this logic and hence, must be part of a library that can be shared between the OS and applications.
2019-08-23 09:07:40 -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
David Sidrane b30db5dcb0 fs/cromfs/fs_cromfs.c: Fixes hardfault 2018-12-06 16:42:20 -06:00
Gregory Nutt db3b507a41 tools/gencromfs.c: Was duplicating all mode bits in source directory in CROMFS directory. Some make no sense. In particular, all write-able bits are cleard unconditionally. Executable bits are still copying because there is really no way for the tool to know if the file is executable or not. 2018-03-24 15:05:22 -06:00
Gregory Nutt 67e0603b5a fs/cromfs: Block length only needs to be uint16_t, not uint32_t. Add pading to node structure to assue that alignment is the same on all platforms. tools/gencromfs.c: Fix the target offset of the '.' hard link. 2018-03-24 14:44:38 -06:00
Gregory Nutt 8b4b61f140 fs/cromfs: Fix a error in reading partial compressed blocks. The LZF decompressor does not support that operation. Instead we have to decompress full block into a temporary buffer and copy out the parts that we need. To compensate for the performance hit, a caching mechanism was added so that we do not have to read the same block repeatedly. Unrelated: Also updates some README files. 2018-03-24 11:30:35 -06:00
Gregory Nutt 012cd8a07a fs/cromfs: Yet another update to the README file. 2018-03-22 13:35:27 -06:00
Gregory Nutt 1d72f7afea fs/cromfs: Update README 2018-03-22 08:41:59 -06:00
Gregory Nutt 3b3ca1373c fs/cromfs: Update README 2018-03-22 08:11:28 -06:00
Gregory Nutt e6cecb5a58 fs/cromfs: Add a README file. 2018-03-22 07:44:37 -06:00
Gregory Nutt 448fc7a6f2 fs/cromfs: Remove CONFIG_EXPERIMINTAL dependency. 2018-03-20 20:04:29 -06:00
Gregory Nutt f2b72c344b fs/cromfs: Fix a loop condition that was causing errors on large files 2018-03-20 19:49:42 -06:00
Gregory Nutt 16d0a8c2d1 fs/cromfs: More directory traversal fixes. tools/gencromfs.c: Add ability use a callback with directory traversal. Not currently used but left in place in case it is needed in the future. 2018-03-20 16:20:31 -06:00
Gregory Nutt aeeee54921 tools/gencromfs.c and fs/cromfs: More corrections to directory traversal logic. Still some bugs. 2018-03-20 14:30:05 -06:00
Gregory Nutt 22484386ee fs/cromfs and tools/gencromfs: Various fixes for traversal relative file paths. Biggest changes is in types used: Cannot use size_t or mode_t in common structures because they have different sizes on the (64-bit) host and the (32-bit) target. Use uint32_t instead of size_t for offsets. Use uint16_t instead of mode_t. 2018-03-20 12:37:01 -06:00
Gregory Nutt 87fd4e2916 fs/cromfs: Fix read logic. tools/genromfs.c: Last node in directory needs to have zero for peer offset. Still some issues with empty directories. 2018-03-20 10:37:42 -06:00
Gregory Nutt eec44d1f01 This commit adds tools/gencromfs.c, a tool that can be used to generate CROMFS file system images.
Squashed commit of the following:

    tools/gencromfs.c:  Seems basically functional but has not has not yet been integrated with CROMFS.
    tools/gencromfs.c:  Revist previous commit.  Let's make no assumptions about the compatibility of the host system and NuttX.
    tools/gencromfs.c:  I think access mode bits are sufficiently standard that we can just copy them from the host.  This is don't mostly to pick up the executable bits and other conbinations of bits without doing a bit-for-bit decode.
    tools/gencromfs.c:  Code complete but only partially functional.
    tools/gencromfs.c:  type definitions must precede data definitions
    tools/gencromfs.c:  Adds a little more logic to gencromfs tools.  Still not complete but can traverse directories and generate directory and hard-link nodes.
    tools/gencromfs.c: Beginning of a genromfs tool that will eventually be used for generation of CROMFS file system images.
2018-03-20 07:31:13 -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