Commit Graph

66 Commits

Author SHA1 Message Date
chenrun1 96206cbf9d fs/xxfs:Replace kmm with fs heap
Summary:
  1.Add configuration to allocate memory from the specified section
  2.Replace all memory operations (kmm_) in the vfs with
    fs_heap_. When FS_HEAPSIZE > 0, memory is requested for the file system by specifying a configured heap location. By default (i.e. FS_HEAPSIZE=0) fs_heap_ is equivalent to kmm_

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-09-30 16:30:56 +08:00
Petro Karashchenko d499ac9d58 nuttx: fix multiple 'FAR', 'CODE' and style issues
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2024-08-25 19:22:15 +08:00
Windrow14 479c393291 fs/fat/fs_fat32.[c|h]: fix fseek bug when file size is multiple of cluster size
Unbinding `ff_currentcluster` and `f_pos`:
1. Added `ff_pos` in `struct fat_file_s`.
2. Added function `fat_zero_cluster` for doing zeroing for gap
   between EOF and new position beyond EOF.
3. Added function `fat_get_sectors` for getting the sector where
   `f_pos` is located, allocting new cluster when `f_pos` is beyond
   EOF.
4. Modify function `fat_read`, and `fat_write` with above functions.
5. Remove redundant logics in `fat_seek` since now new cluster is
   allocated when writing instead of seeking.

Signed-off-by: Yinzhe Wu <Yinzhe.Wu@sony.com>
Reviewed-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
Reviewed-by: Jacky Cao <Jacky.Cao@sony.com>
Tested-by: Yinzhe Wu <Yinzhe.Wu@sony.com>
2024-07-06 19:00:01 +08:00
Saurav Pal d79e5a4932 fs/vfat: Fix typo in the macro DIRSEC_BYTENDX
The DIRSEC_BYTENDX(f, i) is supposed to have DIRSEC_NDXMASK(f) in its expansion instead of DIRSEC_NDXMASK(fs). It went unnoticed in the codebase as DIRSEC_BYTENDX(fs, idx) is the way it is used, and it leads to a similar expansion as desired, and thus it has worked till now without any issues from this.

Signed-off-by: Saurav Pal <resyfer.dev@gmail.com>
2024-02-03 12:46:08 -03:00
Xiang Xiao 7990f90915 Indent the define statement by two spaces
follow the code style convention

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-21 09:52:08 -03:00
anjiahao d7b4e91dda Call nxsem_destroy or nxmutex_destry in the error path
1.Don't check the return value of nxsem_init or nxmutex_init
2.Fix some style issue

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-30 13:56:52 +01:00
anjiahao d1d46335df Replace nxsem API when used as a lock with nxmutex API
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-17 15:59:46 +09: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
SPRESENSE fa1fad50b9 fs/fat: Fix a bug that long file name cannot be found
The field of first cluster under LFN directory entry must be 0x0000. If
it is set a value other than 0, it causes a problem where the long file
name entry cannot be found on a Windows PC and the short file name is
always used. In addition, correct the macro error in big endian.
2022-06-30 15:35:57 +08:00
Masayuki Ishikawa a8d446851c fs: fat: Use uint16_t instead of wchar_t
Summary:
- Due to the recent changes of wchar_t, ls command always
  causes errors for the fat file system.
- This commit fixes this issue by replacing wchar_t with
  uint16_t under fs/fat

Impact:
- None

Testing:
- Tested with spresense:wifi and stm32f4discovery:wifi

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2021-12-09 21:29:29 -06:00
Masayuki Ishikawa cfd1c28606 fs, include: Use fsblkcnt_t and fsfilcnt_t instead of off_t
Summary:
- On Linux, fsblkcnt_t and fsfilcnt_t are used in struct statfs
- This commit applies the same logic

Impact:
- None

Testing:
- Tested with spresense:rndis_smp

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2021-07-19 04:26:44 -07:00
GAEHWILER Reto fc55f25fff Fix calculation of free clusters at mounting a fat partition
Previously the value of the FSInfo section was taken as granted.
As described in the white paper of FAT [1] this value is unreliable
and has to be computed at mount time.

    [1] https://www.win.tue.nl/~aeb/linux/fs/fat/fatgen103.pdf
2021-05-21 09:54:30 -03:00
Gustavo Henrique Nihei 76acb32e29 Fix typos reported by codespell 2021-02-25 11:31:49 -08:00
Juha Niskanen cd41ed9b6d fs: fully parenthesize MIN and MAX macros
Signed-off-by: Juha Niskanen <juha.niskanen@haltian.com>
2020-12-08 12:58:40 -06:00
Johannes Schock 070f4ed7e9 FAT Filesystem: UTF8 support for long filenames, bugfixes.
New CONFIG_FAT_LFN_UTF8: UTF8 strings are converted to UCS2-LFN
Bugfix in fat_createalias: space is now also converted to underbar.
Change (bugfix) in fat_getlfname: init characters (0xff) and '\0' are rewound as well.
2020-07-31 18:01:02 -03:00
Gregory Nutt 0f7c2d6fbf fs/fat: Run all .c and .h files through nxstyle
Run all .c and .h files through nxstyle and correct all reported issues.
2020-05-31 12:43:55 -04:00
Ouss4 ba8bc4c80c fs/: Check return of nxsem_wait_uninterruptible. 2020-03-30 08:08:07 -06:00
Xiang Xiao cde88cabcc Run codespell -w with the latest dictonary again
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-02-23 22:27:46 +01:00
Xiang Xiao 5c80b94820 Replace #include <semaphore.h> to #include <nuttx/semaphore.h>
Since the kernel side should call nxsem_xxx instead and remove the unused inclusion
2020-02-01 08:27:30 -06:00
Gregory Nutt d77df925a3 Trivial FATFS cleanup
Squashed commit of the following:

    fs/fat/fs_fat32util.c:  Most costmetic naming MBR to FBR in numerous locations.  Change some ferr macros to fwarn.  Use FBR macros insteac of MBR macros.

    Add definitions for the FAT boot record (FBR).

    fs/fat:  Clean up some name BS_ and MBR_ refer to the same record and should use the same naming (MBR_).
2018-07-22 08:42:15 -06:00
Gregory Nutt fb73006a4b These changes implemnt FAT file shrinkage as needed to fully support ftruncate().
Squashed commit of the following:

    fs/fat:  Resolves issues with truncating the cluster chain when shrinking files via ftruncate().
    fs/fat:  First cut at implementation file shrinkage logic needed to support ftruncate().  Certainly shrinks the file size but it does not appear to correctly disconnect the cluster chains.
    fs/fat:  Restructure some functions in files to better support forthcoming file shrinkage logic.  Put framework for file shrinkage in place.  That logic is incomplete on initial commit.
2018-01-04 19:08:43 -06:00
Gregory Nutt 5d1a91fd8e configs/lpcxpresso-lpc5428/fb: Should disable pixel depths that are not being used. 2018-01-04 16:40:31 -06:00
Gregory Nutt 8057af6724 fs/fat: Still trying to eliminate warnings in all configurations. 2017-12-17 17:10:37 -06:00
Gregory Nutt cf8a7bebf6 Eliminate another warning. 2017-12-17 16:47:49 -06:00
Gregory Nutt f96478bb99 fs/fat: Don't warn about the CONFIG_FAT_MAXFNAME being too large if long file name support is not implemented. 2017-12-17 16:41:26 -06:00
Gregory Nutt 9638f3f065 fs/fat: CONFIG_FAT_MAXFNAME may not exceed NAME_MAX (CONFIG_NAME_MAX) 2017-12-15 06:19:14 -06:00
Gregory Nutt 658272bbbf FAT: Fix some duplicate definition warnings when big-endian is enabled 2015-12-26 14:49:40 -06:00
Gregory Nutt 11afff74dc Kconfig change for improved usability 2015-11-29 12:13:24 -06:00
Gregory Nutt cb9e27c3b0 Standardize naming used for public data and function groupings 2015-10-02 16:30:35 -06:00
Gregory Nutt 9f7f258728 Add support for umount2(target, MNT_FORCE) in the FAT file system. 2015-03-15 07:45:19 -06:00
Gregory Nutt d038133501 Rename fs/fs_internal.h to fs/fs.h 2014-09-28 09:13:56 -06:00
Gregory Nutt 54fa3b0b59 Rename kfree to kmm_free for consistency with other naming conventions 2014-08-31 17:04:02 -06:00
Gregory Nutt 40e0253189 mkfatfs: Fix an error in logic that determines if FAT16 is possible 2013-12-05 18:17:22 -06:00
Gregory Nutt bc46b447dc Fix all occurrences of "the the" in documentation and comments 2013-08-27 09:40:19 -06:00
patacongo 5a2eda210b Finish dup logic for open files; fix bug in sigtimedwait(), would return wrong signo value if the signal was already pending
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5517 42af7a65-404d-4744-a932-0658087f49c3
2013-01-14 19:22:32 +00:00
patacongo a30e2f4a27 Add beginning of a simple granule allocator to support DMA IO buffer allocation
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5129 42af7a65-404d-4744-a932-0658087f49c3
2012-09-11 18:22:27 +00:00
patacongo 870b6511ea Add support for DMA memory allocator to FAT file system
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5127 42af7a65-404d-4744-a932-0658087f49c3
2012-09-11 13:53:44 +00:00
patacongo 2fe4ad52f8 Move file-system header files to include/nuttx/fs
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4499 42af7a65-404d-4744-a932-0658087f49c3
2012-03-21 18:01:07 +00:00
patacongo 39fd93278c PIC32 NSH configuration now builds without errors
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4220 42af7a65-404d-4744-a932-0658087f49c3
2011-12-23 00:58:00 +00:00
patacongo 0fe0a10e9f Add support for more FAT partitions; support for SD cards greater than 4Gb; TSC2007 touchscreen driver improvements
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4092 42af7a65-404d-4744-a932-0658087f49c3
2011-11-15 16:44:45 +00:00
patacongo 9e9cbc6b27 Add logic to assure that short FAT names are unique
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3796 42af7a65-404d-4744-a932-0658087f49c3
2011-07-18 18:28:02 +00:00
patacongo 4ffef26aa4 Changes to get clean FAT long file name compilation
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3785 42af7a65-404d-4744-a932-0658087f49c3
2011-07-14 21:07:59 +00:00
patacongo 65d19ae3dc FAT long support is code complete (but untested)
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3783 42af7a65-404d-4744-a932-0658087f49c3
2011-07-14 17:57:59 +00:00
patacongo 718738cb62 More FAT long file name logic
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3782 42af7a65-404d-4744-a932-0658087f49c3
2011-07-13 21:53:06 +00:00
patacongo fb32eed2ee Add long file name parsing logic
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3781 42af7a65-404d-4744-a932-0658087f49c3
2011-07-13 17:19:31 +00:00
patacongo 95e415d274 Re-architect FAT data structures to support long file names
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3780 42af7a65-404d-4744-a932-0658087f49c3
2011-07-13 13:30:38 +00:00
patacongo 09c2e9b9e3 Separate FAT directory operations into a separate file
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3777 42af7a65-404d-4744-a932-0658087f49c3
2011-07-12 22:38:21 +00:00
patacongo 5e370e1615 Add FAT long file name definitions
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3776 42af7a65-404d-4744-a932-0658087f49c3
2011-07-12 19:19:40 +00:00
patacongo 62d94bb3d6 Add wchar_t type; Add LPC17xx CAN driver from Lzyy; Fix serial bug reported by Lzyy
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3775 42af7a65-404d-4744-a932-0658087f49c3
2011-07-12 16:36:45 +00:00