Some drivers use blk->ops->read/write. This bypasses the caching block
layer and was never intended like this. The upper API to the block layer
is the cdev layer. This patch adds block_read and block_write functions
and uses them where appropriate.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
block_read and block_write collide with a to-be-introduced
global function, so rename the file operation functions.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The FSF address has changed in the past. Instead of updating it
each time the address changes, just drop it completely treewide.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
It does not necessarily means a bug when block_get fails here,
this can also be a failure on the underlying device.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The current caching layer only has a single buffer for
writing and reading. The FAT driver often accesses the
fat and then data again, which currently can't be cached.
Reimplement this with a list of cached chunks. The number
of chunks and their sizes are currently hardcoded, but
that could be easily made configurable.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This adds a simple block layer to barebox. Reading and writing
to block devices can be painfully slow without caching, so
add a simple caching layer here.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>