函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\fs-writeback.c Create Date:2022-07-29 10:41:29
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Explicit flushing or periodic writeback of "old" data

函数原型:static long wb_writeback(struct bdi_writeback *wb, struct wb_writeback_work *work)

返回类型:long

参数:

类型参数名称
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  加自旋锁
1852  循环
1856  如果nr_pages小于等于0则退出
1865  如果for_backgroundfor_kupdate的值且非链表为空退出
1873  如果for_background且非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.退出
1882  如果for_kupdate
1885  否则如果for_backgroundoldest_jif等于jiffies
1888  trace_writeback_start(wb, work)
1889  如果链表为空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  如果sbprogress等于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  否则progress等于__writeback_inodes_wb(wb, work)
1895  trace_writeback_written(wb, work)
1897  wb_update_bandwidth(wb, wb_start)
1907  如果progress则继续下一循环
1912  如果链表为空退出
1919  trace_writeback_wait(wb, work)
1920  inode等于wb_inode(链表前项)
1921  加自旋锁
1922  自旋锁解锁
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  加自旋锁
1927  自旋锁解锁
1928  blk_finish_plug( & plug)
1930  返回:nr_pagesnr_pages
调用者
名称描述
wb_check_background_flush
wb_check_old_data_flush
wb_check_start_all
wb_do_writebackRetrieve work items and do the writeback they describe