Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\fs-writeback.c Create Date:2022-07-28 20:10:51
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Explicit flushing or periodic writeback of "old" data

Proto:static long wb_writeback(struct bdi_writeback *wb, struct wb_writeback_work *work)

Type:long

Parameter:

TypeParameterName
struct bdi_writeback *wb
struct wb_writeback_work *work
1840  wb_start = jiffies
1841  nr_pages = nr_pages
1847  oldest_jif = jiffies
1848  older_than_this = oldest_jif
1850  blk_start_plug( & plug)
1851  spin_lock( & protects the b_* lists )
1852  cycle
1856  If nr_pages <= 0 Then Break
1865  If (for_background || for_kupdate) && Not list_empty - tests whether a list is empty*@head: the list to test. Then Break
1873  If for_background && Not wb_over_bg_thresh - does @wb need to be written back?*@wb: bdi_writeback of interest* Determines whether background writeback should keep writing @wb or it's* clean enough.* Return: %true if writeback should continue. Then Break
1882  If for_kupdate Then
1885  Else if for_background Then oldest_jif = jiffies
1888  trace_writeback_start(wb, work)
1889  If list_empty - tests whether a list is empty*@head: the list to test. Then Queue all expired dirty inodes for io, eldest first.* Before* newly dirtied b_dirty b_io b_more_io* =============> gf edc BA* After* newly dirtied b_dirty b_io b_more_io* =============> g fBAedc* |* +--> dequeue for IO
1891  If sb Then progress = Write a portion of b_io inodes which belong to @sb.* Return the number of pages and/or inodes written.* NOTE! This is called with wb->list_lock held, and will* unlock and relock that for each inode it ends up doing* IO for.
1893  Else progress = __writeback_inodes_wb(wb, work)
1895  trace_writeback_written(wb, work)
1897  wb_update_bandwidth(wb, wb_start)
1907  If progress Then Continue
1912  If list_empty - tests whether a list is empty*@head: the list to test. Then Break
1919  trace_writeback_wait(wb, work)
1920  inode = wb_inode(prev)
1921  spin_lock( & _blocks, i_bytes, maybe i_size )
1922  spin_unlock( & protects the b_* lists )
1924  Sleep until I_SYNC is cleared. This function must be called with i_lock* held and drops it. It is aimed for callers not holding any inode reference* so once i_lock is dropped, inode can go away.
1925  spin_lock( & protects the b_* lists )
1927  spin_unlock( & protects the b_* lists )
1928  blk_finish_plug( & plug)
1930  Return nr_pages - nr_pages
Caller
NameDescribe
wb_check_background_flush
wb_check_old_data_flush
wb_check_start_all
wb_do_writebackRetrieve work items and do the writeback they describe