aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi/cdev.c
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2009-05-07 04:25:54 -0400
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2009-05-18 05:26:41 -0400
commit383d08e045faddd89797959786233d4c0e1ace80 (patch)
tree3f7456e3aea9b69fe18920791cf06bda6497a64f /drivers/mtd/ubi/cdev.c
parent1406de8e11eb043681297adf86d6892ff8efc27a (diff)
UBI: remove redundant mutex
The @mult_mutex does not serve any purpose. We already have @volumes_mutex and it is enough. The @volume mutex is pushed down to the 'ubi_rename_volumes()', because we want first to open all volumes in the exclusive mode, and then lock the mutex, just like all other ioctl's (remove, re-size, etc) do. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'drivers/mtd/ubi/cdev.c')
-rw-r--r--drivers/mtd/ubi/cdev.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/mtd/ubi/cdev.c b/drivers/mtd/ubi/cdev.c
index f8e0f68f2186..8087b0462771 100644
--- a/drivers/mtd/ubi/cdev.c
+++ b/drivers/mtd/ubi/cdev.c
@@ -810,9 +810,7 @@ static int rename_volumes(struct ubi_device *ubi,
810 re->desc->vol->vol_id, re->desc->vol->name); 810 re->desc->vol->vol_id, re->desc->vol->name);
811 } 811 }
812 812
813 mutex_lock(&ubi->volumes_mutex);
814 err = ubi_rename_volumes(ubi, &rename_list); 813 err = ubi_rename_volumes(ubi, &rename_list);
815 mutex_unlock(&ubi->volumes_mutex);
816 814
817out_free: 815out_free:
818 list_for_each_entry_safe(re, re1, &rename_list, list) { 816 list_for_each_entry_safe(re, re1, &rename_list, list) {
@@ -952,9 +950,9 @@ static long ubi_cdev_ioctl(struct file *file, unsigned int cmd,
952 break; 950 break;
953 } 951 }
954 952
955 mutex_lock(&ubi->mult_mutex); 953 mutex_lock(&ubi->volumes_mutex);
956 err = rename_volumes(ubi, req); 954 err = rename_volumes(ubi, req);
957 mutex_unlock(&ubi->mult_mutex); 955 mutex_unlock(&ubi->volumes_mutex);
958 kfree(req); 956 kfree(req);
959 break; 957 break;
960 } 958 }