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

Function dfs_file_init

components/dfs/dfs_v2/src/dfs_file.c:312–321  ·  view source on GitHub ↗

* @brief Initialize a file structure * * @param[in,out] file Pointer to the file structure to be initialized * * @note This function must be called before using any file operations * on a newly allocated file structure */

Source from the content-addressed store, hash-verified

310 * on a newly allocated file structure
311 */
312void dfs_file_init(struct dfs_file *file)
313{
314 if (file)
315 {
316 rt_memset(file, 0x00, sizeof(struct dfs_file));
317 file->magic = DFS_FD_MAGIC;
318 rt_mutex_init(&file->pos_lock, "fpos", RT_IPC_FLAG_PRIO);
319 rt_atomic_store(&(file->ref_count), 1);
320 }
321}
322
323/**
324 * @brief Deinitialize a file structure

Callers 8

test_dfs_renameFunction · 0.85
utest_tc_initFunction · 0.85
mkdirFunction · 0.85
dfs_file_accessFunction · 0.85
lsFunction · 0.85
catFunction · 0.85
copyfileFunction · 0.85
copydirFunction · 0.85

Calls 2

rt_memsetFunction · 0.85
rt_mutex_initFunction · 0.85

Tested by 1

test_dfs_renameFunction · 0.68