summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi/vmt.c
diff options
context:
space:
mode:
authorGiorgio Dal Molin <iw3gtf@arcor.de>2016-09-26 12:52:32 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2016-09-27 08:15:32 +0200
commitfc428987c867e5731334fe5b01686e7b3deaeefd (patch)
treeeb01050d658d128f8c34fb7481607a38f869cb60 /drivers/mtd/ubi/vmt.c
parent29c844b965ec3d28f0791c6f0ba64882e2ea0ffe (diff)
downloadbarebox-fc428987c867e5731334fe5b01686e7b3deaeefd.tar.gz
barebox-fc428987c867e5731334fe5b01686e7b3deaeefd.tar.xz
mtd: ubi: add API call to rename volumes.
Signed-off-by: Giorgio Dal Molin <iw3gtf@arcor.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/mtd/ubi/vmt.c')
-rw-r--r--drivers/mtd/ubi/vmt.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/mtd/ubi/vmt.c b/drivers/mtd/ubi/vmt.c
index 41b814cf90..ed043646b8 100644
--- a/drivers/mtd/ubi/vmt.c
+++ b/drivers/mtd/ubi/vmt.c
@@ -411,6 +411,9 @@ int ubi_rename_volumes(struct ubi_device *ubi, struct list_head *rename_list)
vol->name_len = re->new_name_len;
memcpy(vol->name, re->new_name, re->new_name_len + 1);
+ free(vol->cdev.name);
+ vol->cdev.name = basprintf("%s.%s", ubi->cdev.name, vol->name);
+ vol->cdev.size = vol->used_bytes;
ubi_volume_notify(ubi, vol, UBI_VOLUME_RENAMED);
}
}