[PATCH 0/5] powerpc: add device tree property updates
Arnd Bergmann
arnd at arndb.de
Thu Jan 19 10:31:05 EST 2006
Am Wednesday 18 January 2006 23:56 schrieb Benjamin Herrenschmidt:
> I think we don't need such an API if we _really_ create them on the fly
> and do dynamic allocation, which the patch doesn't do but we should. One
> of the main reason for doing a filesytem is to avoid having a static
> allocation of filesystem object for everything in the device-tree.
>
> Once we have dynamic allocation, all we need is to invalidate directories
> when files are added/removed. Thus a simpler API
Objects that are dynamically allocated should not be cached in the first
place, so no need to invalidate them.
If only properties are dynamically allocated and device nodes (directories)
are stable, the device node add/remove operation should be identical
to the directory create/delete operation.
> > Ok so what should the inode number be ?
>
> I was thinking about the phandle, but that would require creating
> phandles for nodes who don't have them (BootX booting or flat tree with
> only some nodes having phandles). The advantage is that it's stable
> accross boots. The cons is that the creation of missing phandles is a
> bit annoying as it needs to make sure it "skips" whatever phandles have
> already been assigned.
>
> > directory inodes should be the phandle .... yeah .. now to assign all
> > the others non-conflicting. Do all the current phandle generators
> > use either a memory address, offset, or small enum?
>
> Or we could just use the pointer to struct device_node for now. That
> means they become volatile between mounts reboots but that's fine. At
> least at first. We can then look into the problem of maybe using
> phandles.
I think that won't work because 32 bit user space has 32 bit inode numbers,
truncating a pointer (or a 64 bit phandle, if we ever get one) means that
it is no longer unique.
Arnd <><
More information about the Linuxppc64-dev
mailing list