From 4ba692fb1e413db974037238370b8402c8a60750 Mon Sep 17 00:00:00 2001 From: Ben Gardiner Date: Tue, 31 Aug 2010 17:48:01 -0400 Subject: mtd: add an mtd method for get_len_incl_bad() The logic to 'spread' mtd partitions needs to calculate the length in the mtd device, including bad blocks. This patch introduces a new function, mtd_get_len_incl_bad that can return both the length including bad blocks and whether that length was truncated on the device. This new function will be used by the mtdparts spread command later in this series. The definition of the function is #ifdef'd out in configurations that do not use the new 'mtdparts spread' command. Signed-off-by: Ben Gardiner CC: Scott Wood --- include/linux/mtd/mtd.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include/linux/mtd/mtd.h') diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index f1cdf23aa01..3b18d7d6886 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h @@ -255,7 +255,9 @@ extern struct mtd_info *get_mtd_device(struct mtd_info *mtd, int num); extern struct mtd_info *get_mtd_device_nm(const char *name); extern void put_mtd_device(struct mtd_info *mtd); - +extern void mtd_get_len_incl_bad(struct mtd_info *mtd, uint64_t offset, + const uint64_t length, uint64_t *len_incl_bad, + int *truncated); /* XXX U-BOOT XXX */ #if 0 struct mtd_notifier { -- cgit v1.2.3