summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi/wl.c
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2009-05-23 16:04:17 +0300
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2009-06-02 13:53:35 +0300
commit90bf0265e5b0d561f215a69bb7a46c4071b2c93b (patch)
tree7b3b1cb2f394687b5e0f841031200e9c37faef92 /drivers/mtd/ubi/wl.c
parentddbd3b61708483f73dbcc62a94d16cc7db928cba (diff)
downloadop-kernel-dev-90bf0265e5b0d561f215a69bb7a46c4071b2c93b.zip
op-kernel-dev-90bf0265e5b0d561f215a69bb7a46c4071b2c93b.tar.gz
UBI: introduce new constants
This patch is a clean-up and a preparation for the following patches. It introduece constants for the return values of the 'ubi_eba_copy_leb()' function. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'drivers/mtd/ubi/wl.c')
-rw-r--r--drivers/mtd/ubi/wl.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/mtd/ubi/wl.c b/drivers/mtd/ubi/wl.c
index 891534f..ec915c0 100644
--- a/drivers/mtd/ubi/wl.c
+++ b/drivers/mtd/ubi/wl.c
@@ -756,15 +756,14 @@ static int wear_leveling_worker(struct ubi_device *ubi, struct ubi_work *wrk,
err = ubi_eba_copy_leb(ubi, e1->pnum, e2->pnum, vid_hdr);
if (err) {
- if (err == -EAGAIN)
- goto out_not_moved;
- if (err < 0)
- goto out_error;
- if (err == 2) {
- /* Target PEB write error, torture it */
+ if (err == MOVE_CANCEL_BITFLIPS ||
+ err == MOVE_TARGET_WR_ERR) {
+ /* Target PEB bit-flips or write error, torture it */
torture = 1;
goto out_not_moved;
}
+ if (err < 0)
+ goto out_error;
/*
* The LEB has not been moved because the volume is being
@@ -774,7 +773,7 @@ static int wear_leveling_worker(struct ubi_device *ubi, struct ubi_work *wrk,
*/
dbg_wl("canceled moving PEB %d", e1->pnum);
- ubi_assert(err == 1);
+ ubi_assert(err == MOVE_CANCEL_RACE);
ubi_free_vid_hdr(ubi, vid_hdr);
vid_hdr = NULL;
OpenPOWER on IntegriCloud