|
@ -48,6 +48,7 @@ |
|
|
|
|
|
|
|
|
#include "ubi.h" |
|
|
#include "ubi.h" |
|
|
|
|
|
|
|
|
|
|
|
#include <mtdfile.h> |
|
|
#ifdef CONFIG_MTD_UBI_DEBUG_PARANOID |
|
|
#ifdef CONFIG_MTD_UBI_DEBUG_PARANOID |
|
|
static int paranoid_check_si(struct ubi_device *ubi, struct ubi_scan_info *si); |
|
|
static int paranoid_check_si(struct ubi_device *ubi, struct ubi_scan_info *si); |
|
|
#else |
|
|
#else |
|
@ -912,12 +913,14 @@ struct ubi_scan_info *ubi_scan(struct ubi_device *ubi) |
|
|
{ |
|
|
{ |
|
|
// puts("ubi_scan!!");
|
|
|
// puts("ubi_scan!!");
|
|
|
// printf("mtd=%p,mtd->priv=%p\n",ubi->mtd,ubi->mtd->priv);
|
|
|
// printf("mtd=%p,mtd->priv=%p\n",ubi->mtd,ubi->mtd->priv);
|
|
|
int err, pnum; |
|
|
int err, pnum,i,num; |
|
|
struct rb_node *rb1, *rb2; |
|
|
struct rb_node *rb1, *rb2; |
|
|
struct ubi_scan_volume *sv; |
|
|
struct ubi_scan_volume *sv; |
|
|
struct ubi_scan_leb *seb; |
|
|
struct ubi_scan_leb *seb; |
|
|
struct ubi_scan_info *si; |
|
|
struct ubi_scan_info *si; |
|
|
|
|
|
int mtdx_offset; |
|
|
|
|
|
int mtdx_size; |
|
|
|
|
|
mtdfile *priv; |
|
|
si = kzalloc(sizeof(struct ubi_scan_info), GFP_KERNEL); |
|
|
si = kzalloc(sizeof(struct ubi_scan_info), GFP_KERNEL); |
|
|
if (!si) |
|
|
if (!si) |
|
|
return ERR_PTR(-ENOMEM); |
|
|
return ERR_PTR(-ENOMEM); |
|
@ -938,7 +941,12 @@ struct ubi_scan_info *ubi_scan(struct ubi_device *ubi) |
|
|
if (!vidh) |
|
|
if (!vidh) |
|
|
goto out_ech; |
|
|
goto out_ech; |
|
|
|
|
|
|
|
|
for (pnum = 0; pnum < ubi->peb_count; pnum++) { |
|
|
priv = (mtdfile *)(ubi->mtd->part); |
|
|
|
|
|
mtdx_offset = priv->part_offset; |
|
|
|
|
|
mtdx_size = priv->part_size_real; |
|
|
|
|
|
pnum = mtdx_offset/ubi->mtd->erasesize; |
|
|
|
|
|
num = mtdx_size /ubi->mtd->erasesize; |
|
|
|
|
|
for (i=0; i < num; i++,pnum++) { |
|
|
// puts("before con_resched!!");
|
|
|
// puts("before con_resched!!");
|
|
|
cond_resched(); |
|
|
cond_resched(); |
|
|
// puts("after con_resched!!");
|
|
|
// puts("after con_resched!!");
|
|
|