函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:lk_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:

函数原型:int blk_rq_map_kern(struct request_queue *q, struct request *rq, void *kbuf, unsigned int len, gfp_t gfp_mask)

返回类型:int

参数:

类型参数名称
struct request_queue *q
struct request *rq
void *kbuf
unsigned intlen
gfp_tgfp_mask
224  reading等于rq_data_dir(rq)恒等于generic data direction definitions
225  addr等于kbuf
226  do_copy等于0
230  如果len大于queue_max_hw_sectors(q)左移9位则返回:负EINVAL
232  如果非len或非kbuf则返回:负EINVAL
235  do_copy等于非blk_rq_aligned(q, addr, len)或object_is_on_stack(kbuf)
236  如果do_copybio等于_copy_kern - copy kernel address into bio*@q: the struct request_queue for the bio*@data: pointer to buffer to copy*@len: length in bytes*@gfp_mask: allocation flags for bio and page allocation*@reading: data direction is READ* copy the kernel address
238  否则bio等于_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
241  如果是错误则返回:错误
244  bottom bits req flags, * top bits REQ_OP. Use * accessors.与等于REQ_OP_MASK的反
245  bottom bits req flags, * top bits REQ_OP. Use * accessors.或等于req_op(rq)
247  如果do_copyrq_flags或等于contains copies of user pages
250  orig_bio等于bio
251  ret等于Append a bio to a passthrough request. Only works if the bio can be merged* into the request based on the driver constraints.
252  如果此条件成立可能性小(为编译器优化)(ret)则
254  _put - release a reference to a bio*@bio: bio to release reference to* Description:* Put a reference to a &struct bio, either one you have gotten with* bio_alloc, bio_get or bio_clone_*. The last put of a bio will free it.
255  返回:ret
258  返回:0
调用者
名称描述
sg_scsi_ioctlsg_scsi_ioctl -- handle deprecated SCSI_IOCTL_SEND_COMMAND ioctl*@q: request queue to send scsi commands down*@disk: gendisk to operate on (option)*@mode: mode used to open the file through which the ioctl has been* submitted*@sic: userspace structure