[PATCH 7/8] ppc64: SPU file system
Arnd Bergmann
arnd at arndb.de
Sun May 15 22:33:09 EST 2005
On Sünndag 15 Mai 2005 14:02, Benjamin Herrenschmidt wrote:
>
> > That's even more evil than ioctl()... Try doing 32-vs-64bit conversion
> > on write...
>
> I don't see the problem ... if you are passing a structure, you have to
> convert it anyway, and it's bad practice. I was thinking about passing
> ascii so it can be controlled by shell scripts.
Parsing multi-value ascii data is error prone. in kernel space, I would
not want to do anything more complex than a simple_strtoul(), if only
for the reason of not giving bad examples.
When passing binary structures, there is a significant difference between
passing it through ioctl or read/write: We already have a rather complicated
method of detecting if whether and how to convert them (f_op->compat_ioctl,
hash lookup and the deprecated dynamic registration).
For read/write, there is no way to tell if you need to do the conversion,
even if the file operation is aware of the actual data layout of both
variants. Moreover, a good implementation of a read/write file operation
should be able to deal with resuming partial transfers.
Regarding the shell scripting possibility, I don't really see the point.
The only code that should actually use the kernel interfaces is something
like an /lib/ld-spu.so interpreter and that is better implemented in C
anyway because it needs to parse ELF structures and such.
Arnd <><
More information about the Linuxppc64-dev
mailing list