Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Create the page-cache page that contains the requested block.* This is used purely for blockdev mappings.

Proto:static int grow_dev_page(struct block_device *bdev, sector_t block, unsigned long index, int size, int sizebits, gfp_t gfp)

Type:int

Parameter:

TypeParameterName
struct block_device *bdev
sector_tblock
unsigned longindex
intsize
intsizebits
gfp_tgfp
972  inode = will die
976  ret = 0
979  gfp_mask = Restricts the given gfp_mask to what the mapping allows. | gfp
987  gfp_mask |= __GFP_NOFAIL
989  page = d_or_create_page - locate or add a pagecache page*@mapping: the page's address_space*@index: the page's index into the mapping*@gfp_mask: page allocation mode* Looks up the page cache slot at @mapping & @offset
991  BUG_ON(!PageLocked(page))
993  If page_has_buffers(page) Then
994  bh = If we *know* page->private refers to buffer_heads (page)
995  If size of mapping == size Then
999  Go to done
1001  If Not try_to_free_buffers(page) Then Go to failed
1008  bh = Create the appropriate buffers when given a page for data area and* the size of each buffer
1015  spin_lock( & private_lock)
1016  link_dev_buffers(page, bh)
1017  end_block = Initialise the state of a blockdev page's buffers.
1019  spin_unlock( & private_lock)
1020  done :
1021  ret = If block < end_block Then 1 Else -ENXIO
1022  failed :
1023  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.
1024  Perform a free_page(), also freeing any swap cache associated with* this page if it is the last user of the page.
1025  Return ret
Caller
NameDescribe
grow_buffersCreate buffers for the specified block device block's page. If* that page was dirty, the buffers are set dirty also.