Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

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

Proto:static int move_expired_inodes(struct list_head *delaying_queue, struct list_head *dispatch_queue, int flags, struct wb_writeback_work *work)

Type:int

Parameter:

TypeParameterName
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  If (flags & EXPIRE_DIRTY_ATIME) == 0 Then older_than_this = older_than_this
1242  Else if Not sync(2) WB_SYNC_ALL writeback Then
1243  expire_time = jiffies - If 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  When Not list_empty - tests whether a list is empty*@head: the list to test. cycle
1247  inode = wb_inode(prev)
1248  If older_than_this && inode_dirtied_after(inode, * older_than_this) Then Break
1251  list_move - delete from one list and add as another's head*@list: the entry to move*@head: the head that will precede our entry
1252  moved++
1253  If flags & EXPIRE_DIRTY_ATIME Then Atomically set a bit in memory
1255  If sb_is_blkdev_sb(i_sb) Then Continue
1257  If sb && sb != i_sb Then do_sb_sort = 1
1259  sb = i_sb
1263  If Not do_sb_sort Then
1264  list_splice - join two lists, this is designed for stacks*@list: the new list to add.*@head: the place to add it in the first list.
1265  Go to out
1269  When Not list_empty - tests whether a list is empty*@head: the list to test. cycle
1270  sb = i_sb
1272  inode = wb_inode(pos)
1273  If i_sb == sb Then list_move - delete from one list and add as another's head*@list: the entry to move*@head: the head that will precede our entry
1277  out :
1278  Return moved
Caller
NameDescribe
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