函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Generic "read page" function for block devices that have the normal* get_block functionality

函数原型:int block_read_full_page(struct page *page, get_block_t *get_block)

返回类型:int

参数:

类型参数名称
struct page *page
get_block_t *get_block
2258  inode等于host
2263  fully_mapped等于1
2265  head等于create_page_buffers(page, inode, 0)
2266  blocksize等于 size of mapping
2267  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)
2269  iblock等于 Our offset within mapping. 左移PAGE_SHIFT determines the page size bbits
2270  lblock等于NOTE: in a 32bit arch with a preemptable kernel and* an UP compile the i_size_read/write must be atomic* with respect to the local cpu (unlike with preempt disabled),* but they don't need to be atomic with respect to other cpus like in* true SMP (so they blocksize减1右移bbits
2271  bh等于head
2272  nr等于0
2273  i等于0
2275  循环
2276  如果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.则继续下一循环
2279  如果非buffer_mapped(bh)则
2280  err等于0
2282  fully_mapped等于0
2283  如果iblock小于lblock
2285  err等于get_block(inode, iblock, bh, 0)
2286  如果errSetPageError(page)
2289  如果非buffer_mapped(bh)则
2302  arr[nr++]等于bh
2303 i自加, iblock自加, bh等于 circular list of page's buffers 不等于head循环
2305  如果fully_mappedSetPageMappedToDisk(page)
2308  如果非nr
2313  如果非PageError(page)则SetPageUptodate(page)
2315  lock_page - unlock a locked page*@page: the page* Unlocks the page and wakes up sleepers in ___wait_on_page_locked().* Also wakes sleepers in wait_on_page_writeback() because the wakeup* mechanism between PageLocked pages and PageWriteback pages is shared.
2316  返回:0
2320 i小于nr循环
2321  bh等于arr[i]
2322  lock_buffer(bh)
2323  If a page's buffers are under async readin (end_buffer_async_read* completion) then there is a possibility that another thread of* control could lock one of the buffers after it has completed* but while some of the other buffers have not completed
2331 i小于nr循环
2332  bh等于arr[i]
2333  如果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.end_buffer_async_read(bh, 1)
2335  否则submit_bh(REQ_OP_READ, 0, bh)
2338  返回:0
调用者
名称描述
blkdev_readpage
do_mpage_readpageThis is the worker routine which does all the work of mapping the disk* blocks and constructs largest possible bios, submits them for IO if the* blocks are not contiguous on the disk