Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:blk_complete_sghdr_rq

Proto:static int blk_complete_sghdr_rq(struct request *rq, struct sg_io_hdr *hdr, struct bio *bio)

Type:int

Parameter:

TypeParameterName
struct request *rq
struct sg_io_hdr *hdr
struct bio *bio
247  req = scsi_req(rq)
248  ret = 0
253  [o] scsi status = result & 0xff
254  [o] shifted, masked scsi status = Use these to separate status msg and our bytes* These are set by:* status byte = set from target device* msg_byte = return status from host adapter itself.* host_byte = set by low-level driver to indicate status.* driver_byte = set by mid-level.(result)
255  [o] messaging level data (optional) = msg_byte(result)
256  [o] errors from host adapter = host_byte(result)
257  [o] errors from software driver = driver_byte(result)
258  [o] auxiliary information = 0
259  If [o] shifted, masked scsi status || [o] errors from host adapter || [o] errors from software driver Then [o] auxiliary information |= something abnormal happened
261  [o] dxfer_len - actual_transferred = residual count
262  [o] byte count actually written to sbp = 0
264  If sense_len && [i], [*o] points to sense_buffer memory Then
265  len = min - return minimum of two values of the same or compatible types*@x: first value*@y: second value((unsignedint) [i] max length to write to sbp , sense_len)
267  If Not copy_to_user( [i], [*o] points to sense_buffer memory , sense, len) Then [o] byte count actually written to sbp = len
269  Else ret = -EFAULT
273  r = lk_rq_unmap_user - unmap a request with user data*@bio: start of bio list* Description:* Unmap a rq previously mapped by blk_rq_map_user(). The caller must* supply the original rq->bio from the blk_rq_map_user() return, since
274  If Not ret Then ret = r
277  Return ret
Caller
NameDescribe
sg_io