public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Patrick Mansfield <patmans@us.ibm.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Brian King <brking@us.ibm.com>,
	James Bottomley <James.Bottomley@SteelEye.com>,
	Mike Anderson <andmike@us.ibm.com>,
	SCSI development list <linux-scsi@vger.kernel.org>
Subject: Re: Questions about scsi_target_reap and starget/sdev lifecyle
Date: Mon, 20 Jun 2005 10:31:06 -0700	[thread overview]
Message-ID: <20050620173106.GA22086@us.ibm.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0506201227090.4825-100000@iolanthe.rowland.org>

Hi Alan -

On Mon, Jun 20, 2005 at 12:35:02PM -0400, Alan Stern wrote:

> -/**
> - * scsi_scan_target - scan a target id, possibly including all LUNs on the
> - *     target.
> - * @sdevsca:	Scsi_Device handle for scanning
> - * @shost:	host to scan
> - * @channel:	channel to scan
> - * @id:		target id to scan
> - *
> - * Description:
> - *     Scan the target id on @shost, @channel, and @id. Scan at least LUN
> - *     0, and possibly all LUNs on the target id.
> - *
> - *     Use the pre-allocated @sdevscan as a handle for the scanning. This
> - *     function sets sdevscan->host, sdevscan->id and sdevscan->lun; the
> - *     scanning functions modify sdevscan->lun.
> - *
> - *     First try a REPORT LUN scan, if that does not scan the target, do a
> - *     sequential scan of LUNs on the target id.
> - **/
> -void scsi_scan_target(struct device *parent, unsigned int channel,
> -		      unsigned int id, unsigned int lun, int rescan)
> +static void __scsi_scan_target(struct Scsi_Host *shost, unsigned int channel,
> +		unsigned int id, unsigned int lun, int rescan)
>  {
> -	struct Scsi_Host *shost = dev_to_shost(parent);
>  	int bflags = 0;
>  	int res;
>  	struct scsi_device *sdev = NULL;
> @@ -1257,7 +1247,7 @@ void scsi_scan_target(struct device *par
>  		return;
>  
>  
> -	starget = scsi_alloc_target(parent, channel, id);
> +	starget = scsi_alloc_target(&shost->shost_gendev, channel, id);

For FC (and iSCSI), parent != &shost->shost_gendev. See user scanning
on FC thread / patches. 

[kernel scsi]$ grep scsi_scan_target scsi_transport_fc.c
	scsi_scan_target(&rport->dev, rport->channel, rport->scsi_target_id,

And &rport->dev is not &shost->shost_gendev :-(

> +
> +/**
> + * scsi_scan_target - scan a target id, possibly including all LUNs on the
> + *     target.
> + * @parent:	host to scan
> + * @channel:	channel to scan
> + * @id:		target id to scan
> + * @rescan:	passed to LUN scanning routines
> + *
> + * Description:
> + *     Scan the target id on @shost, @channel, and @id. Scan at least LUN
> + *     0, and possibly all LUNs on the target id.
> + *
> + *     First try a REPORT LUN scan, if that does not scan the target, do a
> + *     sequential scan of LUNs on the target id.
> + **/
> +void scsi_scan_target(struct device *parent, unsigned int channel,
> +		      unsigned int id, unsigned int lun, int rescan)
> +{
> +	struct Scsi_Host *shost = dev_to_shost(parent);
> +
> +	down(&shost->scan_mutex);
> +	if (!test_bit(SHOST_REMOVE, &shost->shost_state))
> +		__scsi_scan_target(shost, channel, id, lun, rescan);

And so parent still has to be passed down to __scsi_scan_target.

-- Patrick Mansfield

  reply	other threads:[~2005-06-20 18:00 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-14 21:27 Questions about scsi_target_reap and starget/sdev lifecyle Alan Stern
2005-06-15  3:28 ` James Bottomley
2005-06-15 20:07   ` Alan Stern
2005-06-15 21:11   ` Alan Stern
2005-06-15 23:03     ` James Bottomley
2005-06-16  2:22       ` Alan Stern
2005-06-16  7:31         ` Mike Anderson
2005-06-16 13:57           ` James Bottomley
2005-06-17  2:01             ` Alan Stern
2005-06-18 20:14             ` Alan Stern
2005-06-20 15:52               ` Brian King
2005-06-20 16:35                 ` Alan Stern
2005-06-20 17:31                   ` Patrick Mansfield [this message]
2005-06-20 19:24                     ` Alan Stern
2005-06-21 17:12               ` Mike Anderson
2005-06-21 17:43                 ` Patrick Mansfield
2005-06-21 19:24                   ` Mike Anderson
2005-06-21 20:04                 ` Alan Stern
2005-06-21 20:10                   ` Christoph Hellwig
2005-06-21 20:33                     ` Alan Stern
2005-06-21 20:58                       ` Mike Anderson
2005-06-21 21:22                         ` Alan Stern
2005-06-22 13:44                         ` Luben Tuikov
2005-06-22 13:36                       ` Luben Tuikov
2005-06-22 15:12                         ` Alan Stern
2005-06-22 15:46                           ` Luben Tuikov
2005-06-22 16:16                             ` Alan Stern
2005-06-22 16:53                               ` Luben Tuikov
2005-06-21 21:08                   ` Mike Anderson
2005-06-21 21:37                     ` Alan Stern

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=20050620173106.GA22086@us.ibm.com \
    --to=patmans@us.ibm.com \
    --cc=James.Bottomley@SteelEye.com \
    --cc=andmike@us.ibm.com \
    --cc=brking@us.ibm.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    /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