public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* Re: Re: about scsi_hostlist
@ 2002-11-17 22:35 Ming Zhang
  2002-11-17 22:41 ` Christoph Hellwig
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Ming Zhang @ 2002-11-17 22:35 UTC (permalink / raw)
  To: Doug Ledford; +Cc: linux-scsi@vger.kernel.org

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. It need the scsi_device pointer in order to send requests to it. That is why I need it. Is there a formal way to find a scsi_device pointer by its lun, host id, ... or by block layer major number and minor number?

thx.



======= At 2002-11-17, 17:30:00 you wrote: =======

>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
>  
>
>.

= = = = = = = = = = = = = = = = = = = =
			

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] 8+ messages in thread
* Re: Re: about scsi_hostlist
@ 2002-11-17 22:43 Ming Zhang
  0 siblings, 0 replies; 8+ messages in thread
From: Ming Zhang @ 2002-11-17 22:43 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: 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?
>
that iscsi target have to be a kernel module.

>> 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.
~~~would u like to explain this in more detail? which ->attach?

thx

>
>.






^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: Re: about scsi_hostlist
@ 2002-11-17 23:03 Ming Zhang
  2002-11-17 23:48 ` Alan Cox
  0 siblings, 1 reply; 8+ messages in thread
From: Ming Zhang @ 2002-11-17 23:03 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: linux-scsi@vger.kernel.org




======= At 2002-11-17, 22:57:00 you wrote: =======

>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?
basically, an iscsi target tell clients how many scsi devices it has, then iscsi client login and get a reference from it. might be an id stand for a certain scsi device, for example, the lun. then client send request and target get this request, check which scsi device the request want to operate on, and call routine to finish it. since the main operations is tcp/ip send/recv and scsi read/write. I think write it as a kernel module is more suitable. and currently, all iscsi reference implementation on 2.4.x kernel are kernel modules.
>
>> >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)
thx, i will check that.
>
>-
>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
>
>.

= = = = = = = = = = = = = = = = = = = =
			





^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2002-11-18  5:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-11-17 22:35 Re: about scsi_hostlist Ming Zhang
2002-11-17 22:41 ` Christoph Hellwig
2002-11-17 22:58 ` Doug Ledford
2002-11-18  5:09 ` Oliver Xymoron
  -- strict thread matches above, loose matches on Subject: below --
2002-11-17 22:43 Ming Zhang
2002-11-17 23:03 Ming Zhang
2002-11-17 23:48 ` Alan Cox
2002-11-18  5:13   ` Oliver Xymoron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox