All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 21/24][RFC] scsi_tgt: use of sense accessors
@ 2008-02-04 17:53 Boaz Harrosh
  2008-02-05 16:21 ` Pete Wyckoff
  0 siblings, 1 reply; 4+ messages in thread
From: Boaz Harrosh @ 2008-02-04 17:53 UTC (permalink / raw)
  To: James Bottomley, FUJITA Tomonori, Christoph Hellwig, Jens Axboe
  Cc: Andrew Morton

  FIXME: I need help with this driver (Pete?)
    I used scsi_sense() in a none const way. But since
    scsi_tgt is the ULD here, it can just access it's own sense
    buffer directly. I did not use scsi_eh_cpy_sense() because
    I did not want the extra copy. Pete will want to use a 260
    bytes buffer here.

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Need-help-from: Pete Wyckoff <pw@osc.edu>
---
 drivers/scsi/scsi_tgt_lib.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/scsi_tgt_lib.c b/drivers/scsi/scsi_tgt_lib.c
index e01a985..d42f318 100644
--- a/drivers/scsi/scsi_tgt_lib.c
+++ b/drivers/scsi/scsi_tgt_lib.c
@@ -29,6 +29,7 @@
 #include <scsi/scsi_host.h>
 #include <scsi/scsi_transport.h>
 #include <scsi/scsi_tgt.h>
+#include <scsi/scsi_eh.h>
 
 #include "scsi_tgt_priv.h"
 
@@ -397,7 +398,7 @@ static int scsi_tgt_copy_sense(struct scsi_cmnd *cmd, unsigned long uaddr,
 {
 	char __user *p = (char __user *) uaddr;
 
-	if (copy_from_user(cmd->sense_buffer, p,
+	if (copy_from_user(scsi_sense(cmd), p,
 			   min_t(unsigned, SCSI_SENSE_BUFFERSIZE, len))) {
 		printk(KERN_ERR "Could not copy the sense buffer\n");
 		return -EIO;
-- 
1.5.3.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-02-05 17:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-04 17:53 [PATCH 21/24][RFC] scsi_tgt: use of sense accessors Boaz Harrosh
2008-02-05 16:21 ` Pete Wyckoff
2008-02-05 16:53   ` FUJITA Tomonori
2008-02-05 17:28     ` Jeff Garzik

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.