summaryrefslogtreecommitdiffstats
path: root/common/block.c
Commit message (Collapse)AuthorAgeFilesLines
* block: Add flush callbackSascha Hauer2014-07-141-0/+3
| | | | | | | Some block devices need an explicit callback for flushing written blocks. Add this callback. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* block: Collect block devices on listSascha Hauer2013-09-301-0/+5
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* block: shortcut writebuffer_flush if writing is disabledSascha Hauer2013-07-221-0/+3
| | | | | | Saves a few bytes of binary space. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* block: implement block_read/block_write functionsSascha Hauer2013-05-311-0/+22
| | | | | | | | | 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: rename file operation functionsSascha Hauer2013-05-311-8/+8
| | | | | | | 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>
* Treewide: remove address of the Free Software FoundationSascha Hauer2012-09-171-3/+0
| | | | | | | 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>
* Merge branch 'for-next/dma-cache-align'Sascha Hauer2012-07-021-3/+4
|\
| * block: use dma_alloc to allocate buffersSascha Hauer2012-06-301-3/+4
| | | | | | | | | | | | | | Drivers may use dma to transfer blocks, so put them into dma save memory. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | make cdev 64bit capableSascha Hauer2012-06-301-1/+1
| | | | | | | | | | | | Next step to 64bit support: Make cdev size a 64bit type. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | use loff_t for file offsetsSascha Hauer2012-06-301-2/+2
|/ | | | | | | This is a first step for 64bit file support: Make the file sizes/offsets 64bit. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* block: Fix printf warningAlexander Shiyan2012-05-311-1/+1
| | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* block: do not BUG() on failed block_getSascha Hauer2012-05-301-1/+1
| | | | | | | 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>
* block: propagate error code from block_getSascha Hauer2012-05-301-13/+13
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* block: reimplement cachingSascha Hauer2012-02-151-73/+201
| | | | | | | | | | | 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>
* add block supportSascha Hauer2011-04-111-0/+263
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>