Gregory Nutt
15688c4331
Revert "fs/fat/fs_fat32.c: Fixes issue when seeking to end of file where we move one too many clusters ahead due to < vs <= logic. This causes us to move past the last cluster in the file."
...
This reverts commit 7ffe023766
.
This change is reverted because it introduces other problems when seeking around the file.
2019-01-05 16:43:47 -06:00
Anthony Merlino
7ffe023766
fs/fat/fs_fat32.c: Fixes issue when seeking to end of file where we move one too many clusters ahead due to < vs <= logic. This causes us to move past the last cluster in the file.
2019-01-05 14:55:59 -06:00
Gregory Nutt
0cd5a232ea
Fix a few typos.
2018-12-27 08:45:26 -06:00
Daniel P. Carvalho
60575d3436
fs/nxffs/nxffs_ioctl.c: Pass unrecognized IOCTL commands to the contained MTD driver.
2018-12-12 18:23:03 -06:00
David Sidrane
010d5da4e6
fs/vfs: dup() and dup2() were broken some time back. fs_dupfd() was return returing OK on success, not fit the file descriptor of the duplicated fd.
2018-12-10 13:25:52 -06:00
David Sidrane
b30db5dcb0
fs/cromfs/fs_cromfs.c: Fixes hardfault
2018-12-06 16:42:20 -06:00
David Sidrane
5433ec589b
fs/driver/fs_blockpartition.c: Fix void pointer warning.
...
libs/libc/unistd/lib_daemon.c: Fix compiler error is streams disabled.
sched/irq/irq_procfs.c: Fix warning
sched/task/task_vfork.c: Fix void * math warning
2018-12-03 17:54:21 -06:00
Xiang Xiao
1e0e1ae856
fs/procfs: Remove the unnecessary critical section
2018-11-29 12:51:34 -06:00
Gregory Nutt
095b597d34
sched/sched and fs/procfs: Fix some bus in critical section monitor found in testing
2018-11-24 17:58:35 -06:00
Gregory Nutt
807d5bb4ae
Critical Section Monitor: Add low level timer support for simulation. Fix serial bugs and logic errors in initial implementation. Still does not work; takes assertions.
2018-11-24 15:07:12 -06:00
Gregory Nutt
85c31fd4a2
fs/procfs/fs_procfscritmon.c and sched/sched/sched_critmonitor.c: Add support for global pre-emption and global critical sections to monitor as suggested by Xiang Xaio.
2018-11-24 13:33:37 -06:00
Gregory Nutt
fc6084f311
Squashed commit of the following:
...
fs/procfs/fs_procfsproc: Extended the process ID ProcFS output to show per-thread maximum time for pre-emption disabled and maximum time within a critical section.
sched/sched/sched_critmonitor.c: Adds data collection logic in support of monitoring critical sections and pre-emption state.
2018-11-24 10:32:45 -06:00
Gregory Nutt
97b0235d77
s/dirent: Corrects a problem with opendir() noted by Petteri Aimonen in Bitbucket Issue 132: "opendir() fails for FAT filesystem with trailing slash in path":
...
I see the following behaviour on NuttX 7.26, where I have SD card mounted on /flash and a directory called "frm" on it:
opendir("/flash") returns (DIR *) 0x1000c580
opendir("/flash/") returns (DIR *) 0x1000c5d0
opendir("/flash/frm") returns (DIR *) 0x1000c620
opendir("/flash/frm/") returns (DIR *) 0x0
From POSIX specs for opendir(): "A pathname ... that ends with one or more trailing slashes shall be resolved as if a single dot character ( '.' ) were appended to the pathname."
So for mount points, opendir() works correctly, but for FAT32 filesystem it fails to open directory if the path has a trailing slash. I'm not quite sure how to cleanly fix this. Stripping the trailing slash in opendir() would require allocating a separate buffer, while fixing it in the FAT32 code seems somewhat complex due to the short/long filename logic.
It is not a big issue for me, I'm just going to fix it on the application side. But still a small portability and standards compliance issue.
NOTE: You would not see this problem if you call opendir() indirectly in NSH (like 'ls -R /') because NSH contains logic to remove trailing '/' characters from paths.
2018-11-16 11:45:18 -06:00
Gregory Nutt
9d09b5aad7
Eliminate a warning found in build testing.
2018-11-09 13:23:12 -06:00
Xiang Xiao
d2cfd398ba
Fix compiler error and warning when CONFIG_NET_SENDFILE=y
2018-11-09 11:17:43 -06:00
Gregory Nutt
31485356b8
Updates based on coding style review of PR 755
2018-11-09 07:51:43 -06:00
Petteri Aimonen
96da659c0b
Merged in paimonen/nuttx/pullreq_FAT_improvements (pull request #755 )
...
Pullreq FAT improvements
* NuttX: Add CONFIG_FAT_LFN_ALIAS_HASH to speed up creating long filenames.
Long filenames on FAT filesystems have associated 8.3 character alias
short filenames. The traditional form of these is FILENA~1.EXT with
a running count of the number of similar names. However creating this
unique count can take several seconds if there are many similarly named
files in the directory. Enabling FAT_LFN_ALIAS_HASH uses an alternative
format of FI0123~1.TXT where the four digits are a hash of the original
filename. This method is similar to what is used by Windows 2000 and
later.
* NuttX: Add CONFIG_FAT_LFN_ALIAS_TRAILCHARS alternative format for 8.3 filenames.
Traditional format for long filename 8.3 aliases takes first 6
characters of long filename. If this option is set to N > 0,
NuttX will instead take first 6-N and last N characters to form
the short name. This is useful for filenames like "datafile12.txt"
where the first characters would always remain the same.
* NuttX: FAT32: Fix file date corruption in fat_truncate().
* NuttX: if SD card wait seems to be a long one, give time for other threads to run.
Approved-by: GregoryN <gnutt@nuttx.org>
2018-11-09 13:46:16 +00:00
zhangyuan7
a7d9d4bc1e
drivers/serial/uart_16550.c: Fox UART flow control issue. UART_MCR_RTS need be high even UART_MCR_AFCE is enabled
2018-11-08 10:21:16 -06:00
iuhaitao
82e0b0328b
fs/procfs: Add /proc/version support to get version info
2018-11-08 10:13:45 -06:00
Xiang Xiao
2f63becbc8
fs/driver: Add register_mtdpartition() for MTD partition
2018-11-08 10:03:07 -06:00
Xiang Xiao
e674edfa19
fd/dirent, fs/driver/, and fs/vfs: Make MTD device accessible via a character driver proxy like block devices
2018-11-08 09:59:18 -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
Xiang Xiao
247414c6ad
drivers/mtd and other MTD drivers: Remove mtd_procfsoperations since we can now get the same information from inode
2018-11-08 09:46:11 -06:00
Xiang Xiao
d32d9d4b24
fs/partition: Try MTDIOC_GEOMETRY IOCTL before bops's geometry
...
fs/driver/fs_blockpartition.c: Support MTD IOCTL
2018-11-08 09:41:54 -06:00
Xiang Xiao
a9ff43d93c
fs/aio, libs/libc/aio, sched/mqueue, sched/timer, and sched/signal: Remove the code duplication for SIGEV_THREAD.
2018-11-08 08:19:17 -06:00
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