Re: sysfs abuse in recent i2o changes

From: Greg KH
Date: Tue Jun 28 2005 - 11:22:26 EST


On Tue, Jun 28, 2005 at 05:02:41PM +0200, Markus Lidel wrote:
> I know, but i hopefully also have a good reason to do so... First, the
> attributes provided through these functions are for accessing the
> firmware... The controller has a little limitation, it could only handle
> 64 blocks, but sysfs only have 4k...
>
> Now there are two options:
>
> 1) when writing: read a 64k block, merge it with the 4k block and write
> it back, when reading: read a 64k block and only return the needed 4k block.
>
> 2) extend the sysfs attribute to allow 64k blocks
>
> IMHO the first is not a very good solution, because for a 64k block it
> has to be written 16 times...
>
> Of course if someone finds a better solution i would be glad to hear
> about it...

Use the binary file interface of sysfs, which was written exactly for
this kind of thing. :)

thanks,

greg k-h
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/