UBI: tweak volumes locking
Transform vtbl_mutex to volumes_mutex - this just makes code easier to understand. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
This commit is contained in:
@@ -67,7 +67,9 @@ static int set_update_marker(struct ubi_device *ubi, int vol_id)
|
||||
memcpy(&vtbl_rec, &ubi->vtbl[vol_id], sizeof(struct ubi_vtbl_record));
|
||||
vtbl_rec.upd_marker = 1;
|
||||
|
||||
mutex_lock(&ubi->volumes_mutex);
|
||||
err = ubi_change_vtbl_record(ubi, vol_id, &vtbl_rec);
|
||||
mutex_unlock(&ubi->volumes_mutex);
|
||||
vol->upd_marker = 1;
|
||||
return err;
|
||||
}
|
||||
@@ -106,7 +108,9 @@ static int clear_update_marker(struct ubi_device *ubi, int vol_id, long long byt
|
||||
vol->last_eb_bytes = vol->usable_leb_size;
|
||||
}
|
||||
|
||||
mutex_lock(&ubi->volumes_mutex);
|
||||
err = ubi_change_vtbl_record(ubi, vol_id, &vtbl_rec);
|
||||
mutex_unlock(&ubi->volumes_mutex);
|
||||
vol->upd_marker = 0;
|
||||
return err;
|
||||
}
|
||||
|
Reference in New Issue
Block a user