Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Test to see if we have an existing ioend structure that we could append to* first, otherwise finish off the current ioend and start another.

Proto:static void iomap_add_to_ioend(struct inode *inode, loff_t offset, struct page *page, struct iomap_page *iop, struct iomap_writepage_ctx *wpc, struct writeback_control *wbc, struct list_head *iolist)

Type:void

Parameter:

TypeParameterName
struct inode *inode
loff_toffset
struct page *page
struct iomap_page *iop
struct iomap_writepage_ctx *wpc
struct writeback_control *wbc
struct list_head *iolist
1367  sector = iomap_sector( & iomap, offset)
1368  len = i_blocksize(inode)
1369  poff = offset & PAGE_SIZE - 1
1370  bool merged, same_page = false
1372  If Not ioend || Not iomap_can_add_to_ioend(wpc, offset, sector) Then
1373  If ioend Then list_add - add a new entry*@new: new entry to be added*@head: list head to add it after* Insert a new entry after the specified head.* This is good for implementing stacks.
1375  ioend = iomap_alloc_ioend(inode, wpc, offset, sector, wbc)
1378  merged = __bio_try_merge_page( being built , page, len, poff, & same_page)
1380  If iop && Not same_page Then atomic_inc( & write_count)
1383  If Not merged Then
1388  bio_add_page( being built , page, len, poff)
1391  size of the extent += len
1392  wbc_account_cgroup_owner(wbc, page, len)
Caller
NameDescribe
iomap_writepage_mapWe implement an immediate ioend submission policy here to avoid needing to* chain multiple ioends and hence nest mempool allocations which can violate* forward progress guarantees we need to provide