Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:block\blk-map.c Create Date:2022-07-28 17:05:00
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name: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:

Proto:int blk_rq_map_kern(struct request_queue *q, struct request *rq, void *kbuf, unsigned int len, gfp_t gfp_mask)

Type:int

Parameter:

TypeParameterName
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  If len > queue_max_hw_sectors(q) << 9 Then Return -EINVAL
232  If Not len || Not kbuf Then Return -EINVAL
235  do_copy = Not blk_rq_aligned(q, addr, len) || object_is_on_stack(kbuf)
236  If do_copy Then bio = _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  Else 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  If IS_ERR(bio) Then Return PTR_ERR(bio)
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  If do_copy Then rq_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  If Value for the false possibility is greater at compile time(ret) Then
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  Return ret
258  Return 0
Caller
NameDescribe
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