-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[components][dfs]separate dfs fs data structure ops (#9205)
separate dfs fs data structure ops
- Loading branch information
Showing
4 changed files
with
83 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* Copyright (c) 2006-2024, RT-Thread Development Team | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Change Logs: | ||
* Date Author Notes | ||
*/ | ||
|
||
#ifndef __DFS_VFS_H__ | ||
#define __DFS_VFS_H__ | ||
|
||
#include "dfs_file.h" | ||
#include "dfs_fs.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" | ||
{ | ||
#endif | ||
|
||
struct dfs_vfs_node | ||
{ | ||
rt_list_t subnode; /* file subnode list */ | ||
rt_list_t sibling; /* file sibling list */ | ||
}; | ||
|
||
rt_inline void dfs_vfs_init_node(struct dfs_vfs_node *node) | ||
{ | ||
rt_list_init(&node->subnode); | ||
rt_list_init(&node->sibling); | ||
} | ||
|
||
rt_inline void dfs_vfs_append_node(struct dfs_vfs_node *dir, struct dfs_vfs_node *node) | ||
{ | ||
rt_list_insert_after(&(dir->subnode), &(node->sibling)); | ||
} | ||
|
||
rt_inline void dfs_vfs_remove_node(struct dfs_vfs_node *node) | ||
{ | ||
rt_list_remove(&(node->sibling)); | ||
} | ||
|
||
#define dfs_vfs_for_each_subnode(node, tmp, dir, member) \ | ||
rt_list_for_each_entry_safe(node, tmp, &dir->member.subnode, member.sibling) | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /*__DFS_VFS_H__*/ |