UBI: Fastmap: Locking updates
a) Rename ubi->fm_sem to ubi->fm_eba_sem as this semaphore protects EBA changes. b) Turn ubi->fm_mutex into a rw semaphore. It will still serialize fastmap writes but also ensures that ubi_wl_put_peb() is not interrupted by a fastmap write. We use a rw semaphore to allow ubi_wl_put_peb() still to be executed in parallel if no fastmap write is happening. Signed-off-by: Richard Weinberger <richard@nod.at>
This commit is contained in:
@@ -969,8 +969,8 @@ int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num,
|
||||
mutex_init(&ubi->ckvol_mutex);
|
||||
mutex_init(&ubi->device_mutex);
|
||||
spin_lock_init(&ubi->volumes_lock);
|
||||
mutex_init(&ubi->fm_mutex);
|
||||
init_rwsem(&ubi->fm_sem);
|
||||
init_rwsem(&ubi->fm_protect);
|
||||
init_rwsem(&ubi->fm_eba_sem);
|
||||
|
||||
ubi_msg(ubi, "attaching mtd%d", mtd->index);
|
||||
|
||||
|
Reference in New Issue
Block a user