]> err.no Git - linux-2.6/commitdiff
[SCSI] remove scsi_wait_req
authorChristoph Hellwig <hch@lst.de>
Fri, 28 Oct 2005 23:09:12 +0000 (01:09 +0200)
committerJames Bottomley <jejb@mulgrave.(none)>
Sun, 6 Nov 2005 18:45:20 +0000 (12:45 -0600)
This function has been superceeded by the block request based interfaces
and is unused (except for the uncompilable cpqfc driver).

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
drivers/scsi/scsi_lib.c
include/scsi/scsi_request.h

index e40c8b66da40fe80ab6a1167ed29b1e9e62fa3d9..4afef5cdcb17568c1380d3987d1e4c4661dc16e4 100644 (file)
@@ -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
index 2539debb7993cf91c687ebd9f6656e5a790eee07..98d69fdb851c3844b2d914f9fd08b610f0315f7b 100644 (file)
@@ -47,9 +47,6 @@ struct scsi_request {
 
 extern struct scsi_request *scsi_allocate_request(struct scsi_device *, gfp_t);
 extern void scsi_release_request(struct scsi_request *);
-extern void scsi_wait_req(struct scsi_request *, const void *cmnd,
-                         void *buffer, unsigned bufflen,
-                         int timeout, int retries);
 extern void scsi_do_req(struct scsi_request *, const void *cmnd,
                        void *buffer, unsigned bufflen,
                        void (*done) (struct scsi_cmnd *),