From: Jeff Garzik <jeff@garzik.org>
To: James Bottomley <James.Bottomley@SteelEye.com>
Cc: Matthew Wilcox <matthew@wil.cx>, FUJITA Tomonori <tomof@acm.org>,
akpm@linux-foundation.org, linux-scsi@vger.kernel.org,
linux-kernel@vger.kernel.org, fujita.tomonori@lab.ntt.co.jp
Subject: Re: queued patches for SCSI for 2.6.24
Date: Tue, 25 Sep 2007 23:55:41 -0400 [thread overview]
Message-ID: <46F9D83D.5050305@garzik.org> (raw)
In-Reply-To: <1190778353.8707.29.camel@localhost.localdomain>
James Bottomley wrote:
> This whole mess is generated basically because the zero default of the
> template should be treated as initiator. How about this, which makes
> that manifest?
>
> James
>
> diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
> index adc9559..7e26440 100644
> --- a/drivers/scsi/hosts.c
> +++ b/drivers/scsi/hosts.c
> @@ -342,7 +342,11 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize)
> shost->unchecked_isa_dma = sht->unchecked_isa_dma;
> shost->use_clustering = sht->use_clustering;
> shost->ordered_tag = sht->ordered_tag;
> - shost->active_mode = sht->supported_mode;
> + if (sht->supported_mode == MODE_UNKNOWN)
> + /* means we didn't set it ... default to INITIATOR */
> + shost->active_mode = MODE_INITIATOR;
> + else
> + shost->active_mode = sht->supported_mode;
>
> if (sht->max_host_blocked)
> shost->max_host_blocked = sht->max_host_blocked;
> diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
> index 0088c4d..4965e9e 100644
> --- a/drivers/scsi/scsi_sysfs.c
> +++ b/drivers/scsi/scsi_sysfs.c
> @@ -209,11 +209,13 @@ show_shost_mode(unsigned int mode, char *buf)
> static ssize_t show_shost_supported_mode(struct class_device *class_dev, char *buf)
> {
> struct Scsi_Host *shost = class_to_shost(class_dev);
> + unsigned int supported_mode = shost->hostt->supported_mode;
>
> - if (shost->hostt->supported_mode == MODE_UNKNOWN)
> - return snprintf(buf, 20, "unknown\n");
> - else
> - return show_shost_mode(shost->hostt->supported_mode, buf);
> + if (supported_mode == MODE_UNKNOWN)
> + /* by default this should be initiator */
> + supported_mode = MODE_INITIATOR;
> +
> + return show_shost_mode(shost->hostt->supported_mode, buf);
> }
>
> static CLASS_DEVICE_ATTR(supported_mode, S_IRUGO | S_IWUSR, show_shost_supported_mode, NULL);
ACK
next prev parent reply other threads:[~2007-09-26 3:55 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-26 1:00 queued patches for SCSI for 2.6.24 James Bottomley
2007-09-26 1:05 ` David Miller
2007-09-26 1:09 ` Boaz Harrosh
2007-09-26 1:28 ` FUJITA Tomonori
2007-09-26 1:28 ` FUJITA Tomonori
2007-09-26 1:42 ` James Bottomley
2007-09-26 2:12 ` FUJITA Tomonori
2007-09-26 2:37 ` Jeff Garzik
2007-09-26 2:52 ` FUJITA Tomonori
2007-09-26 2:56 ` Matthew Wilcox
2007-09-26 3:34 ` Jeff Garzik
2007-09-26 3:38 ` Matthew Wilcox
2007-09-26 3:45 ` James Bottomley
2007-09-26 3:55 ` Jeff Garzik [this message]
2007-09-26 3:55 ` FUJITA Tomonori
2007-09-26 4:01 ` James Bottomley
2007-09-26 4:10 ` FUJITA Tomonori
2007-09-26 4:56 ` FUJITA Tomonori
2007-09-26 14:07 ` James Bottomley
2007-09-26 8:50 ` Stefan Boresch
2007-09-26 11:15 ` Matthew Wilcox
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=46F9D83D.5050305@garzik.org \
--to=jeff@garzik.org \
--cc=James.Bottomley@SteelEye.com \
--cc=akpm@linux-foundation.org \
--cc=fujita.tomonori@lab.ntt.co.jp \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=matthew@wil.cx \
--cc=tomof@acm.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.