diff options
author | James Bottomley <jejb@mulgrave.(none)> | 2005-11-08 12:50:26 -0500 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.(none)> | 2005-11-08 12:50:26 -0500 |
commit | 383f9749505cef0a30dbd7109db7fe469aa64753 (patch) | |
tree | 9e88d648396ac99a90d12ccf5471d001e87c65ae /drivers/scsi/scsi_lib.c | |
parent | f093182d313edde9b1f86dbdaf40ba4da2dbd0e7 (diff) | |
parent | 3da8b713da723e78a03f0404beedf3cc6f4f860b (diff) | |
download | linux-383f9749505cef0a30dbd7109db7fe469aa64753.tar.gz linux-383f9749505cef0a30dbd7109db7fe469aa64753.tar.bz2 linux-383f9749505cef0a30dbd7109db7fe469aa64753.zip |
Merge by hand (conflicts between pending drivers and kfree cleanups)
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/scsi_lib.c')
-rw-r--r-- | drivers/scsi/scsi_lib.c | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index e40c8b66da40..4afef5cdcb17 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -254,55 +254,6 @@ void scsi_do_req(struct scsi_request *sreq, const void *cmnd, } EXPORT_SYMBOL(scsi_do_req); -/* This is the end routine we get to if a command was never attached - * to the request. Simply complete the request without changing - * rq_status; this will cause a DRIVER_ERROR. */ -static void scsi_wait_req_end_io(struct request *req) -{ - BUG_ON(!req->waiting); - - complete(req->waiting); -} - -void scsi_wait_req(struct scsi_request *sreq, const void *cmnd, void *buffer, - unsigned bufflen, int timeout, int retries) -{ - DECLARE_COMPLETION(wait); - int write = (sreq->sr_data_direction == DMA_TO_DEVICE); - struct request *req; - - req = blk_get_request(sreq->sr_device->request_queue, write, - __GFP_WAIT); - if (bufflen && blk_rq_map_kern(sreq->sr_device->request_queue, req, - buffer, bufflen, __GFP_WAIT)) { - sreq->sr_result = DRIVER_ERROR << 24; - blk_put_request(req); - return; - } - - req->flags |= REQ_NOMERGE; - req->waiting = &wait; - req->end_io = scsi_wait_req_end_io; - req->cmd_len = COMMAND_SIZE(((u8 *)cmnd)[0]); - req->sense = sreq->sr_sense_buffer; - req->sense_len = 0; - memcpy(req->cmd, cmnd, req->cmd_len); - req->timeout = timeout; - req->flags |= REQ_BLOCK_PC; - req->rq_disk = NULL; - blk_insert_request(sreq->sr_device->request_queue, req, - sreq->sr_data_direction == DMA_TO_DEVICE, NULL); - wait_for_completion(&wait); - sreq->sr_request->waiting = NULL; - sreq->sr_result = req->errors; - if (req->errors) - sreq->sr_result |= (DRIVER_ERROR << 24); - - blk_put_request(req); -} - -EXPORT_SYMBOL(scsi_wait_req); - /** * scsi_execute - insert request and wait for the result * @sdev: scsi device |