函数逻辑报告

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

函数名称: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.

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

返回类型:long

参数:

类型参数名称
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  当非链表为空循环
1643  inode等于wb_inode(链表前项)
1646  如果i_sb不等于sb
1647  如果sb
1662  退出
1670  加自旋锁
1671  如果Misc 按位与I_NEW按位或I_FREEING按位或I_WILL_FREE的值则
1674  继续下一循环
1676  如果Misc 按位与I_SYNCsync_mode不等于Wait on every mapping
1689  继续下一循环
1691  自旋锁解锁
1698  如果Misc 按位与I_SYNC
1702  加自旋锁
1703  继续下一循环
1705  Misc 或等于I_SYNC
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_chunkWrite this many pages, and decrementthis for each page written
1720  wrote加等于write_chunkWrite this many pages, and decrementthis for each page written
1722  如果need_resched()则
1732  cond_resched()
1739  tmp_wb等于inode_to_wb_and_lock_list(inode)
1740  加自旋锁
1741  如果非Misc 按位与I_DIRTY_ALL的值则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  自旋锁解锁
1749  加自旋锁
1756  如果wrote
1759  如果nr_pages小于等于0则退出
1763  返回:wrote
调用者
名称描述
__writeback_inodes_wb
wb_writebackExplicit flushing or periodic writeback of "old" data