Commit Graph

19 Commits

Author SHA1 Message Date
cuiziwei e98d018265 nuttx/fs:Rename node with inode.
In ./fs/inode directory, the variable name FAR struct inode *node is named inconsistently, with some using node and others using inode. To facilitate understanding, we will standardize the naming to FAR struct inode *inode.

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-09 14:16:09 +08:00
dongjiuzhu1 09a9611ae9 fs/inode: using rwsem lock as inode_lock to avoid deadlock
Example:
When executing "df -h" on Core A to view mount information, this
process will traverse inode nodes, thereby holding the inode_lock.
Since the inode type of the mount point may be rpmsgfs, it will fetch statfs
information from another Core B.

Meanwhile, rcS on Core B needs to obtain file information from Core A,
which will be achieved by fetching stat information through rpmsgfs.
When this message arrives at Core A, a deadlock can occur between Core A's
rptun ap and nsh task.

However, both of these places involve read operations only, thus a reader-writer lock
can be utilized to prevent such a deadlock.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-10-02 01:56:46 +08:00
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
chao an e456c88c09 Revert "sched: replace some global variables to macro"
sched implementation not depends on macro abstraction, so revert below commit:

This reverts commit 4e62d0005a
This reverts commit 0f0c370520
This reverts commit ad0efd04ee

Signed-off-by: chao an <anchao@lixiang.com>
2024-06-06 22:00:25 +08:00
chao an 0f0c370520 fs/inode: replace some global variables to macro
replace to macro will help to extend the scheduling implementation

Signed-off-by: chao an <anchao@lixiang.com>
2024-03-21 18:53:14 +08:00
chao an 664927c86e mm/alloc: remove all unnecessary cast for alloc
Fix the minor style issue and remove unnecessary cast

Signed-off-by: chao an <anchao@xiaomi.com>
2023-08-30 14:34:20 +08:00
Xiang Xiao 6f6fce95a2 Replace all sprintf with snprintf
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-08 09:57:01 +02: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
Xiang Xiao b422f49fa7 fs: Skip the enumeration of root directory in foreach_inode
ensure the behaviour same before:
commit b76c4672d6 (origin/root)
Author: Xiang Xiao <xiaoxiang@xiaomi.com>
Date:   Tue Sep 15 17:42:42 2020 +0800

    vfs: Create a node as the root of pseudo file system

    to remove the special process for root

    Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-09-30 12:26:57 +02: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
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 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
Juha Niskanen e8b5dd4528 Fix use of undefined pp-token #errror, other typos. 2019-09-19 18:19:18 -06:00
Gregory Nutt 3f731241cb fs/inode/, fs/vfs/, and sched/task/: File and socket descriptors are no longer allocated for kernel threads. They must use SYSLOG for output and the low-level psock interfaces for network I/O. This saves a little memory which might be important for small footprint configurations. 2016-04-14 10:14:38 -06:00
Gregory Nutt 0fb035f76b Standardize some naming in code section comments 2016-02-21 18:09:04 -06:00
Gregory Nutt 8293a5e773 Minor file system clean-up 2015-06-18 10:16:49 -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 a470a8cbd0 Move drive from fs/. to fs/driver/. 2014-09-28 11:06:21 -06:00
Gregory Nutt 39ff9d626e Move inode and VFS utils from fs/. to fs/inode/. 2014-09-28 10:53:40 -06:00