Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\buffer.c Create Date:2022-07-28 20:14:10
Last Modify:2020-03-18 10:38:29 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:__block_write_begin_int

Proto:int __block_write_begin_int(struct page *page, loff_t pos, unsigned len, get_block_t *get_block, struct iomap *iomap)

Type:int

Parameter:

TypeParameterName
struct page *page
loff_tpos
unsignedlen
get_block_t *get_block
struct iomap *iomap
1973  from = pos & PAGE_SIZE - 1
1974  to = from + len
1975  inode = host
1978  err = 0
1980  wait_bh = wait
1982  BUG_ON(!PageLocked(page))
1983  BUG_ON(from > PAGE_SIZE)
1984  BUG_ON(to > PAGE_SIZE)
1985  BUG_ON(from > to)
1987  head = create_page_buffers(page, inode, 0)
1988  blocksize = size of mapping
1989  bbits = Size is a power-of-two in the range 512..PAGE_SIZE,* and the case we care about most is PAGE_SIZE.* So this *could* possibly be written with those* constraints in mind (relevant mostly if some* architecture has a slow bit-scan instruction)
1991  block = Our offset within mapping. << PAGE_SHIFT determines the page size - bbits
1993  When bh != head || Not block_start cycle
1995  block_end = block_start + blocksize
1996  If block_end <= from || block_start >= to Then
1997  If PageUptodate(page) Then
2001  Continue
2003  If buffer_new(bh) Then clear_buffer_new(bh)
2005  If Not buffer_mapped(bh) Then
2007  If get_block Then
2008  err = get_block(inode, block, bh, 1)
2009  If err Then Break
2011  Else
2015  If buffer_new(bh) Then
2030  If PageUptodate(page) Then
2033  Continue
2039  wait_bh++ = bh
2045  When wait_bh > wait cycle
2046  wait_on_buffer( * --wait_bh)
2047  If Not Emit the buffer bitops functions. Note that there are also functions* of the form "mark_buffer_foo()". These are higher-level functions which* do something in addition to setting a b_state bit. Then err = -EIO
2050  If Value for the false possibility is greater at compile time(err) Then If a page has any new buffers, zero them out here, and mark them uptodate* and dirty so they'll be written out (in order to prevent uninitialised* block data from leaking). And clear the new bit.
2052  Return err
Caller
NameDescribe
__block_write_begin
iomap_write_begin
iomap_page_mkwrite_actor