All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: jejb@steeleye.com
Cc: linux-scsi@vger.kernel.org
Subject: [PATCH] aic7xxx: user scsi_device host private data
Date: Mon, 23 May 2005 17:14:22 +0200	[thread overview]
Message-ID: <20050523151422.GA3668@lst.de> (raw)

Index: drivers/scsi/aic7xxx/aic7xxx_osm.c
===================================================================
--- ddc0c48133f130f8f4fcaeee05c8cff31209259d/drivers/scsi/aic7xxx/aic7xxx_osm.c  (mode:100644)
+++ uncommitted/drivers/scsi/aic7xxx/aic7xxx_osm.c  (mode:100644)
@@ -610,10 +610,8 @@
 static int
 ahc_linux_queue(struct scsi_cmnd * cmd, void (*scsi_done) (struct scsi_cmnd *))
 {
-	struct	 ahc_softc *ahc;
-	struct	 ahc_linux_device *dev;
-
-	ahc = *(struct ahc_softc **)cmd->device->host->hostdata;
+	struct ahc_softc *ahc = *(struct ahc_softc **)cmd->device->host->hostdata;
+	struct ahc_linux_device *dev = cmd->device->hostdata;
 
 	/*
 	 * Save the callback on completion function.
@@ -629,10 +627,6 @@
 	if (ahc->platform_data->qfrozen != 0)
 		return SCSI_MLQUEUE_HOST_BUSY;
 
-	dev = ahc_linux_get_device(ahc, cmd->device->channel, cmd->device->id,
-				   cmd->device->lun);
-	BUG_ON(dev == NULL);
-
 	cmd->result = CAM_REQ_INPROG << 16;
 
 	return ahc_linux_run_command(ahc, dev, cmd);
@@ -707,6 +701,8 @@
 		if (dev == NULL)
 			goto out;
 	}
+
+	device->hostdata = dev;
 	retval = 0;
 
  out:
@@ -717,16 +713,12 @@
 static int
 ahc_linux_slave_configure(struct scsi_device *device)
 {
-	struct	ahc_softc *ahc;
-	struct	ahc_linux_device *dev;
-
-	ahc = *((struct ahc_softc **)device->host->hostdata);
+	struct ahc_softc *ahc = *((struct ahc_softc **)device->host->hostdata);
+	struct ahc_linux_device *dev = device->hostdata;
 
 	if (bootverbose)
 		printf("%s: Slave Configure %d\n", ahc_name(ahc), device->id);
 
-	dev = ahc_linux_get_device(ahc, device->channel, device->id,
-				   device->lun);
 	dev->scsi_device = device;
 	ahc_linux_device_queue_depth(ahc, dev);
 
@@ -740,16 +732,11 @@
 static void
 ahc_linux_slave_destroy(struct scsi_device *device)
 {
-	struct	ahc_softc *ahc;
-	struct	ahc_linux_device *dev;
+	struct ahc_softc *ahc = *((struct ahc_softc **)device->host->hostdata);
+	struct ahc_linux_device *dev = device->hostdata;
 
-	ahc = *((struct ahc_softc **)device->host->hostdata);
 	if (bootverbose)
 		printf("%s: Slave Destroy %d\n", ahc_name(ahc), device->id);
-	dev = ahc_linux_get_device(ahc, device->channel,
-				   device->id, device->lun);
-
-	BUG_ON(dev->active);
 
 	ahc_linux_free_device(ahc, dev);
 }
@@ -1401,6 +1388,7 @@
 				   devinfo->lun);
 	if (dev == NULL)
 		return;
+
 	was_queuing = dev->flags & (AHC_DEV_Q_BASIC|AHC_DEV_Q_TAGGED);
 	switch (alg) {
 	default:
@@ -2330,7 +2318,7 @@
 ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag)
 {
 	struct ahc_softc *ahc;
-	struct ahc_linux_device *dev;
+	struct ahc_linux_device *dev = cmd->device->hostdata;
 	struct scb *pending_scb;
 	u_int  saved_scbptr;
 	u_int  active_scb_index;
@@ -2365,21 +2353,6 @@
 	 * at all, and the system wanted us to just abort the
 	 * command, return success.
 	 */
-	dev = ahc_linux_get_device(ahc, cmd->device->channel, cmd->device->id,
-				   cmd->device->lun);
-
-	if (dev == NULL) {
-		/*
-		 * No target device for this command exists,
-		 * so we must not still own the command.
-		 */
-		printf("%s:%d:%d:%d: Is not an active device\n",
-		       ahc_name(ahc), cmd->device->channel, cmd->device->id,
-		       cmd->device->lun);
-		retval = SUCCESS;
-		goto no_cmd;
-	}
-
 	if ((dev->flags & (AHC_DEV_Q_BASIC|AHC_DEV_Q_TAGGED)) == 0
 	 && ahc_search_untagged_queues(ahc, cmd, cmd->device->id,
 				       cmd->device->channel + 'A',

             reply	other threads:[~2005-05-23 15:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-23 15:14 Christoph Hellwig [this message]
2005-05-23 15:34 ` [PATCH] aic7xxx: user scsi_device host private data James Bottomley
2005-05-23 19:16   ` Christoph Hellwig
2005-05-23 20:04     ` James Bottomley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050523151422.GA3668@lst.de \
    --to=hch@lst.de \
    --cc=jejb@steeleye.com \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.