dm: allow autoloading of dm mod
authorPeter Rajnoha <prajnoha@redhat.com>
Thu, 12 Aug 2010 03:14:05 +0000 (04:14 +0100)
committerAlasdair G Kergon <agk@redhat.com>
Thu, 12 Aug 2010 03:14:05 +0000 (04:14 +0100)
Add devname:mapper/control and MAPPER_CTRL_MINOR module alias
to support dm-mod module autoloading.

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Peter Rajnoha <prajnoha@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Documentation/devices.txt
drivers/md/dm-ioctl.c
include/linux/dm-ioctl.h
include/linux/miscdevice.h

index f2da781705b20ce3b4bf0b2f60daff546beec177..d0d1df6cb5dea8687af070c246898007d018614f 100644 (file)
@@ -445,6 +445,7 @@ Your cooperation is appreciated.
                233 = /dev/kmview       View-OS A process with a view
                234 = /dev/btrfs-control        Btrfs control device
                235 = /dev/autofs       Autofs control device
+               236 = /dev/mapper/control       Device-Mapper control device
                240-254                 Reserved for local use
                255                     Reserved for MISC_DYNAMIC_MINOR
 
index 4d4ced8e43070ac8cb3408ec2928171831b10049..3e39193e5036e709665e08345ba242d83662c606 100644 (file)
@@ -1599,12 +1599,15 @@ static const struct file_operations _ctl_fops = {
 };
 
 static struct miscdevice _dm_misc = {
-       .minor          = MISC_DYNAMIC_MINOR,
+       .minor          = MAPPER_CTRL_MINOR,
        .name           = DM_NAME,
-       .nodename       = "mapper/control",
+       .nodename       = DM_DIR "/" DM_CONTROL_NODE,
        .fops           = &_ctl_fops
 };
 
+MODULE_ALIAS_MISCDEV(MAPPER_CTRL_MINOR);
+MODULE_ALIAS("devname:" DM_DIR "/" DM_CONTROL_NODE);
+
 /*
  * Create misc character device and link to DM_DIR/control.
  */
index 43b2de17449b5ed8fda18b94b84cf402109ec066..49eab360d5d487395c7abefd700ffe294913495c 100644 (file)
@@ -11,6 +11,7 @@
 #include <linux/types.h>
 
 #define DM_DIR "mapper"                /* Slashes not supported */
+#define DM_CONTROL_NODE "control"
 #define DM_MAX_TYPE_NAME 16
 #define DM_NAME_LEN 128
 #define DM_UUID_LEN 129
index f6c9b7dcb9fdd77ccf7410e07fb5d89960d26453..bafffc737903971934037fc334f7d4158d9eda48 100644 (file)
@@ -38,6 +38,7 @@
 #define KVM_MINOR              232
 #define BTRFS_MINOR            234
 #define AUTOFS_MINOR           235
+#define MAPPER_CTRL_MINOR      236
 #define MISC_DYNAMIC_MINOR     255
 
 struct device;