aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/aha152x.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2006-07-08 14:42:15 -0400
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-07-09 12:56:44 -0400
commit631c228cd09bd5b93090fa60bd9803ec14aa0586 (patch)
tree3d15819bbdc30e291c342e06a0694184b1616996 /drivers/scsi/aha152x.c
parentae0fda0cdf009731a33f031f86df8566f1977ffe (diff)
[SCSI] hide EH backup data outside the scsi_cmnd
Currently struct scsi_cmnd has various fields that are used to backup original data after the corresponding fields have been overridden for EH commands. This means drivers can easily get at it and misuse it. Due to the old_ naming this doesn't happen for most of them, but two that have different names have been used wrong a lot (see previous patch). Another downside is that they unessecarily bloat the scsi_cmnd size. This patch moves them onstack in scsi_send_eh_cmnd to fix those two issues aswell as allowing future EH fixes like moving the EH command submissions to use SG lists like everything else. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/aha152x.c')
-rw-r--r--drivers/scsi/aha152x.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c
index cff3d389b010..f974869ea323 100644
--- a/drivers/scsi/aha152x.c
+++ b/drivers/scsi/aha152x.c
@@ -1179,6 +1179,10 @@ static int aha152x_device_reset(Scsi_Cmnd * SCpnt)
1179 DECLARE_MUTEX_LOCKED(sem); 1179 DECLARE_MUTEX_LOCKED(sem);
1180 struct timer_list timer; 1180 struct timer_list timer;
1181 int ret, issued, disconnected; 1181 int ret, issued, disconnected;
1182 unsigned char old_cmd_len = SCpnt->cmd_len;
1183 unsigned short old_use_sg = SCpnt->use_sg;
1184 void *old_buffer = SCpnt->request_buffer;
1185 unsigned old_bufflen = SCpnt->request_bufflen;
1182 unsigned long flags; 1186 unsigned long flags;
1183 1187
1184#if defined(AHA152X_DEBUG) 1188#if defined(AHA152X_DEBUG)
@@ -1212,11 +1216,11 @@ static int aha152x_device_reset(Scsi_Cmnd * SCpnt)
1212 add_timer(&timer); 1216 add_timer(&timer);
1213 down(&sem); 1217 down(&sem);
1214 del_timer(&timer); 1218 del_timer(&timer);
1215 1219
1216 SCpnt->cmd_len = SCpnt->old_cmd_len; 1220 SCpnt->cmd_len = old_cmd_len;
1217 SCpnt->use_sg = SCpnt->old_use_sg; 1221 SCpnt->use_sg = old_use_sg;
1218 SCpnt->request_buffer = SCpnt->buffer; 1222 SCpnt->request_buffer = old_buffer;
1219 SCpnt->request_bufflen = SCpnt->bufflen; 1223 SCpnt->request_bufflen = old_bufflen;
1220 1224
1221 DO_LOCK(flags); 1225 DO_LOCK(flags);
1222 1226