fs/inode: improve the performance of get file pointer

Remove file locks and enter critical sections to protect file lists

Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
chao an
2023-11-08 17:23:44 +08:00
committed by Xiang Xiao
parent 66ccaed5ce
commit 0a567bbae4
2 changed files with 116 additions and 162 deletions
+114 -161
View File
File diff suppressed because it is too large Load Diff
+2 -1
View File
@@ -37,6 +37,7 @@
#include <nuttx/mutex.h>
#include <nuttx/semaphore.h>
#include <nuttx/spinlock.h>
#include <nuttx/mm/map.h>
/****************************************************************************
@@ -478,7 +479,7 @@ struct file
struct filelist
{
mutex_t fl_lock; /* Manage access to the file list */
spinlock_t fl_lock; /* Manage access to the file list */
uint8_t fl_rows; /* The number of rows of fl_files array */
FAR struct file **fl_files; /* The pointer of two layer file descriptors array */
};