diff options
Diffstat (limited to 'drivers/mtd/ubi/ubi.h')
-rw-r--r-- | drivers/mtd/ubi/ubi.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/mtd/ubi/ubi.h b/drivers/mtd/ubi/ubi.h index f782d5aa849a..ea9a6990a4dc 100644 --- a/drivers/mtd/ubi/ubi.h +++ b/drivers/mtd/ubi/ubi.h | |||
@@ -275,13 +275,13 @@ struct ubi_wl_entry; | |||
275 | * @wl_lock: protects the @used, @free, @prot, @lookuptbl, @abs_ec, @move_from, | 275 | * @wl_lock: protects the @used, @free, @prot, @lookuptbl, @abs_ec, @move_from, |
276 | * @move_to, @move_to_put @erase_pending, @wl_scheduled, and @works | 276 | * @move_to, @move_to_put @erase_pending, @wl_scheduled, and @works |
277 | * fields | 277 | * fields |
278 | * @move_mutex: serializes eraseblock moves | ||
278 | * @wl_scheduled: non-zero if the wear-leveling was scheduled | 279 | * @wl_scheduled: non-zero if the wear-leveling was scheduled |
279 | * @lookuptbl: a table to quickly find a &struct ubi_wl_entry object for any | 280 | * @lookuptbl: a table to quickly find a &struct ubi_wl_entry object for any |
280 | * physical eraseblock | 281 | * physical eraseblock |
281 | * @abs_ec: absolute erase counter | 282 | * @abs_ec: absolute erase counter |
282 | * @move_from: physical eraseblock from where the data is being moved | 283 | * @move_from: physical eraseblock from where the data is being moved |
283 | * @move_to: physical eraseblock where the data is being moved to | 284 | * @move_to: physical eraseblock where the data is being moved to |
284 | * @move_from_put: if the "from" PEB was put | ||
285 | * @move_to_put: if the "to" PEB was put | 285 | * @move_to_put: if the "to" PEB was put |
286 | * @works: list of pending works | 286 | * @works: list of pending works |
287 | * @works_count: count of pending works | 287 | * @works_count: count of pending works |
@@ -354,12 +354,12 @@ struct ubi_device { | |||
354 | struct rb_root aec; | 354 | struct rb_root aec; |
355 | } prot; | 355 | } prot; |
356 | spinlock_t wl_lock; | 356 | spinlock_t wl_lock; |
357 | struct mutex move_mutex; | ||
357 | int wl_scheduled; | 358 | int wl_scheduled; |
358 | struct ubi_wl_entry **lookuptbl; | 359 | struct ubi_wl_entry **lookuptbl; |
359 | unsigned long long abs_ec; | 360 | unsigned long long abs_ec; |
360 | struct ubi_wl_entry *move_from; | 361 | struct ubi_wl_entry *move_from; |
361 | struct ubi_wl_entry *move_to; | 362 | struct ubi_wl_entry *move_to; |
362 | int move_from_put; | ||
363 | int move_to_put; | 363 | int move_to_put; |
364 | struct list_head works; | 364 | struct list_head works; |
365 | int works_count; | 365 | int works_count; |
@@ -561,8 +561,10 @@ static inline int ubi_io_write_data(struct ubi_device *ubi, const void *buf, | |||
561 | */ | 561 | */ |
562 | static inline void ubi_ro_mode(struct ubi_device *ubi) | 562 | static inline void ubi_ro_mode(struct ubi_device *ubi) |
563 | { | 563 | { |
564 | ubi->ro_mode = 1; | 564 | if (!ubi->ro_mode) { |
565 | ubi_warn("switch to read-only mode"); | 565 | ubi->ro_mode = 1; |
566 | ubi_warn("switch to read-only mode"); | ||
567 | } | ||
566 | } | 568 | } |
567 | 569 | ||
568 | /** | 570 | /** |