All of lore.kernel.org
 help / color / mirror / Atom feed
* RE: Flaw in the driver-model implementation of attributes
@ 2003-06-18  7:48 Perez-Gonzalez, Inaky
  2003-06-18  8:12 ` viro
  0 siblings, 1 reply; 59+ messages in thread
From: Perez-Gonzalez, Inaky @ 2003-06-18  7:48 UTC (permalink / raw)
  To: 'viro@parcelfarce.linux.theplanet.co.uk',
	Perez-Gonzalez, Inaky
  Cc: 'Kevin P. Fleming', 'Alan Stern',
	'Patrick Mochel', 'Russell King',
	'Greg KH', 'linux-kernel@vger.kernel.org'

> From: viro@parcelfarce.linux.theplanet.co.uk
> On Tue, Jun 17, 2003 at 08:44:50PM -0700, Perez-Gonzalez, Inaky wrote:
> 
> > Maybe this is going to kill my argument as an analogy, but think
> > about a C++ class hierarchy, where belonging to a class means
> > ...
> 
> But there is no inheritance here.  Block device and IDE disk are
> different objects and relation is not "A is B with <...>", it's
> "among other things, A happens to use B in a way <...>".

Well, the device is an IDE disk that is linked through an IDE 
controller that is linked through a PCI controller to the system bus. 

That IDE device presents an interface. The block layer just presents 
the common interface that all block devices present (and that IDE
and SCSI disks are able to provide) - there is no inheritance, but
the concept is the same.
 
> Moreover, there is no such thing as "physical device 
> of that block device". There might be many.  There 
> might be none.  IOW, we have a bunch of constructors 
> for class "block device" and some of them happen to have
> some kinds of physical devices among their arguments. 

[I happen not to know the block layer as well as you and many others 
do, so please correct me where I am wrong ...]

So what? _every_ block device will have some form of physical 
back-up that can be linked back into sysfs.

In cases like this, doesn't it make sense to have some 
/sys/devices/SOMETHING/ hierarchy for those  "logical" or "virtual" 
devices that back-up those block devices? 

You could even say that RAID and ramdisks -as used in the example 
above- would belong to /sys/devices/"virtual"/raid/ and 
...../ramdisks/; after all, you have to create those devices before
being able to attach them (last time I checked):

(using subdirs for each layer for clarity)

/sys/devices/"virtual"/raid/0
  attr1
  attr2     ...   sysfs specific attrs 
  block/    ... block layer specific attrs
    attr1
    attr2
    component1 -> /sys/devices/pci/FOO/block/part1  
    component1 -> /sys/devices/pci/BAR/block/part4  

(I would also love to see the block device node being dropped in 
the corresponding "block" directory, but that's another story).

And extrapolating even more, I'd expect to see something 
like this for the block devices that are part of a physical device 
(partitions, I mean):

/sys/blabla/pci/3.14159/ide0/0.0
  attr1
  attr2     ...   sysfs specific attrs 
  block/    ... block layer specific attrs
    attr1
    attr2  
    part0/  ... partition specific stuff
      attr1
      attr...
    part1/
      attr1
      attr2 ...
  ide/      ... ide layer specific attrs
    attr1
    attr2 

In the tree structure it makes sense, because each block
device, at the end is or a partition (and thus is embedded
in a "true" block device) or a true block device on a 1:1
relationship with a physical device.

Iñaky Pérez-González -- Not speaking for Intel -- all opinions are my own
(and my fault)

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

end of thread, other threads:[~2003-12-11 15:14 UTC | newest]

Thread overview: 59+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-18  7:48 Flaw in the driver-model implementation of attributes Perez-Gonzalez, Inaky
2003-06-18  8:12 ` viro
2003-06-18 14:32   ` Alan Stern
2003-06-18 17:15     ` Greg KH
2003-06-18 19:50       ` Alan Stern
2003-06-19 16:42         ` Patrick Mochel
2003-06-19 21:18           ` Alan Stern
2003-06-19 14:13       ` Alan Stern
2003-06-19 17:07         ` Patrick Mochel
2003-06-19 21:14           ` Alan Stern
2003-06-19 21:31             ` Greg KH
2003-06-20 14:22               ` Alan Stern
2003-06-20 18:32                 ` Greg KH
2003-07-02 22:12                   ` Greg KH
2003-07-03 14:51                     ` Alan Stern
2003-06-20 20:05               ` Host drivers and conversion of SCSI to the driver model Alan Stern
2003-06-20 21:07                 ` Mike Anderson
2003-06-23 14:57                   ` Alan Stern
2003-06-27 10:03                     ` Christoph Hellwig
2003-06-27 17:56                       ` Alan Stern
2003-06-27 18:04                         ` Christoph Hellwig
2003-06-27 19:23                           ` Mike Anderson
2003-06-28  8:34                             ` Christoph Hellwig
2003-06-28 15:08                               ` Jeff Garzik
2003-06-28 15:12                                 ` Christoph Hellwig
2003-07-03 15:15                       ` Alan Stern
2003-07-06 16:04                         ` Christoph Hellwig
2003-07-03 21:02                       ` scsi_forget_host() and scsi_remove_device() Alan Stern
2003-07-03 22:19                         ` Mike Anderson
2003-07-04 14:16                           ` Alan Stern
2003-07-04 19:36                           ` Alan Stern
2003-07-04 19:54                             ` Matthew Dharm
2003-07-05 14:11                               ` Alan Stern
2003-07-05 16:25                                 ` Matthew Dharm
2003-07-06 16:13                           ` Christoph Hellwig
2003-07-07 15:19                           ` PATCH: (as54) Fix hot-unplugging for sr.c Alan Stern
2003-07-08 22:29                             ` Mike Anderson
2003-07-09 14:04                               ` Alan Stern
2003-07-09 14:44                                 ` Mike Anderson
2003-07-09 16:02                                   ` Alan Stern
2003-07-31 19:38                                   ` PATCH: (as33e) Fix removal of /proc/scsi/hostdir on hot-unplug Alan Stern
2003-08-01 20:03                                     ` Mike Anderson
2003-08-15 20:05                                   ` PATCH: (as84) Fix my earlier scsi procdir patch Alan Stern
2003-09-16 14:50                                   ` PATCH: (as84) Small fixup for SCSI proc code Alan Stern
2003-10-16 21:09                                   ` Race in removal of host class device attribute file Alan Stern
2003-10-16 22:47                                     ` Mike Anderson
2003-10-17 12:18                                       ` Alan Stern
2003-10-17 12:30                                     ` Christoph Hellwig
2003-12-10 15:02                                   ` Suggestion for aiding debugging of host removal Alan Stern
2003-12-10 15:14                                     ` Christoph Hellwig
2003-12-11  4:16                                       ` DMA Timeout with Promise S150TX4 and 2.6.0-test11-bk8 Paul
2003-12-11  7:48                                       ` Suggestion for aiding debugging of host removal Mike Anderson
2003-12-11 11:39                                         ` Christoph Hellwig
2003-12-11 15:14                                         ` Alan Stern
2003-07-06 16:11                         ` scsi_forget_host() and scsi_remove_device() Christoph Hellwig
2003-07-07 16:06                           ` Alan Stern
2003-07-03 20:20                   ` SCSI documentation in scsi_mid_low_api.txt Alan Stern
2003-07-03 20:42                     ` aic7xxx driver schedules() while holding spinlock Tony Battersby
2003-06-19 17:26         ` Flaw in the driver-model implementation of attributes Mike Anderson

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.