aboutsummaryrefslogtreecommitdiff
path: root/drivers/mtd/ubi/kapi.c
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2007-12-17 12:46:48 +0200
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2007-12-26 19:15:15 +0200
commitcae0a77125467c42f0918e78457913ee4a2f925b (patch)
tree92ce552bb67d6e0d44e1144e08260ea0bbcee80a /drivers/mtd/ubi/kapi.c
parent89b96b69290668351a33b09372ec1c94cb5748e5 (diff)
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>
Diffstat (limited to 'drivers/mtd/ubi/kapi.c')
-rw-r--r--drivers/mtd/ubi/kapi.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/mtd/ubi/kapi.c b/drivers/mtd/ubi/kapi.c
index c2fafe6fb2d..8e15002a36c 100644
--- a/drivers/mtd/ubi/kapi.c
+++ b/drivers/mtd/ubi/kapi.c
@@ -162,15 +162,16 @@ struct ubi_volume_desc *ubi_open_volume(int ubi_num, int vol_id, int mode)
desc->mode = mode;
/*
- * To prevent simultaneous checks of the same volume we use @vtbl_mutex,
- * although it is not the purpose it was introduced for.
+ * To prevent simultaneous checks of the same volume we use
+ * @volumes_mutex, although it is not the purpose it was introduced
+ * for.
*/
- mutex_lock(&ubi->vtbl_mutex);
+ mutex_lock(&ubi->volumes_mutex);
if (!vol->checked) {
/* This is the first open - check the volume */
err = ubi_check_volume(ubi, vol_id);
if (err < 0) {
- mutex_unlock(&ubi->vtbl_mutex);
+ mutex_unlock(&ubi->volumes_mutex);
ubi_close_volume(desc);
return ERR_PTR(err);
}
@@ -181,7 +182,7 @@ struct ubi_volume_desc *ubi_open_volume(int ubi_num, int vol_id, int mode)
}
vol->checked = 1;
}
- mutex_unlock(&ubi->vtbl_mutex);
+ mutex_unlock(&ubi->volumes_mutex);
return desc;
out_unlock: