aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/scsi.c')
-rw-r--r--drivers/scsi/scsi.c20
1 files changed, 3 insertions, 17 deletions
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
index 0fb1709ce5e3..7ceb8209e5df 100644
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -59,7 +59,6 @@
59#include <scsi/scsi_cmnd.h> 59#include <scsi/scsi_cmnd.h>
60#include <scsi/scsi_dbg.h> 60#include <scsi/scsi_dbg.h>
61#include <scsi/scsi_device.h> 61#include <scsi/scsi_device.h>
62#include <scsi/scsi_driver.h>
63#include <scsi/scsi_eh.h> 62#include <scsi/scsi_eh.h>
64#include <scsi/scsi_host.h> 63#include <scsi/scsi_host.h>
65#include <scsi/scsi_tcq.h> 64#include <scsi/scsi_tcq.h>
@@ -368,8 +367,9 @@ void scsi_log_send(struct scsi_cmnd *cmd)
368 scsi_print_command(cmd); 367 scsi_print_command(cmd);
369 if (level > 3) { 368 if (level > 3) {
370 printk(KERN_INFO "buffer = 0x%p, bufflen = %d," 369 printk(KERN_INFO "buffer = 0x%p, bufflen = %d,"
371 " queuecommand 0x%p\n", 370 " done = 0x%p, queuecommand 0x%p\n",
372 scsi_sglist(cmd), scsi_bufflen(cmd), 371 scsi_sglist(cmd), scsi_bufflen(cmd),
372 cmd->done,
373 cmd->device->host->hostt->queuecommand); 373 cmd->device->host->hostt->queuecommand);
374 374
375 } 375 }
@@ -654,12 +654,6 @@ void __scsi_done(struct scsi_cmnd *cmd)
654 blk_complete_request(rq); 654 blk_complete_request(rq);
655} 655}
656 656
657/* Move this to a header if it becomes more generally useful */
658static struct scsi_driver *scsi_cmd_to_driver(struct scsi_cmnd *cmd)
659{
660 return *(struct scsi_driver **)cmd->request->rq_disk->private_data;
661}
662
663/* 657/*
664 * Function: scsi_finish_command 658 * Function: scsi_finish_command
665 * 659 *
@@ -671,8 +665,6 @@ void scsi_finish_command(struct scsi_cmnd *cmd)
671{ 665{
672 struct scsi_device *sdev = cmd->device; 666 struct scsi_device *sdev = cmd->device;
673 struct Scsi_Host *shost = sdev->host; 667 struct Scsi_Host *shost = sdev->host;
674 struct scsi_driver *drv;
675 unsigned int good_bytes;
676 668
677 scsi_device_unbusy(sdev); 669 scsi_device_unbusy(sdev);
678 670
@@ -698,13 +690,7 @@ void scsi_finish_command(struct scsi_cmnd *cmd)
698 "Notifying upper driver of completion " 690 "Notifying upper driver of completion "
699 "(result %x)\n", cmd->result)); 691 "(result %x)\n", cmd->result));
700 692
701 good_bytes = cmd->request_bufflen; 693 cmd->done(cmd);
702 if (cmd->request->cmd_type != REQ_TYPE_BLOCK_PC) {
703 drv = scsi_cmd_to_driver(cmd);
704 if (drv->done)
705 good_bytes = drv->done(cmd);
706 }
707 scsi_io_completion(cmd, good_bytes);
708} 694}
709EXPORT_SYMBOL(scsi_finish_command); 695EXPORT_SYMBOL(scsi_finish_command);
710 696