函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:block\bio.c Create Date:2022-07-27 18:31:20
Last Modify:2020-03-17 23:13:58 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:_map_kern - map kernel address into bio*@q: the struct request_queue for the bio*@data: pointer to buffer to map*@len: length in bytes*@gfp_mask: allocation flags for bio allocation* Map the kernel address into a bio suitable for io to a block* device

函数原型:struct bio *bio_map_kern(struct request_queue *q, void *data, unsigned int len, gfp_t gfp_mask)

返回类型:struct bio

参数:

类型参数名称
struct request_queue *q
void *data
unsigned intlen
gfp_tgfp_mask
1520  kaddr等于data
1521  end等于kaddrlenPAGE_SIZE减1右移PAGE_SHIFT determines the page size
1522  start等于kaddr右移PAGE_SHIFT determines the page size
1523  nr_pages等于endstart
1524  is_vmalloc等于Determine if an address is within the vmalloc range* On nommu, vmalloc/vfree wrap through kmalloc/kfree directly, so there* is no special casing required.
1529  bio等于bio_kmalloc(gfp_mask, nr_pages)
1530  如果非bio则返回:错误号
1533  如果is_vmalloc
1534  flush_kernel_vmap_range(data, len)
1535  bi_private等于data
1538  offset等于offset_in_page(kaddr)
1539 i小于nr_pages循环
1540  bytes等于PAGE_SIZEoffset
1542  如果len小于等于0则退出
1545  如果bytes大于lenbytes等于len
1548  如果非is_vmallocpage等于virt_to_page(kaddr) returns a valid pointer if and only if* virt_addr_valid(kaddr) returns true.(data)
1550  否则page等于vmalloc_to_page(data)
1552  如果bio_add_pc_page(q, bio, page, bytes, offset)小于bytes
1556  返回:错误号
1559  data加等于bytes
1560  len减等于bytes
1561  offset等于0
1564  bi_end_io等于bio_map_kern_endio
1565  返回:bio
调用者
名称描述
blk_rq_map_kernlk_rq_map_kern - map kernel data to a request, for passthrough requests*@q: request queue where request should be inserted*@rq: request to fill*@kbuf: the kernel buffer*@len: length of user data*@gfp_mask: memory allocation flags* Description: