From 762dc78bdea3468e8cd35c01f91def13974948f1 Mon Sep 17 00:00:00 2001 From: Tobias Waldekranz Date: Thu, 16 Feb 2023 16:33:51 +0100 Subject: blk: blkmap: Add linear device mapping support Allow a slice of an existing block device to be mapped to a blkmap. This means that filesystems that are not stored at exact partition boundaries can be accessed by remapping a slice of the existing device to a blkmap device. Signed-off-by: Tobias Waldekranz Reviewed-by: Simon Glass --- include/blkmap.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include') diff --git a/include/blkmap.h b/include/blkmap.h index 74baeb19f81..af54583c7dd 100644 --- a/include/blkmap.h +++ b/include/blkmap.h @@ -7,6 +7,19 @@ #ifndef _BLKMAP_H #define _BLKMAP_H +/** + * blkmap_map_linear() - Map region of other block device + * + * @dev: Blkmap to create the mapping on + * @blknr: Start block number of the mapping + * @blkcnt: Number of blocks to map + * @lblk: The target block device of the mapping + * @lblknr: The start block number of the target device + * Returns: 0 on success, negative error code on failure + */ +int blkmap_map_linear(struct udevice *dev, lbaint_t blknr, lbaint_t blkcnt, + struct udevice *lblk, lbaint_t lblknr); + /** * blkmap_map_mem() - Map region of memory * -- cgit v1.3.1