* @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 */
| 575 | * @param[in,out] aspace Pointer to the address space to be inserted |
| 576 | */ |
| 577 | static 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 |
no test coverage detected