MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / dfs_vnode_init

Function dfs_vnode_init

components/dfs/dfs_v1/src/dfs_file.c:73–85  ·  view source on GitHub ↗

* @brief Initialize a DFS vnode structure. * * @param vnode Pointer to the DFS vnode structure to be initialized. * The caller must ensure this is a valid, allocated structure. * @param type The type of the vnode, representing its role or category (e.g., regular file, directory). * @param fops Pointer to the file operations structure associated with this vnode. * Thi

Source from the content-addressed store, hash-verified

71 * instance, where all necessary function pointers are properly set.
72 */
73int dfs_vnode_init(struct dfs_vnode *vnode, int type, const struct dfs_file_ops *fops)
74{
75 if (vnode)
76 {
77 rt_memset(vnode, 0, sizeof(struct dfs_vnode));
78 vnode->type = type;
79 vnode->fops = fops;
80
81 rt_list_init(&(vnode->list));
82 vnode->ref_count = 1;
83 }
84 return 0;
85}
86
87/* BKDR Hash Function */
88static unsigned int bkdr_hash(const char *str)

Callers 7

lwp_channel_openFunction · 0.50
rt_eventfd_createFunction · 0.50
epoll_epf_initFunction · 0.50
timerfd_do_createFunction · 0.50
signalfd_doFunction · 0.50
acceptFunction · 0.50
socketFunction · 0.50

Calls 2

rt_memsetFunction · 0.85
rt_list_initFunction · 0.85

Tested by

no test coverage detected