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

Function dfs_aspace_insert

components/dfs/dfs_v2/src/dfs_pcache.c:577–588  ·  view source on GitHub ↗

* @brief Insert an address space into page cache * * This function inserts the given address space into both the hash table and * inactive list of the page cache. It also increments the reference count of * the address space. * * @param[in,out] aspace Pointer to the address space to be inserted */

Source from the content-addressed store, hash-verified

575 * @param[in,out] aspace Pointer to the address space to be inserted
576 */
577static void dfs_aspace_insert(struct dfs_aspace *aspace)
578{
579 uint32_t val = 0;
580
581 val = dfs_aspace_hash(aspace->mnt, aspace->pathname);
582
583 dfs_pcache_lock();
584 rt_atomic_add(&aspace->ref_count, 1);
585 rt_list_insert_after(&__pcache.head[val], &aspace->hash_node);
586 rt_list_insert_before(&__pcache.list_inactive, &aspace->cache_node);
587 dfs_pcache_unlock();
588}
589
590/**
591 * @brief Remove an address space from page cache

Callers 1

_dfs_aspace_createFunction · 0.85

Calls 5

dfs_aspace_hashFunction · 0.85
dfs_pcache_lockFunction · 0.85
rt_list_insert_afterFunction · 0.85
rt_list_insert_beforeFunction · 0.85
dfs_pcache_unlockFunction · 0.85

Tested by

no test coverage detected