Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:bsg_scsi_fill_hdr

Proto:static int bsg_scsi_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
68  sreq = scsi_req(rq)
70  If [i] bytes to be transferred to device && [i] bytes to be transferred from device Then
71  pr_warn_once("BIDI support in bsg has been removed.\n")
72  Return -EOPNOTSUPP
75  cmd_len = [i] in bytes
76  If cmd_len > BLK_MAX_CDB Then
77  cmd = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc).
78  If Not cmd Then Return -ENOMEM
82  If copy_from_user(cmd, uptr64( [i], [*i] {SCSI: cdb} ), cmd_len) Then Return -EFAULT
84  If blk_verify_command(cmd, mode) Then Return -EPERM
86  Return 0