函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

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

函数原型:static int __writeback_single_inode(struct inode *inode, struct writeback_control *wbc)

返回类型:int

参数:

类型参数名称
struct inode *inode
struct writeback_control *wbc
1443  mapping等于i_mapping
1444  nr_to_write等于Write this many pages, and decrementthis for each page written
1448  WARN_ON(!(Misc & I_SYNC))
1450  trace_writeback_single_inode_start(inode, wbc, nr_to_write)
1452  ret等于do_writepages(mapping, wbc)
1461  如果sync_mode恒等于Wait on every mapping 且非sync(2) WB_SYNC_ALL writeback
1462  err等于filemap_fdatawait(mapping)
1463  如果ret恒等于0则ret等于err
1472  加自旋锁
1474  dirty等于Misc 按位与I_DIRTY
1475  如果Misc 按位与I_DIRTY_TIME
1482  dirty或等于I_DIRTY_TIME按位或I_DIRTY_TIME_EXPIRED
1485  否则Misc 与等于I_DIRTY_TIME_EXPIRED的反
1487  Misc 与等于dirty的反
1500  smp_mb()
1502  如果Returns true if any of the pages in the mapping are marked with the tag.Misc 或等于I_DIRTY_PAGES
1505  自旋锁解锁
1507  如果dirty按位与I_DIRTY_TIMEmark_inode_dirty_sync(inode)
1510  如果dirty按位与I_DIRTY_PAGES的反则
1511  err等于write_inode(inode, wbc)
1512  如果ret恒等于0则ret等于err
1515  trace_writeback_single_inode(inode, wbc, nr_to_write)
1516  返回:ret
调用者
名称描述
writeback_single_inodeWrite out an inode's dirty pages. Either the caller has an active reference* on the inode or the inode has I_WILL_FREE set.* This function is designed to be called for writing back one inode which* we go e
writeback_sb_inodesWrite 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.