函数逻辑报告 |
Source Code:block\scsi_ioctl.c |
Create Date:2022-07-27 19:11:51 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:sg_io
函数原型:static int sg_io(struct request_queue *q, struct gendisk *bd_disk, struct sg_io_hdr *hdr, fmode_t mode)
返回类型:int
参数:
类型 | 参数 | 名称 |
---|---|---|
struct request_queue * | q | |
struct gendisk * | bd_disk | |
struct sg_io_hdr * | hdr | |
fmode_t | mode |
284 | ret等于0 |
285 | writing等于0 |
286 | at_head等于0 |
291 | 如果 [i] 'S' for SCSI generic (required) 不等于'S'则返回:负EINVAL |
294 | 如果 [i] byte count of data transfer 大于queue_max_hw_sectors(q)左移9位则返回:负EIO |
297 | 如果 [i] byte count of data transfer 则switch [i] data transfer direction |
299 | 默认 |
300 | 返回:负EINVAL |
304 | 当: [i] data transfer direction 恒等于reated like SG_DXFER_FROM_DEV with theadditional property than during indirectIO the user buffer is copied into thekernel buffers before the transfer |
306 | 退出 |
308 | 如果 [i] 0 -> default, see SG_FLAG... 按位与SG_FLAG_Q_AT_HEAD则at_head等于1 |
312 | rq等于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. |
317 | 如果 [i] SCSI command length 大于BLK_MAX_CDB则 |
319 | 如果非cmd则转到:out_put_request |
324 | 如果ret小于0则转到:out_free_cdb |
327 | ret等于0 |
328 | 如果 [i] 0 implies no scatter gather 则 |
333 | 如果in_compat_syscall()则ret等于compat_import_iovec(rq_data_dir(rq), [i], [*io] points to data transfer memory or scatter gather list , [i] 0 implies no scatter gather , 0, & iov, & i) |
342 | 如果ret小于0则转到:out_free_cdb |
349 | 释放内存 |
350 | 否则如果 [i] byte count of data transfer 则ret等于REQ_BLOCK_PC请求 |
354 | 如果ret则转到:out_free_cdb |
358 | retries等于0 |
360 | start_time等于jiffies |
366 | 将请求插入队列执行 |
368 | [o] time taken by cmd (unit: millisec) 等于Convert jiffies to milliseconds and back.* Avoid unnecessary multiplications/divisions in the* two most common HZ cases: |
370 | ret等于blk_complete_sghdr_rq(rq, hdr, bio) |
372 | out_free_cdb : |
373 | scsi_req_free_cmd(req) |
374 | out_put_request : |
375 | blk_put_request(rq) |
376 | 返回:ret |
名称 | 描述 |
---|---|
scsi_cmd_ioctl |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |