* @brief Clean up page cache entries for a specific mount point * * This function iterates through both inactive and active lists of the page cache * to clean up entries associated with the given mount point. It performs cleanup * and calls the provided callback function for each matching address space. * * @param[in] mnt Pointer to the mount point structure to clean up * @param[in] cb Cal
| 199 | * The callback takes an address space pointer and returns an integer |
| 200 | */ |
| 201 | static void _pcache_clean(struct dfs_mnt *mnt, int (*cb)(struct dfs_aspace *aspace)) |
| 202 | { |
| 203 | rt_list_t *node = RT_NULL; |
| 204 | struct dfs_aspace *aspace = RT_NULL; |
| 205 | |
| 206 | dfs_pcache_lock(); |
| 207 | |
| 208 | node = __pcache.list_inactive.next; |
| 209 | while (node != &__pcache.list_active) |
| 210 | { |
| 211 | aspace = rt_list_entry(node, struct dfs_aspace, cache_node); |
| 212 | node = node->next; |
| 213 | if (aspace && aspace->mnt == mnt) |
| 214 | { |
| 215 | dfs_aspace_clean(aspace); |
| 216 | cb(aspace); |
| 217 | } |
| 218 | } |
| 219 | |
| 220 | node = __pcache.list_active.next; |
| 221 | while (node != &__pcache.list_inactive) |
| 222 | { |
| 223 | aspace = rt_list_entry(node, struct dfs_aspace, cache_node); |
| 224 | node = node->next; |
| 225 | if (aspace && aspace->mnt == mnt) |
| 226 | { |
| 227 | dfs_aspace_clean(aspace); |
| 228 | cb(aspace); |
| 229 | } |
| 230 | } |
| 231 | |
| 232 | dfs_pcache_unlock(); |
| 233 | } |
| 234 | |
| 235 | /** |
| 236 | * @brief Unmount and clean up page cache for a specific mount point |
no test coverage detected