Function report |
Source Code:block\bsg.c |
Create Date:2022-07-28 17:37:33 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:bsg_sg_io
Proto:static int bsg_sg_io(struct request_queue *q, fmode_t mode, void __user *uarg)
Type:int
Parameter:
| Type | Parameter | Name |
|---|---|---|
| struct request_queue * | q | |
| fmode_t | mode | |
| void __user * | uarg |
| 142 | If copy_from_user( & hdr, uarg, size of hdr ) Then Return -EFAULT |
| 148 | If [i] 'Q' to differentiate from v3 != 'Q' Then Return -EINVAL |
| 150 | ret = check_proto( & hdr) |
| 154 | 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. |
| 164 | If Not timeout Then timeout = * sg stuff |
| 166 | If Not timeout Then timeout = default timeout for SG_IO if none specified |
| 168 | If timeout < BLK_MIN_SG_TIMEOUT Then timeout = BLK_MIN_SG_TIMEOUT |
| 171 | If [i] bytes to be transferred to device Then |
| 172 | ret = blk_rq_map_user(q, rq, NULL, uptr64( [i], [*i] ), [i] bytes to be transferred to device , GFP_KERNEL) |
| 174 | Else if [i] bytes to be transferred from device Then |
| 175 | ret = blk_rq_map_user(q, rq, NULL, uptr64( [i], [*o] ), [i] bytes to be transferred from device , GFP_KERNEL) |
| 179 | If ret Then Go to out_free_rq |
| 185 | ret = complete_rq(rq, & hdr) |
| 188 | out_free_rq : |
| 190 | blk_put_request(rq) |
| 193 | Return ret |
| Name | Describe |
|---|---|
| bsg_ioctl |
| Source code conversion tool public plug-in interface | X |
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |