summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd/Kconfig8
-rw-r--r--cmd/mtdparts.c6
2 files changed, 11 insertions, 3 deletions
diff --git a/cmd/Kconfig b/cmd/Kconfig
index c414c5d8e6..0eca0f74f7 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -1986,6 +1986,14 @@ config CMD_MTDPARTS_SPREAD
at least as large as the size specified in the mtdparts variable and
2) each partition starts on a good block.
+config CMD_MTDPARTS_SHOW_NET_SIZES
+ bool "Show net size (w/o bad blocks) of partitions"
+ depends on CMD_MTDPARTS
+ help
+ Adds two columns to the printed partition table showing the
+ effective usable size of a partition, if bad blocks are taken
+ into account.
+
config CMD_REISER
bool "reiser - Access to reiserfs filesystems"
help
diff --git a/cmd/mtdparts.c b/cmd/mtdparts.c
index 46155cabf6..b40c2afadd 100644
--- a/cmd/mtdparts.c
+++ b/cmd/mtdparts.c
@@ -1233,11 +1233,11 @@ static uint64_t net_part_size(struct mtd_info *mtd, struct part_info *part)
{
uint64_t i, net_size = 0;
- if (!mtd->block_isbad)
+ if (!mtd->_block_isbad)
return part->size;
for (i = 0; i < part->size; i += mtd->erasesize) {
- if (!mtd->block_isbad(mtd, part->offset + i))
+ if (!mtd->_block_isbad(mtd, part->offset + i))
net_size += mtd->erasesize;
}
@@ -1274,7 +1274,7 @@ static void print_partition_table(void)
part = list_entry(pentry, struct part_info, link);
net_size = net_part_size(mtd, part);
size_note = part->size == net_size ? " " : " (!)";
- printf("%2d: %-20s0x%08x\t0x%08x%s\t0x%08x\t%d\n",
+ printf("%2d: %-20s0x%08llx\t0x%08x%s\t0x%08llx\t%d\n",
part_num, part->name, part->size,
net_size, size_note, part->offset,
part->mask_flags);