diff options
| author | Shell <[email protected]> | 2024-02-23 17:49:15 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-02-23 17:49:15 +0800 |
| commit | 71560bafb5735220696ca24a42ba4a668b55949b (patch) | |
| tree | 236df5973a1fd5b6f0cc9f6c6b6a2d71fd069203 /components/dfs | |
| parent | 6fe69d7431ed54fcea863ed68d7c4f9746e771b0 (diff) | |
🎯 Sync smart & scheduler codes (#8537)
Signed-off-by: Shell <[email protected]>
Co-authored-by: xqyjlj <[email protected]>
Diffstat (limited to 'components/dfs')
| -rw-r--r-- | components/dfs/dfs_v2/filesystems/romfs/dfs_romfs.c | 2 | ||||
| -rw-r--r-- | components/dfs/dfs_v2/src/dfs_pcache.c | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/components/dfs/dfs_v2/filesystems/romfs/dfs_romfs.c b/components/dfs/dfs_v2/filesystems/romfs/dfs_romfs.c index 9e9a537421..7cb30b348b 100644 --- a/components/dfs/dfs_v2/filesystems/romfs/dfs_romfs.c +++ b/components/dfs/dfs_v2/filesystems/romfs/dfs_romfs.c @@ -352,7 +352,7 @@ static int dfs_romfs_getdents(struct dfs_file *file, struct dirent *dirp, uint32 d->d_namlen = rt_strlen(name); d->d_reclen = (rt_uint16_t)sizeof(struct dirent); - rt_strncpy(d->d_name, name, DFS_PATH_MAX); + rt_strncpy(d->d_name, name, DIRENT_NAME_MAX); /* move to next position */ ++ file->fpos; diff --git a/components/dfs/dfs_v2/src/dfs_pcache.c b/components/dfs/dfs_v2/src/dfs_pcache.c index 4f03ee6896..11f6172d08 100644 --- a/components/dfs/dfs_v2/src/dfs_pcache.c +++ b/components/dfs/dfs_v2/src/dfs_pcache.c @@ -822,7 +822,10 @@ static int dfs_page_insert(struct dfs_page *page) rt_list_insert_before(&aspace->list_inactive, &page->space_node); aspace->pages_count ++; - RT_ASSERT(_dfs_page_insert(aspace, page) == 0); + if (_dfs_page_insert(aspace, page)) + { + RT_ASSERT(0); + } if (aspace->pages_count > RT_PAGECACHE_ASPACE_COUNT) { |
