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

Function dfs_page_dirty

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

* @brief Mark a page as dirty and manage dirty list * * This function marks a page as dirty and adds it to the dirty list if not already present. * It also triggers a write-back operation if more than 1 second has passed since last write-back. * * @param[in] page The page to be marked as dirty * @return int Always returns 0 on success */

Source from the content-addressed store, hash-verified

1346 * @return int Always returns 0 on success
1347 */
1348static int dfs_page_dirty(struct dfs_page *page)
1349{
1350 struct dfs_aspace *aspace = page->aspace;
1351
1352 dfs_aspace_lock(aspace);
1353
1354 if (page->dirty_node.next == RT_NULL && page->space_node.next != RT_NULL)
1355 {
1356 rt_list_insert_before(&aspace->list_dirty, &page->dirty_node);
1357 }
1358
1359 page->is_dirty = 1;
1360 page->tick_ms = rt_tick_get_millisecond();
1361
1362 if (rt_tick_get_millisecond() - __pcache.last_time_wb >= 1000)
1363 {
1364 dfs_pcache_mq_work(PCACHE_MQ_WB);
1365 __pcache.last_time_wb = rt_tick_get_millisecond();
1366 }
1367
1368 dfs_aspace_unlock(aspace);
1369
1370 return 0;
1371}
1372
1373/**
1374 * @brief Search for a page in the address space AVL tree

Callers 5

dfs_page_unmapFunction · 0.85
dfs_aspace_writeFunction · 0.85
dfs_aspace_unmapFunction · 0.85
dfs_aspace_page_unmapFunction · 0.85
dfs_aspace_page_dirtyFunction · 0.85

Calls 5

dfs_aspace_lockFunction · 0.85
rt_list_insert_beforeFunction · 0.85
rt_tick_get_millisecondFunction · 0.85
dfs_pcache_mq_workFunction · 0.85
dfs_aspace_unlockFunction · 0.85

Tested by

no test coverage detected