diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2009-06-08 09:52:48 -0400 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2009-06-09 11:49:51 -0400 |
commit | 52b605d107de72c1d3385a3df972e79fb5befa4c (patch) | |
tree | e511dbfe27c2689f68c85bb40aa62e59f59bfefb /drivers | |
parent | 9c259a52fa6ab46841a6094434cd0d752e854180 (diff) |
UBI: print amount of reserved PEBs
When marking a PEB as bad, print how many PEBs are left reserved.
This is very useful information.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mtd/ubi/wl.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/mtd/ubi/wl.c b/drivers/mtd/ubi/wl.c index 784681e42360..f25ae2910ad0 100644 --- a/drivers/mtd/ubi/wl.c +++ b/drivers/mtd/ubi/wl.c | |||
@@ -1072,10 +1072,9 @@ static int erase_worker(struct ubi_device *ubi, struct ubi_work *wl_wrk, | |||
1072 | ubi_err("no reserved physical eraseblocks"); | 1072 | ubi_err("no reserved physical eraseblocks"); |
1073 | goto out_ro; | 1073 | goto out_ro; |
1074 | } | 1074 | } |
1075 | |||
1076 | spin_unlock(&ubi->volumes_lock); | 1075 | spin_unlock(&ubi->volumes_lock); |
1077 | ubi_msg("mark PEB %d as bad", pnum); | ||
1078 | 1076 | ||
1077 | ubi_msg("mark PEB %d as bad", pnum); | ||
1079 | err = ubi_io_mark_bad(ubi, pnum); | 1078 | err = ubi_io_mark_bad(ubi, pnum); |
1080 | if (err) | 1079 | if (err) |
1081 | goto out_ro; | 1080 | goto out_ro; |
@@ -1085,7 +1084,9 @@ static int erase_worker(struct ubi_device *ubi, struct ubi_work *wl_wrk, | |||
1085 | ubi->bad_peb_count += 1; | 1084 | ubi->bad_peb_count += 1; |
1086 | ubi->good_peb_count -= 1; | 1085 | ubi->good_peb_count -= 1; |
1087 | ubi_calculate_reserved(ubi); | 1086 | ubi_calculate_reserved(ubi); |
1088 | if (ubi->beb_rsvd_pebs == 0) | 1087 | if (ubi->beb_rsvd_pebs) |
1088 | ubi_msg("%d PEBs left in the reserve", ubi->beb_rsvd_pebs); | ||
1089 | else | ||
1089 | ubi_warn("last PEB from the reserved pool was used"); | 1090 | ubi_warn("last PEB from the reserved pool was used"); |
1090 | spin_unlock(&ubi->volumes_lock); | 1091 | spin_unlock(&ubi->volumes_lock); |
1091 | 1092 | ||