Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Various filesystems appear to want __find_get_block to be non-blocking

Proto:static struct buffer_head *__find_get_block_slow(struct block_device *bdev, sector_t block)

Type:struct buffer_head

Parameter:

TypeParameterName
struct block_device *bdev
sector_tblock
199  bd_inode = will die
200  bd_mapping = i_mapping
201  struct buffer_head * ret = NULL
206  all_mapped = 1
207  DEFINE_RATELIMIT_STATE(last_warned, HZ, 1)
209  index = block >> PAGE_SHIFT determines the page size - i_blkbits
210  page = find_get_page_flags(bd_mapping, index, FGP_ACCESSED)
211  If Not page Then Go to out
214  spin_lock( & private_lock)
215  If Not page_has_buffers(page) Then Go to out_unlock
217  head = If we *know* page->private refers to buffer_heads (page)
218  bh = head
219  Do
220  If Not buffer_mapped(bh) Then all_mapped = 0
222  Else if start block number == block Then
223  ret = bh
224  get_bh(bh)
225  Go to out_unlock
227  bh = circular list of page's buffers
228  When bh != head cycle
235  ratelimit_set_flags( & last_warned, ssue num suppressed message on exit )
236  If all_mapped && __ratelimit( & last_warned) Then
237  printk - print a kernel message*@fmt: format string* This is printk(). It can be called from any context. We want it to work.* We try to grab the console_lock. If we succeed, it's easy - we log the* output and call the console drivers
245  out_unlock :
246  spin_unlock( & private_lock)
247  Perform a free_page(), also freeing any swap cache associated with* this page if it is the last user of the page.
248  out :
249  Return ret
Caller
NameDescribe
__find_get_blockPerform a pagecache lookup for the matching buffer. If it's there, refresh* it in the LRU and mark it as accessed. If it is not present then return* NULL