aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_error.c
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@steeleye.com>2007-05-22 15:43:14 -0400
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2007-05-24 10:10:02 -0400
commit355dfa1bc8026d185678fed4e409719a595b2d39 (patch)
treef3d2c19268bf879565509730e611d4d389d78fbc /drivers/scsi/scsi_error.c
parenta6123f142924a5e21f6d48e6e3c67d9060726caa (diff)
[SCSI] scsi_error: send the sense buffer down without copying
Now that the block submission path correctly bounces, we can simply use the command sense_buffer to send to retrieve sense information and junk the unnecessary page allocation. Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/scsi_error.c')
-rw-r--r--drivers/scsi/scsi_error.c26
1 files changed, 3 insertions, 23 deletions
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index e8350c562d24..9adb64ac054c 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -18,12 +18,12 @@
18#include <linux/sched.h> 18#include <linux/sched.h>
19#include <linux/timer.h> 19#include <linux/timer.h>
20#include <linux/string.h> 20#include <linux/string.h>
21#include <linux/slab.h>
22#include <linux/kernel.h> 21#include <linux/kernel.h>
23#include <linux/kthread.h> 22#include <linux/kthread.h>
24#include <linux/interrupt.h> 23#include <linux/interrupt.h>
25#include <linux/blkdev.h> 24#include <linux/blkdev.h>
26#include <linux/delay.h> 25#include <linux/delay.h>
26#include <linux/scatterlist.h>
27 27
28#include <scsi/scsi.h> 28#include <scsi/scsi.h>
29#include <scsi/scsi_cmnd.h> 29#include <scsi/scsi_cmnd.h>
@@ -640,16 +640,8 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, unsigned char *cmnd,
640 memcpy(scmd->cmnd, cmnd, cmnd_size); 640 memcpy(scmd->cmnd, cmnd, cmnd_size);
641 641
642 if (copy_sense) { 642 if (copy_sense) {
643 gfp_t gfp_mask = GFP_ATOMIC; 643 sg_init_one(&sgl, scmd->sense_buffer,
644 644 sizeof(scmd->sense_buffer));
645 if (shost->hostt->unchecked_isa_dma)
646 gfp_mask |= __GFP_DMA;
647
648 sgl.page = alloc_page(gfp_mask);
649 if (!sgl.page)
650 return FAILED;
651 sgl.offset = 0;
652 sgl.length = 252;
653 645
654 scmd->sc_data_direction = DMA_FROM_DEVICE; 646 scmd->sc_data_direction = DMA_FROM_DEVICE;
655 scmd->request_bufflen = sgl.length; 647 scmd->request_bufflen = sgl.length;
@@ -720,18 +712,6 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, unsigned char *cmnd,
720 712
721 713
722 /* 714 /*
723 * Last chance to have valid sense data.
724 */
725 if (copy_sense) {
726 if (!SCSI_SENSE_VALID(scmd)) {
727 memcpy(scmd->sense_buffer, page_address(sgl.page),
728 sizeof(scmd->sense_buffer));
729 }
730 __free_page(sgl.page);
731 }
732
733
734 /*
735 * Restore original data 715 * Restore original data
736 */ 716 */
737 scmd->request_buffer = old_buffer; 717 scmd->request_buffer = old_buffer;