From cae0a77125467c42f0918e78457913ee4a2f925b Mon Sep 17 00:00:00 2001 From: Artem Bityutskiy Date: Mon, 17 Dec 2007 12:46:48 +0200 Subject: UBI: tweak volumes locking Transform vtbl_mutex to volumes_mutex - this just makes code easier to understand. Signed-off-by: Artem Bityutskiy --- drivers/mtd/ubi/kapi.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'drivers/mtd/ubi/kapi.c') diff --git a/drivers/mtd/ubi/kapi.c b/drivers/mtd/ubi/kapi.c index c2fafe6fb2da..8e15002a36c3 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: -- cgit v1.2.3