函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Look up the bh in this cpu's LRU. If it's there, move it to the head.

函数原型:static struct buffer_head *lookup_bh_lru(struct block_device *bdev, sector_t block, unsigned size)

返回类型:struct buffer_head

参数:

类型参数名称
struct block_device *bdev
sector_tblock
unsignedsize
1297  struct buffer_head * ret = NULL
1300  check_irqs_on()
1301  bh_lru_lock()
1302 i小于Per-cpu buffer LRU implementation. To reduce the cost of __find_get_block().* The bhs[] array is sorted - newest buffer is at bhs[0]. Buffers have their* refcount elevated by one when they're in an LRU. A buffer can only appear循环
1303  bh等于Operations for contexts that are safe from preemption/interrupts. These* operations verify that preemption is disabled.(bhs[i])
1305  如果bh start block number 恒等于blockb_bdev恒等于bdev size of mapping 恒等于size
1307  如果i
1315  get_bh(bh)
1316  ret等于bh
1317  退出
1320  bh_lru_unlock()
1321  返回:ret
调用者
名称描述
__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