summaryrefslogtreecommitdiffstats
path: root/include/block.h
Commit message (Collapse)AuthorAgeFilesLines
* block: use 64-bit types for sector offset and count on all platformsAhmad Fatoum2021-02-181-7/+8
| | | | | | | | | | | barebox' use of int for the sector offset puts an upper bound of 1TB on the size of supported block devices, which is already exceeded by common place USB mass storage. Increasing the sizes involved to 64 bit like Linux does won't magically add missing driver support, but it gives us at least a fighting chance. Do so. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/block'Sascha Hauer2020-03-181-0/+3
|\
| * block: Implement discard_rangeSascha Hauer2020-02-141-0/+3
| | | | | | | | | | | | | | | | This implements the discard_range hook. When a range of data is discarded then we do not have to read it from the device and can pass a zeroed buffer instead. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | include: add SPDX GPL-2.0-only license tags for files without licensing ↵Roland Hieber2020-02-171-0/+1
|/ | | | | | | | | | | information According to our /README, GPL-2.0-only applies for the whole project except noted otherwise. Signed-off-by: Roland Hieber <rohieb@rohieb.name> Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* block: Add flush callbackSascha Hauer2014-07-141-0/+1
| | | | | | | 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/+6
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* block: implement block_read/block_write functionsSascha Hauer2013-05-311-0/+8
| | | | | | | | | 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: remove unused read_start and read_done opsSascha Hauer2013-05-311-2/+0
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* block: reimplement cachingSascha Hauer2012-02-151-7/+9
| | | | | | | | | | | 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/+32
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>