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

Proto:static int __writeback_single_inode(struct inode *inode, struct writeback_control *wbc)

Type:int

Parameter:

TypeParameterName
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 & Writeback of inode is running))
1450  trace_writeback_single_inode_start(inode, wbc, nr_to_write)
1452  ret = do_writepages(mapping, wbc)
1461  If sync_mode == Wait on every mapping && Not sync(2) WB_SYNC_ALL writeback Then
1462  err = filemap_fdatawait(mapping)
1463  If ret == 0 Then ret = err
1472  spin_lock( & _blocks, i_bytes, maybe i_size )
1474  dirty = Misc & I_DIRTY
1475  If Misc & I_DIRTY_TIME Then
1485  Else Misc &= ~I_DIRTY_TIME_EXPIRED
1487  Misc &= ~dirty
1500  smp_mb()
1502  If Returns true if any of the pages in the mapping are marked with the tag. Then Misc |= Inode has dirty pages
1505  spin_unlock( & _blocks, i_bytes, maybe i_size )
1507  If dirty & I_DIRTY_TIME Then mark_inode_dirty_sync(inode)
1510  If dirty & ~Inode has dirty pages Then
1511  err = write_inode(inode, wbc)
1512  If ret == 0 Then ret = err
1515  trace_writeback_single_inode(inode, wbc, nr_to_write)
1516  Return ret
Caller
NameDescribe
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.