mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-04 09:59:32 +00:00
[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>
This commit is contained in:
parent
a6123f1429
commit
355dfa1bc8
1 changed files with 3 additions and 23 deletions
|
@ -18,12 +18,12 @@
|
||||||
#include <linux/sched.h>
|
#include <linux/sched.h>
|
||||||
#include <linux/timer.h>
|
#include <linux/timer.h>
|
||||||
#include <linux/string.h>
|
#include <linux/string.h>
|
||||||
#include <linux/slab.h>
|
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
#include <linux/kthread.h>
|
#include <linux/kthread.h>
|
||||||
#include <linux/interrupt.h>
|
#include <linux/interrupt.h>
|
||||||
#include <linux/blkdev.h>
|
#include <linux/blkdev.h>
|
||||||
#include <linux/delay.h>
|
#include <linux/delay.h>
|
||||||
|
#include <linux/scatterlist.h>
|
||||||
|
|
||||||
#include <scsi/scsi.h>
|
#include <scsi/scsi.h>
|
||||||
#include <scsi/scsi_cmnd.h>
|
#include <scsi/scsi_cmnd.h>
|
||||||
|
@ -640,16 +640,8 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, unsigned char *cmnd,
|
||||||
memcpy(scmd->cmnd, cmnd, cmnd_size);
|
memcpy(scmd->cmnd, cmnd, cmnd_size);
|
||||||
|
|
||||||
if (copy_sense) {
|
if (copy_sense) {
|
||||||
gfp_t gfp_mask = GFP_ATOMIC;
|
sg_init_one(&sgl, scmd->sense_buffer,
|
||||||
|
sizeof(scmd->sense_buffer));
|
||||||
if (shost->hostt->unchecked_isa_dma)
|
|
||||||
gfp_mask |= __GFP_DMA;
|
|
||||||
|
|
||||||
sgl.page = alloc_page(gfp_mask);
|
|
||||||
if (!sgl.page)
|
|
||||||
return FAILED;
|
|
||||||
sgl.offset = 0;
|
|
||||||
sgl.length = 252;
|
|
||||||
|
|
||||||
scmd->sc_data_direction = DMA_FROM_DEVICE;
|
scmd->sc_data_direction = DMA_FROM_DEVICE;
|
||||||
scmd->request_bufflen = sgl.length;
|
scmd->request_bufflen = sgl.length;
|
||||||
|
@ -719,18 +711,6 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, unsigned char *cmnd,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Last chance to have valid sense data.
|
|
||||||
*/
|
|
||||||
if (copy_sense) {
|
|
||||||
if (!SCSI_SENSE_VALID(scmd)) {
|
|
||||||
memcpy(scmd->sense_buffer, page_address(sgl.page),
|
|
||||||
sizeof(scmd->sense_buffer));
|
|
||||||
}
|
|
||||||
__free_page(sgl.page);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Restore original data
|
* Restore original data
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue