函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\backing-dev.c Create Date:2022-07-27 15:48:26
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:wb_init

函数原型:static int wb_init(struct bdi_writeback *wb, struct backing_dev_info *bdi, int blkcg_id, gfp_t gfp)

返回类型:int

参数:

类型参数名称
struct bdi_writeback *wb
struct backing_dev_info *bdi
intblkcg_id
gfp_tgfp
289  memset(wb, 0, wb的长度)
291  如果wb不等于 the root writeback info for this bdi bdi_get(bdi)
293  ur parent bdi 等于bdi
294  last old data flush 等于jiffies
295  初始化链表头
296  初始化链表头
297  初始化链表头
298  初始化链表头
299  spin_lock_init( & protects the b_* lists )
301  last time write bw is updated 等于jiffies
302  balanced_dirty_ratelimit等于Initial write bandwidth: 100 MB/s
303  The base dirty throttle rate, re-calculated on every 200ms.* All the bdi tasks' dirty rate will be curbed under it.*@dirty_ratelimit tracks the estimated @balanced_dirty_ratelimit* in small steps and is much more smooth/stable than the latter.等于Initial write bandwidth: 100 MB/s
304  he estimated write bandwidth 等于Initial write bandwidth: 100 MB/s
305  urther smoothed write bw, > 0 等于Initial write bandwidth: 100 MB/s
307  spin_lock_init( & protects work_list & dwork scheduling )
308  初始化链表头
309  INIT_DELAYED_WORK( & work item used for writeback , Handle writeback of dirty data for the device backed by this bdi. Also* reschedules periodically and does kupdated style flushing.)
310  last wait 等于jiffies
312  congested等于wb_congested_get_create(bdi, blkcg_id, gfp)
313  如果非congested
314  err等于负ENOMEM
315  转到:out_put_bdi
318  err等于fprop_local_init_percpu( & completions, gfp)
319  如果err则转到:out_put_cong
322 i小于NR_WB_STAT_ITEMS循环
323  err等于percpu_counter_init( & stat[i], 0, gfp)
324  如果err则转到:out_destroy_stat
328  返回:0
330  out_destroy_stat :
331 i自减循环
332  percpu_counter_destroy( & stat[i])
333  fprop_local_destroy_percpu( & completions)
334  out_put_cong :
335  wb_congested_put(congested)
336  out_put_bdi :
337  如果wb不等于 the root writeback info for this bdi bdi_put(bdi)
339  返回:err
调用者
名称描述
cgwb_bdi_init