Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux...
[firefly-linux-kernel-4.4.55.git] / drivers / mtd / ubi / cdev.c
index 8ca49f2043e4b8a7fe41109129de5760995b59d4..f54562a5998e74dfb8e24fe5a01be80c375c7508 100644 (file)
@@ -561,6 +561,26 @@ static long vol_cdev_ioctl(struct file *file, unsigned int cmd,
                break;
        }
 
+       /* Create a R/O block device on top of the UBI volume */
+       case UBI_IOCVOLCRBLK:
+       {
+               struct ubi_volume_info vi;
+
+               ubi_get_volume_info(desc, &vi);
+               err = ubiblock_create(&vi);
+               break;
+       }
+
+       /* Remove the R/O block device */
+       case UBI_IOCVOLRMBLK:
+       {
+               struct ubi_volume_info vi;
+
+               ubi_get_volume_info(desc, &vi);
+               err = ubiblock_remove(&vi);
+               break;
+       }
+
        default:
                err = -ENOTTY;
                break;