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:53
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:__iomap_write_begin

Proto:static int __iomap_write_begin(struct inode *inode, loff_t pos, unsigned len, int flags, struct page *page, struct iomap *srcmap)

Type:int

Parameter:

TypeParameterName
struct inode *inode
loff_tpos
unsignedlen
intflags
struct page *page
struct iomap *srcmap
602  iop = iomap_page_create(inode, page)
603  block_size = i_blocksize(inode)
604  block_start = pos & ~(block_size - 1)
605  block_end = pos + len + block_size - 1 & ~(block_size - 1)
606  from = offset_in_page(pos) , to = from + len
609  If PageUptodate(page) Then Return 0
612  Do
613  Calculate the range inside the page that we actually need to read.
615  If plen == 0 Then Break
618  If Not (flags & IOMAP_WRITE_F_UNSHARE) && ( from <= poff || from >= poff + plen ) && ( to <= poff || to >= poff + plen ) Then Continue
624  If WARN_ON_ONCE(flags & IOMAP_WRITE_F_UNSHARE) Then Return -EIO
628  Continue
631  status = iomap_read_page_sync(block_start, page, poff, plen, srcmap)
633  If status Then Return status
635  When (block_start += plen) < block_end cycle
637  Return 0
Caller
NameDescribe
iomap_write_begin