From 9f961b57568960a150cc9781c52824c9093a0514 Mon Sep 17 00:00:00 2001 From: Artem Bityutskiy Date: Sun, 16 Dec 2007 16:59:31 +0200 Subject: UBI: add UBI control device This patch is a preparation to make UBI devices dynamic. It adds an UBI control device which has dynamically allocated major number and registers itself as "ubi_ctrl". It does not do anything so far. The idea is that this device will allow to attach/detach MTD devices from userspace. This is symilar to what the Linux device mapper has. The next things to do are: * Fix UBI, because it now assumes UBI devices cannot go away * Implement control device ioctls which will attach/detach MTD devices Signed-off-by: Artem Bityutskiy --- drivers/mtd/ubi/cdev.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'drivers/mtd/ubi/cdev.c') diff --git a/drivers/mtd/ubi/cdev.c b/drivers/mtd/ubi/cdev.c index 22c15a388f2..bc900d24cdb 100644 --- a/drivers/mtd/ubi/cdev.c +++ b/drivers/mtd/ubi/cdev.c @@ -28,6 +28,11 @@ * * Major and minor numbers are assigned dynamically to both UBI and volume * character devices. + * + * Well, there is the third kind of character devices - the UBI control + * character device, which allows to manipulate by UBI devices - create and + * delete them. In other words, it is used for attaching and detaching MTD + * devices. */ #include @@ -693,6 +698,11 @@ static int ubi_cdev_ioctl(struct inode *inode, struct file *file, return err; } +/* UBI control character device operations */ +struct file_operations ubi_ctrl_cdev_operations = { + .owner = THIS_MODULE, +}; + /* UBI character device operations */ struct file_operations ubi_cdev_operations = { .owner = THIS_MODULE, -- cgit v1.2.3