Re: [PATCH 7/8] ppc64: SPU file system

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <><
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux