public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@SteelEye.com>
To: Mark Haverkamp <markh@osdl.org>
Cc: linux-scsi <linux-scsi@vger.kernel.org>,
	Mark Salyzyn <mark_salyzyn@adaptec.com>
Subject: Re: [PATCH 3/7] aacraid: handle AIF hotplug events
Date: Sun, 25 Sep 2005 09:56:35 -0500	[thread overview]
Message-ID: <1127660195.4839.5.camel@mulgrave> (raw)
In-Reply-To: <1127246183.1891.34.camel@markh1.pdx.osdl.net>

On Tue, 2005-09-20 at 12:56 -0700, Mark Haverkamp wrote:
> +       shost_for_each_device(device, dev->scsi_host_ptr)
> +       {
> +               if ((device->channel == CONTAINER_TO_CHANNEL
> (container))
> +                && (device->id == CONTAINER_TO_ID(container))
> +                && (device->lun == CONTAINER_TO_LUN(container))) {
> +                       switch (device_config_needed) {
> +                       case DELETE:
> +                               scsi_remove_device(device);
> +                               break;
> +                       case CHANGE:
> +                               if (!dev->fsa_dev[container].valid) {
> +                                       scsi_remove_device(device);
> +                                       break;
> +                               }
> +                               scsi_rescan_device(&device-
> >sdev_gendev);
> +
> +                       default:
> +                               break;
> +                       }
> +                       scsi_device_put(device);
> +                       break;
> +               }
> +       }

This is open coding scsi_lookup_device(); why not simply use that API?
It returns a device that also has to have scsi_device_put() called on it
when you're finished.  I suppose it won't necessarily matter for
aacraid, but if we have to make the lookup more efficient for large lun
configurations, you'll benefit.

James



  reply	other threads:[~2005-09-25 14:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-20 19:56 [PATCH 3/7] aacraid: handle AIF hotplug events Mark Haverkamp
2005-09-25 14:56 ` James Bottomley [this message]
2005-09-26 20:04   ` [PATCH 3/7] aacraid: handle AIF hotplug events (update) Mark Haverkamp

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=1127660195.4839.5.camel@mulgrave \
    --to=james.bottomley@steeleye.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mark_salyzyn@adaptec.com \
    --cc=markh@osdl.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox