aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-01-02 11:25:34 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-01-02 16:11:06 -0500
commitac40532ef0b8649e6f7f83859ea0de1c4ed08a19 (patch)
treeca86d577fe7fe68ae28b7f7d020f86bc9fff5535 /drivers/scsi/scsi.c
parent158a962422e4a54dc256b6a9b9562f3d30d34d9c (diff)
scsi: revert "[SCSI] Get rid of scsi_cmnd->done"
This reverts commit 6f5391c283d7fdcf24bf40786ea79061919d1e1d ("[SCSI] Get rid of scsi_cmnd->done") that was supposed to be a cleanup commit, but apparently it causes regressions: Bug 9370 - v2.6.24-rc2-409-g9418d5d: attempt to access beyond end of device http://bugzilla.kernel.org/show_bug.cgi?id=9370 this patch should be reintroduced in a more split-up form to make testing of it easier. Signed-off-by: Ingo Molnar <mingo@elte.hu> Acked-by: Matthew Wilcox <matthew@wil.cx> Cc: James Bottomley <James.Bottomley@HansenPartnership.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
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