函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\buffer.c Create Date:2022-07-29 10:45:17
Last Modify:2020-03-18 10:38:29 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:__block_write_begin_int

函数原型:int __block_write_begin_int(struct page *page, loff_t pos, unsigned len, get_block_t *get_block, struct iomap *iomap)

返回类型:int

参数:

类型参数名称
struct page *page
loff_tpos
unsignedlen
get_block_t *get_block
struct iomap *iomap
1973  from等于pos按位与PAGE_SIZE减1
1974  to等于fromlen
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 bh不等于head或非block_start循环
1995  block_end等于block_startblocksize
1996  如果block_end小于等于fromblock_start大于等于to
1997  如果PageUptodate(page)则
2001  继续下一循环
2003  如果buffer_new(bh)则clear_buffer_new(bh)
2005  如果非buffer_mapped(bh)则
2007  如果get_block
2008  err等于get_block(inode, block, bh, 1)
2009  如果err退出
2011  否则
2015  如果buffer_new(bh)则
2030  如果PageUptodate(page)则
2033  继续下一循环
2039  wait_bh自加等于bh
2045 wait_bh大于wait循环
2046  wait_on_buffer( * --wait_bh)
2047  如果非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.err等于负EIO
2050  如果此条件成立可能性小(为编译器优化)(err)则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  返回:err
调用者
名称描述
__block_write_begin
iomap_write_begin
iomap_page_mkwrite_actor