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

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

Type:int

Parameter:

TypeParameterName
struct inode *inode
struct writeback_control *wbc
1531  ret = 0
1533  spin_lock( & _blocks, i_bytes, maybe i_size )
1534  If Not atomic_read( & i_count) Then WARN_ON(!(Misc & (Must be set when calling write_inode_now() if i_count is zero | Set when inode is about to be freed but still has dirty pages or buffers attached or the inode itself is still dirty)))
1536  Else WARN_ON(Misc & Must be set when calling write_inode_now() if i_count is zero)
1539  If Misc & Writeback of inode is running Then
1540  If sync_mode != Wait on every mapping Then Go to out
1547  Wait for writeback on an inode to complete. Called with i_lock held.* Caller must make sure inode cannot go away when we drop i_lock.
1549  WARN_ON(Misc & Writeback of inode is running)
1558  If Not (Misc & I_DIRTY_ALL) && ( sync_mode != Wait on every mapping || Not Returns true if any of the pages in the mapping are marked with the tag. ) Then Go to out
1562  Misc |= Writeback of inode is running
1563  wbc_attach_and_unlock_inode(wbc, inode)
1565  ret = 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.
1567  wbc_detach_inode(wbc)
1569  wb = inode_to_wb_and_lock_list(inode)
1570  spin_lock( & _blocks, i_bytes, maybe i_size )
1575  If Not (Misc & I_DIRTY_ALL) Then de_io_list_del_locked - remove an inode from its bdi_writeback IO list*@inode: inode to be removed*@wb: bdi_writeback @inode is being removed from* Remove @inode which may be on one of @wb->b_{dirty|io|more_io} lists and
1577  spin_unlock( & protects the b_* lists )
1578  inode_sync_complete(inode)
1579  out :
1580  spin_unlock( & _blocks, i_bytes, maybe i_size )
1581  Return ret
Caller
NameDescribe
write_inode_nowwrite_inode_now - write an inode to disk*@inode: inode to write to disk*@sync: whether the write should be synchronous or not* This function commits an inode to disk immediately if it is dirty. This is* primarily needed by knfsd.
sync_inodesync_inode - write an inode and its pages to disk.*@inode: the inode to sync*@wbc: controls the writeback mode* sync_inode() will write an inode and its pages to disk. It will also* correctly update the inode on its superblock's dirty inode lists and will