public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* Question on "embedded" classes
@ 2005-06-27 23:19 Luben Tuikov
  2005-06-27 23:29 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Luben Tuikov @ 2005-06-27 23:19 UTC (permalink / raw)
  To: SCSI Mailing List, Linux Kernel Mailing List, Greg KH

Hi,

I was wondering what the reason was for allowing
class and classdev to only be at level 3 and level
4 respectively of sysfs (/ is level 0)?

1) Some devices would not have any relevance
ouside the scope of the "parent" device.
2) "Hooking" them all at /sys/class/ level
would create quite a lot of symlinks (and with
cryptic names in order to reference the proper
"parent" device in the same directory).

E.g. Some devices, like SAS host adapters, have "devices
inside devices" and I'd like to represent this in
sysfs.

/sys/class/sas          (a class)
/sys/class/sas/ha0/     (a classdev)
/sys/class/sas/ha1/     (a classdev)

/sys/class/sas/ha0/device -> symlink to PCI device
/sys/class/sas/ha0/device_name    (text attribute)

/sys/class/sas/ha0/phys/     (a class)
/sys/class/sas/ha0/phys/0/   (a classdev)

etc.

Question: how does one "marry" the class to the classdev?

Or what is the alternative?

Thanks,
	Luben

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

* Re: Question on "embedded" classes
  2005-06-27 23:19 Question on "embedded" classes Luben Tuikov
@ 2005-06-27 23:29 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2005-06-27 23:29 UTC (permalink / raw)
  To: Luben Tuikov; +Cc: SCSI Mailing List, Linux Kernel Mailing List

On Mon, Jun 27, 2005 at 07:19:22PM -0400, Luben Tuikov wrote:
> Hi,
> 
> I was wondering what the reason was for allowing
> class and classdev to only be at level 3 and level
> 4 respectively of sysfs (/ is level 0)?
> 
> 1) Some devices would not have any relevance
> ouside the scope of the "parent" device.
> 2) "Hooking" them all at /sys/class/ level
> would create quite a lot of symlinks (and with
> cryptic names in order to reference the proper
> "parent" device in the same directory).
> 
> E.g. Some devices, like SAS host adapters, have "devices
> inside devices" and I'd like to represent this in
> sysfs.
> 
> /sys/class/sas          (a class)
> /sys/class/sas/ha0/     (a classdev)
> /sys/class/sas/ha1/     (a classdev)
> 
> /sys/class/sas/ha0/device -> symlink to PCI device
> /sys/class/sas/ha0/device_name    (text attribute)
> 
> /sys/class/sas/ha0/phys/     (a class)
> /sys/class/sas/ha0/phys/0/   (a classdev)

Nope, this is not allowed.

Classes are not allowed to have children classes.
class devices can not have children, be they class_device or a class.

That is the reason you are getting oopses :)

thanks,

greg k-h

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

end of thread, other threads:[~2005-06-27 23:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-27 23:19 Question on "embedded" classes Luben Tuikov
2005-06-27 23:29 ` Greg KH

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