Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Generic "read page" function for block devices that have the normal* get_block functionality

Proto:int block_read_full_page(struct page *page, get_block_t *get_block)

Type:int

Parameter:

TypeParameterName
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  Do
2276  If 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 Continue
2279  If Not buffer_mapped(bh) Then
2280  err = 0
2282  fully_mapped = 0
2283  If iblock < lblock Then
2285  err = get_block(inode, iblock, bh, 0)
2286  If err Then SetPageError(page)
2289  If Not buffer_mapped(bh) Then
2302  arr[nr++] = bh
2303  When i++, iblock++, (bh = circular list of page's buffers ) != head cycle
2305  If fully_mapped Then SetPageMappedToDisk(page)
2308  If Not nr Then
2313  If Not PageError(page) Then 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  Return 0
2320  When i < nr cycle
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  When i < nr cycle
2332  bh = arr[i]
2333  If 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 end_buffer_async_read(bh, 1)
2335  Else submit_bh(REQ_OP_READ, 0, bh)
2338  Return 0
Caller
NameDescribe
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