[parisc-linux] RFC: I/O tree design
Matthew Wilcox
matthew@wil.cx
Sat, 3 Feb 2001 17:57:51 +0000
On Sat, Feb 03, 2001 at 12:17:52AM -0700, Ryan Bradetich wrote:
> Currently all the "discovered" I/O devices are stored in a
> fixed size array which contains up to 64 devices. This fixed
> size array has already been established and is known to work,
> so this proposal does not attempt to replace the fixed size
> array, but instead uses indexes within the struct hp_device
> to create the logical I/O tree.
I think you need to be braver. Kill the fixed size array. kmalloc each
struct and use pointers to reference between them. If you want, you
can use the doubly-linked-list macros in <linux/list.h>, but i suspect
self-managed singly-linked-lists will be more appropriate for this.
After all, it's not like the tree gets modified on a regular basis.
> Child: This index is only set to a valid node if the
> current node is the Central bus, a Bus Converter, or
> a Bus adapter. When this index is set to a valid node,
> it points to the head of the sibling list containing all
> valid nodes for the given bus.
One advantage of doing this is that `Child' could be a pointer to a
PCI bus.
> This proposal also calls for a special "root" node at
And you don't ned a root node, just siblings.
--
Revolutions do not require corporate support.