* about scsi_hostlist
@ 2002-11-17 22:11 Ming Zhang
2002-11-17 22:30 ` Doug Ledford
2002-11-17 22:35 ` Christoph Hellwig
0 siblings, 2 replies; 5+ messages in thread
From: Ming Zhang @ 2002-11-17 22:11 UTC (permalink / raw)
To: linux-scsi@vger.kernel.org
Hi, I meet a problem when port my code to 2.5.47.
My goal is to get all scsi disk Scsi_Device pointers.
For 2.4.18, I can use scsi_hostlist to travel through the list and get all pointer by comparing type if TYPE_DISK. But in 2.5.47, there is no such pointer. And that scsi_host_list can not be used.
Does anyone know how to get around to this?
Thanks in advance.
Best regards.
Ming Zhang
------------------------------
Member of IEEE, ACM
mingz@ele.uri.edu
http://www.ele.uri.edu/~mingz
1(401)874-4859
Department of Electrical and Computer Engineering
University of Rhode Island
4 East Alumni Ave. Kingston, RI, 02881
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: about scsi_hostlist
2002-11-17 22:11 about scsi_hostlist Ming Zhang
@ 2002-11-17 22:30 ` Doug Ledford
2002-11-17 22:35 ` Christoph Hellwig
1 sibling, 0 replies; 5+ messages in thread
From: Doug Ledford @ 2002-11-17 22:30 UTC (permalink / raw)
To: Ming Zhang; +Cc: linux-scsi@vger.kernel.org
On Sun, Nov 17, 2002 at 05:11:28PM -0500, Ming Zhang wrote:
> Hi, I meet a problem when port my code to 2.5.47.
> My goal is to get all scsi disk Scsi_Device pointers.
Why? A couple people on this list have been trying to put proper object
ref counting in place, and doing this sort of thing usually violates those
ref counting rules, so unless you have a true valid need to do this, the
answer is probably going to be "Don't do that".
> For 2.4.18, I can use scsi_hostlist to travel through the list and get all pointer by comparing type if TYPE_DISK. But in 2.5.47, there is no such pointer. And that scsi_host_list can not be used.
>
> Does anyone know how to get around to this?
>
> Thanks in advance.
>
>
>
> Best regards.
>
>
> Ming Zhang
> ------------------------------
> Member of IEEE, ACM
> mingz@ele.uri.edu
> http://www.ele.uri.edu/~mingz
> 1(401)874-4859
>
> Department of Electrical and Computer Engineering
> University of Rhode Island
>
> 4 East Alumni Ave. Kingston, RI, 02881
>
>
>
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Doug Ledford <dledford@redhat.com> 919-754-3700 x44233
Red Hat, Inc.
1801 Varsity Dr.
Raleigh, NC 27606
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: about scsi_hostlist
2002-11-17 22:11 about scsi_hostlist Ming Zhang
2002-11-17 22:30 ` Doug Ledford
@ 2002-11-17 22:35 ` Christoph Hellwig
1 sibling, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2002-11-17 22:35 UTC (permalink / raw)
To: Ming Zhang; +Cc: linux-scsi@vger.kernel.org
On Sun, Nov 17, 2002 at 05:11:28PM -0500, Ming Zhang wrote:
> Hi, I meet a problem when port my code to 2.5.47.
> My goal is to get all scsi disk Scsi_Device pointers.
>
> For 2.4.18, I can use scsi_hostlist to travel through the list and get all pointer by comparing type if TYPE_DISK. But in 2.5.47, there is no such pointer. And that scsi_host_list can not be used.
You are not supposed to walk any lists that are private to the
midlayer (like scsi_hostlist). What do you try to archive?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: about scsi_hostlist
2002-11-17 22:35 Ming Zhang
@ 2002-11-17 22:41 ` Christoph Hellwig
0 siblings, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2002-11-17 22:41 UTC (permalink / raw)
To: Ming Zhang; +Cc: Doug Ledford, linux-scsi@vger.kernel.org
On Sun, Nov 17, 2002 at 05:35:52PM -0500, Ming Zhang wrote:
> Hi, Doug
>
> For example, like the iSCSI target code, when it start, it should find all SCSI disks or tapes link in order to export to client side.
Why you just do this in userspace?
> It need the scsi_device pointer in order to send requests to it. That is why I need it.
Umm, no. Nothing but upperlayer drivers is supposed to talk to the scsi
midlayer directly. Implement an upperlayer driver and check for disks in
->attach instead.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: about scsi_hostlist
2002-11-17 22:43 Ming Zhang
@ 2002-11-17 22:57 ` Christoph Hellwig
0 siblings, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2002-11-17 22:57 UTC (permalink / raw)
To: Ming Zhang; +Cc: linux-scsi@vger.kernel.org
On Sun, Nov 17, 2002 at 05:43:38PM -0500, Ming Zhang wrote:
> >Why you just do this in userspace?
> >
> that iscsi target have to be a kernel module.
why?
> >Umm, no. Nothing but upperlayer drivers is supposed to talk to the scsi
> >midlayer directly. Implement an upperlayer driver and check for disks in
> >->attach instead.
> ~~~would u like to explain this in more detail? which ->attach?
The attach routine of the upper layer driver. See struct
Scsi_Device_Template in hosts.h or look at one of the existing upper
layer drivers (like sd or sr)
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2002-11-17 22:57 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-11-17 22:11 about scsi_hostlist Ming Zhang
2002-11-17 22:30 ` Doug Ledford
2002-11-17 22:35 ` Christoph Hellwig
-- strict thread matches above, loose matches on Subject: below --
2002-11-17 22:35 Ming Zhang
2002-11-17 22:41 ` Christoph Hellwig
2002-11-17 22:43 Ming Zhang
2002-11-17 22:57 ` Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox