函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Create the page-cache page that contains the requested block.* This is used purely for blockdev mappings.

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

返回类型:int

参数:

类型参数名称
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  如果page_has_buffers(page)则
994  bh等于If we *know* page->private refers to buffer_heads (page)
995  如果 size of mapping 恒等于size
999  转到:done
1001  如果非try_to_free_buffers(page)则转到:failed
1008  bh等于Create the appropriate buffers when given a page for data area and* the size of each buffer
1015  加自旋锁
1016  link_dev_buffers(page, bh)
1017  end_block等于Initialise the state of a blockdev page's buffers.
1019  自旋锁解锁
1020  done :
1021  ret等于如果block小于end_block则1否则负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  返回:ret
调用者
名称描述
grow_buffersCreate buffers for the specified block device block's page. If* that page was dirty, the buffers are set dirty also.