UBI: Fastmap: Add new module parameter fm_debug
[deliverable/linux.git] / drivers / mtd / ubi / build.c
index e26fe12b1aae47a327feae54631f841e5a0ca2ad..9690cf9aaef557d922a9423b15db5e8761ccd993 100644 (file)
@@ -81,6 +81,7 @@ static struct mtd_dev_param __initdata mtd_dev_param[UBI_MAX_DEVICES];
 #ifdef CONFIG_MTD_UBI_FASTMAP
 /* UBI module parameter to enable fastmap automatically on non-fastmap images */
 static bool fm_autoconvert;
+static bool fm_debug;
 #endif
 /* Root UBI "class" object (corresponds to '/<sysfs>/class/ubi/') */
 struct class *ubi_class;
@@ -951,6 +952,8 @@ int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num,
 
        ubi->fm_wl_pool.max_size = ubi->fm_pool.max_size / 2;
        ubi->fm_disabled = !fm_autoconvert;
+       if (fm_debug)
+               ubi_enable_dbg_chk_fastmap(ubi);
 
        if (!ubi->fm_disabled && (int)mtd_div_by_eb(ubi->mtd->size, ubi->mtd)
            <= UBI_FM_MAX_START) {
@@ -1503,6 +1506,8 @@ MODULE_PARM_DESC(mtd, "MTD devices to attach. Parameter format: mtd=<name|num|pa
 #ifdef CONFIG_MTD_UBI_FASTMAP
 module_param(fm_autoconvert, bool, 0644);
 MODULE_PARM_DESC(fm_autoconvert, "Set this parameter to enable fastmap automatically on images without a fastmap.");
+module_param(fm_debug, bool, 0);
+MODULE_PARM_DESC(fm_debug, "Set this parameter to enable fastmap debugging by default. Warning, this will make fastmap slow!");
 #endif
 MODULE_VERSION(__stringify(UBI_VERSION));
 MODULE_DESCRIPTION("UBI - Unsorted Block Images");
This page took 0.025499 seconds and 5 git commands to generate.