函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:block\bio-integrity.c Create Date:2022-07-27 19:38:00
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:_integrity_prep - Prepare bio for integrity I/O*@bio: bio to prepare* Description: Checks if the bio already has an integrity payload attached.* If it does, the payload has been generated by another kernel subsystem,* and we just pass it through

函数原型:bool bio_integrity_prep(struct bio *bio)

返回类型:bool

参数:

类型参数名称
struct bio *bio
202  bi等于blk_get_integrity(bi_disk)
203  q等于queue
211  如果非bi则返回:true
214  如果bio_op(bio)不等于REQ_OP_READbio_op(bio)不等于REQ_OP_WRITE则返回:true
217  如果非bio_sectors(bio)则返回:true
221  如果bio_integrity(bio)则返回:true
224  如果Return the data direction, READ or WRITE.(bio)恒等于generic data direction definitions
225  如果非verify_fn或非flags按位与BLK_INTEGRITY_VERIFY的值则返回:true
228  否则
229  如果非generate_fn或非flags按位与BLK_INTEGRITY_GENERATE的值则返回:true
233  intervals等于_integrity_intervals - Return number of integrity intervals for a bio*@bi: blk_integrity profile for device*@sectors: Size of the bio in 512-byte sectors* Description: The block layer calculates everything in 512 byte* sectors but integrity metadata is
236  len等于intervalstuple_size
237  buf等于开辟内存
238  status等于BLK_STS_RESOURCE
239  如果此条件成立可能性小(为编译器优化)(buf == NULL)则
240  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
241  转到:err_end_io
244  end等于buflenPAGE_SIZE减1右移PAGE_SHIFT determines the page size
245  start等于buf右移PAGE_SHIFT determines the page size
246  nr_pages等于endstart
249  bip等于_integrity_alloc - Allocate integrity payload and attach it to bio*@bio: bio to attach integrity metadata to*@gfp_mask: Memory allocation mask*@nr_vecs: Number of integrity metadata scatter-gather elements* Description: This function prepares a bio for
250  如果是错误
251  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
252  释放内存
253  status等于BLK_STS_RESOURCE
254  转到:err_end_io
257  control flags 或等于BIP_BLOCK_INTEGRITY
258  residual I/O count 等于len
259  bip_set_seed(bip, device address in 512 byte sectors )
261  如果flags按位与BLK_INTEGRITY_IP_CHECKSUMcontrol flags 或等于BIP_IP_CHECKSUM
265  offset等于offset_in_page(buf)
266 i小于nr_pages循环
268  bytes等于PAGE_SIZEoffset
270  如果len小于等于0则退出
273  如果bytes大于lenbytes等于len
276  ret等于_integrity_add_page - Attach integrity metadata*@bio: bio to update*@page: page containing integrity metadata*@len: number of bytes of integrity metadata in page*@offset: start offset within page
279  如果ret恒等于0则
281  释放内存
283  转到:err_end_io
286  如果ret小于bytes退出
289  buf加等于bytes
290  len减等于bytes
291  offset等于0
295  如果Return the data direction, READ or WRITE.(bio)恒等于WRITE
296  _integrity_process - Process integrity metadata for a bio*@bio: bio to generate/verify integrity metadata for*@proc_iter: iterator to process*@proc_fn: Pointer to the relevant processing function
298  否则
299  r rewinding parent bio 等于bi_iter
301  返回:true
303  err_end_io :
304  bi_status等于status
305  _endio - end I/O on a bio*@bio: bio* Description:* bio_endio() will end I/O on the whole bio. bio_endio() is the preferred* way to end I/O on a bio. No one should call bi_end_io() directly on a
306  返回:false
调用者
名称描述
blk_mq_make_request