Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:bsg_transport_fill_hdr

Proto:static int bsg_transport_fill_hdr(struct request *rq, struct sg_io_v4 *hdr, fmode_t mode)

Type:int

Parameter:

TypeParameterName
struct request *rq
struct sg_io_v4 *hdr
fmode_tmode
39  job = lk_mq_rq_to_pdu - cast a request to a PDU*@rq: the request to be casted* Return: pointer to the PDU* Driver command data is immediately after the request. So add request to get* the PDU.
42  request_len = [i] in bytes
43  Transport/driver specific request/reply structs = memdup_user - duplicate memory region from user space*@src: source address in user space*@len: number of bytes to copy* Return: an ERR_PTR() on failure. Result is physically* contiguous, to be freed by kfree().
44  If IS_ERR( Transport/driver specific request/reply structs ) Then Return PTR_ERR( Transport/driver specific request/reply structs )
47  If [i] bytes to be transferred to device && [i] bytes to be transferred from device Then
48  BIDI support = lk_get_request - allocate a request*@q: request queue to allocate a request for*@op: operation (REQ_OP_*) and REQ_* flags, e.g. REQ_SYNC.*@flags: BLK_MQ_REQ_* flags, e.g. BLK_MQ_REQ_NOWAIT.
49  If IS_ERR( BIDI support ) Then
51  Go to out
54  ret = blk_rq_map_user(q, BIDI support , NULL, uptr64( [i], [*o] ), [i] bytes to be transferred from device , GFP_KERNEL)
57  If ret Then Go to out_free_bidi_rq
60  bidi_bio = bio
61  Else
62  BIDI support = NULL
63  bidi_bio = NULL
66  Return 0
68  out_free_bidi_rq :
69  If BIDI support Then blk_put_request( BIDI support )
71  out :
72  kfree( Transport/driver specific request/reply structs )
73  Return ret