Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name: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.

Proto:static long writeback_sb_inodes(struct super_block *sb, struct bdi_writeback *wb, struct wb_writeback_work *work)

Type:long

Parameter:

TypeParameterName
struct super_block *sb
struct bdi_writeback *wb
struct wb_writeback_work *work
1628  struct writeback_control wbc = {sync_mode = sync_mode, ag-and-write to avoid livelock = tagged_writepages, A kupdate writeback = for_kupdate, A background writeback = for_background, sync(2) WB_SYNC_ALL writeback = sync(2) WB_SYNC_ALL writeback , ange_start is cyclic = range_cyclic, For a_ops->writepages(): if start or end are non-zero then this is* a hint that the filesystem need only write out the pages inside that* byterange. The byte at `end' is included in the writeout request. = 0, range_end = LLONG_MAX, }
1638  start_time = jiffies
1640  wrote = 0
1642  When Not list_empty - tests whether a list is empty*@head: the list to test. cycle
1643  inode = wb_inode(prev)
1646  If i_sb != sb Then
1647  If sb Then
1662  Break
1670  spin_lock( & _blocks, i_bytes, maybe i_size )
1674  Continue
1689  Continue
1691  spin_unlock( & protects the b_* lists )
1703  Continue
1705  Misc |= Writeback of inode is running
1706  wbc_attach_and_unlock_inode( & wbc, inode)
1708  write_chunk = writeback_chunk_size(wb, work)
1709  Write this many pages, and decrementthis for each page written = write_chunk
1710  Pages which were not written = 0
1716  Write out an inode and its dirty pages. Do not update the writeback list* linkage. That is left to the caller. The caller is also responsible for* setting I_SYNC flag and calling inode_sync_complete() to clear it.
1718  wbc_detach_inode( & wbc)
1719  nr_pages -= write_chunk - Write this many pages, and decrementthis for each page written
1720  wrote += write_chunk - Write this many pages, and decrementthis for each page written
1722  If need_resched() Then
1732  cond_resched()
1739  tmp_wb = inode_to_wb_and_lock_list(inode)
1740  spin_lock( & _blocks, i_bytes, maybe i_size )
1741  If Not (Misc & I_DIRTY_ALL) Then wrote++
1743  Find proper writeback list for the inode depending on its current state and* possibly also change of its state while we were doing writeback. Here we* handle things such as livelock prevention or fairness of writeback among* inodes
1744  inode_sync_complete(inode)
1745  spin_unlock( & _blocks, i_bytes, maybe i_size )
1756  If wrote Then
1759  If nr_pages <= 0 Then Break
1763  Return wrote
Caller
NameDescribe
__writeback_inodes_wb
wb_writebackExplicit flushing or periodic writeback of "old" data