函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Move expired (dirtied before work->older_than_this) dirty inodes from*@delaying_queue to @dispatch_queue.

函数原型:static int move_expired_inodes(struct list_head *delaying_queue, struct list_head *dispatch_queue, int flags, struct wb_writeback_work *work)

返回类型:int

参数:

类型参数名称
struct list_head *delaying_queue
struct list_head *dispatch_queue
intflags
struct wb_writeback_work *work
1231  unsigned long * older_than_this = NULL
1233  LIST_HEAD(tmp)
1235  struct super_block * sb = NULL
1237  do_sb_sort等于0
1238  moved等于0
1240  如果flags按位与EXPIRE_DIRTY_ATIME的值恒等于0则older_than_this等于older_than_this
1242  否则如果非sync(2) WB_SYNC_ALL writeback
1243  expire_time等于jiffiesIf an inode is constantly having its pages dirtied, but then the* updates stop dirtytime_expire_interval seconds in the past, it's* possible for the worst case time between when an inode has its* timestamps updated and when they finally get written out to HZ
1244  older_than_this等于expire_time
1246  当非链表为空循环
1247  inode等于wb_inode(链表前项)
1248  如果older_than_thisinode_dirtied_after(inode, * older_than_this)则退出
1251  链表项移动到头部
1252  moved自加
1253  如果flags按位与EXPIRE_DIRTY_ATIME设置内存位
1255  如果sb_is_blkdev_sb(i_sb)则继续下一循环
1257  如果sbsb不等于i_sbdo_sb_sort等于1
1259  sb等于i_sb
1263  如果非do_sb_sort
1264  为栈加入第二个链表项
1265  转到:out
1269  当非链表为空循环
1270  sb等于i_sb
1272  inode等于wb_inode(pos)
1273  如果i_sb恒等于sb链表项移动到头部
1277  out :
1278  返回:moved
调用者
名称描述
queue_ioQueue 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