Commit 8d690346 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

block: add /sbin/hotplug support for when block devices are created and destroyed.

parent 91c17143
...@@ -525,9 +525,21 @@ static struct kobj_type ktype_block = { ...@@ -525,9 +525,21 @@ static struct kobj_type ktype_block = {
.default_attrs = default_attrs, .default_attrs = default_attrs,
}; };
extern struct kobj_type ktype_part;
static int block_hotplug_filter(struct kset *kset, struct kobject *kobj)
{
struct kobj_type *ktype = get_ktype(kobj);
return ((ktype == &ktype_block) || (ktype == &ktype_part));
}
static struct kset_hotplug_ops block_hotplug_ops = {
.filter = block_hotplug_filter,
};
/* declare block_subsys. */ /* declare block_subsys. */
static decl_subsys(block,&ktype_block); static decl_subsys(block, &ktype_block, &block_hotplug_ops);
struct gendisk *alloc_disk(int minors) struct gendisk *alloc_disk(int minors)
......
...@@ -248,7 +248,7 @@ static struct attribute * default_attrs[] = { ...@@ -248,7 +248,7 @@ static struct attribute * default_attrs[] = {
extern struct subsystem block_subsys; extern struct subsystem block_subsys;
static struct kobj_type ktype_part = { struct kobj_type ktype_part = {
.default_attrs = default_attrs, .default_attrs = default_attrs,
.sysfs_ops = &part_sysfs_ops, .sysfs_ops = &part_sysfs_ops,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment