@@ -34,7 +34,7 @@ struct kobject *block_depr;
static DEFINE_MUTEX(ext_devt_mutex);
static DEFINE_IDR(ext_devt_idr);
-static struct device_type disk_type;
+struct device_type disk_type;
static void disk_check_events(struct disk_events *ev,
unsigned int *clearing_ptr);
@@ -1107,9 +1107,11 @@ static void disk_release(struct device *dev)
blk_put_queue(disk->queue);
kfree(disk);
}
+
struct class block_class = {
.name = "block",
};
+EXPORT_SYMBOL(block_class);
static char *block_devnode(struct device *dev, umode_t *mode,
kuid_t *uid, kgid_t *gid)
@@ -1121,12 +1123,13 @@ static char *block_devnode(struct device *dev, umode_t *mode,
return NULL;
}
-static struct device_type disk_type = {
+struct device_type disk_type = {
.name = "disk",
.groups = disk_attr_groups,
.release = disk_release,
.devnode = block_devnode,
};
+EXPORT_SYMBOL(disk_type);
#ifdef CONFIG_PROC_FS
/*
@@ -22,6 +22,7 @@
#define part_to_dev(part) (&((part)->__dev))
extern struct device_type part_type;
+extern struct device_type disk_type;
extern struct kobject *block_depr;
extern struct class block_class;
Btrfs can make filesystem cross several disks/partitions, in order to load all the disks/partitions which belong to the same filesystem, we need scan the system and find all the devices, and then register them into the kernel. Currently, we do it by user tool. But if we forget to do it, we can not mount the filesystem. So I want btrfs scan the system and find all the devices by itself in the kernel. In order to implement it, we need disk_class and disk_type, so export them. Signed-off-by: Miao Xie <miaox@cn.fujitsu.com> --- block/genhd.c | 7 +++++-- include/linux/genhd.h | 1 + 2 files changed, 6 insertions(+), 2 deletions(-)