diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2008-12-13 11:23:45 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2009-03-12 13:58:10 -0400 |
commit | f078727b250c2653fc9a564f15547c17ebac3f99 (patch) | |
tree | 60cbd84965cbebc6a2898aa7664c25977d128b46 /drivers/scsi/scsi_error.c | |
parent | 26243043f207b3faa00594a33e10b2103205f27b (diff) |
[SCSI] remove scsi_req_map_sg
No one uses scsi_execute_async with data transfer now. We can remove
scsi_req_map_sg.
Only scsi_eh_lock_door uses scsi_execute_async. scsi_eh_lock_door
doesn't handle sense and the callback. So we can remove
scsi_io_context too.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/scsi_error.c')
-rw-r--r-- | drivers/scsi/scsi_error.c | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index ad6a1370761e..0c2c73be1974 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c | |||
@@ -1441,6 +1441,11 @@ int scsi_decide_disposition(struct scsi_cmnd *scmd) | |||
1441 | } | 1441 | } |
1442 | } | 1442 | } |
1443 | 1443 | ||
1444 | static void eh_lock_door_done(struct request *req, int uptodate) | ||
1445 | { | ||
1446 | __blk_put_request(req->q, req); | ||
1447 | } | ||
1448 | |||
1444 | /** | 1449 | /** |
1445 | * scsi_eh_lock_door - Prevent medium removal for the specified device | 1450 | * scsi_eh_lock_door - Prevent medium removal for the specified device |
1446 | * @sdev: SCSI device to prevent medium removal | 1451 | * @sdev: SCSI device to prevent medium removal |
@@ -1463,19 +1468,28 @@ int scsi_decide_disposition(struct scsi_cmnd *scmd) | |||
1463 | */ | 1468 | */ |
1464 | static void scsi_eh_lock_door(struct scsi_device *sdev) | 1469 | static void scsi_eh_lock_door(struct scsi_device *sdev) |
1465 | { | 1470 | { |
1466 | unsigned char cmnd[MAX_COMMAND_SIZE]; | 1471 | struct request *req; |
1467 | 1472 | ||
1468 | cmnd[0] = ALLOW_MEDIUM_REMOVAL; | 1473 | req = blk_get_request(sdev->request_queue, READ, GFP_KERNEL); |
1469 | cmnd[1] = 0; | 1474 | if (!req) |
1470 | cmnd[2] = 0; | 1475 | return; |
1471 | cmnd[3] = 0; | ||
1472 | cmnd[4] = SCSI_REMOVAL_PREVENT; | ||
1473 | cmnd[5] = 0; | ||
1474 | 1476 | ||
1475 | scsi_execute_async(sdev, cmnd, 6, DMA_NONE, NULL, 0, 0, 10 * HZ, | 1477 | req->cmd[0] = ALLOW_MEDIUM_REMOVAL; |
1476 | 5, NULL, NULL, GFP_KERNEL); | 1478 | req->cmd[1] = 0; |
1477 | } | 1479 | req->cmd[2] = 0; |
1480 | req->cmd[3] = 0; | ||
1481 | req->cmd[4] = SCSI_REMOVAL_PREVENT; | ||
1482 | req->cmd[5] = 0; | ||
1478 | 1483 | ||
1484 | req->cmd_len = COMMAND_SIZE(req->cmd[0]); | ||
1485 | |||
1486 | req->cmd_type = REQ_TYPE_BLOCK_PC; | ||
1487 | req->cmd_flags |= REQ_QUIET; | ||
1488 | req->timeout = 10 * HZ; | ||
1489 | req->retries = 5; | ||
1490 | |||
1491 | blk_execute_rq_nowait(req->q, NULL, req, 1, eh_lock_door_done); | ||
1492 | } | ||
1479 | 1493 | ||
1480 | /** | 1494 | /** |
1481 | * scsi_restart_operations - restart io operations to the specified host. | 1495 | * scsi_restart_operations - restart io operations to the specified host. |