ChangeSet 1.1018.1.14, 2003/04/04 17:16:08-08:00, greg@kroah.com block: add /sbin/hotplug support for when block devices are created and destroyed. drivers/block/genhd.c | 14 +++++++++++++- fs/partitions/check.c | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff -Nru a/drivers/block/genhd.c b/drivers/block/genhd.c --- a/drivers/block/genhd.c Mon Apr 7 15:13:12 2003 +++ b/drivers/block/genhd.c Mon Apr 7 15:13:12 2003 @@ -525,9 +525,21 @@ .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. */ -static decl_subsys(block,&ktype_block); +static decl_subsys(block, &ktype_block, &block_hotplug_ops); struct gendisk *alloc_disk(int minors) diff -Nru a/fs/partitions/check.c b/fs/partitions/check.c --- a/fs/partitions/check.c Mon Apr 7 15:13:12 2003 +++ b/fs/partitions/check.c Mon Apr 7 15:13:12 2003 @@ -248,7 +248,7 @@ extern struct subsystem block_subsys; -static struct kobj_type ktype_part = { +struct kobj_type ktype_part = { .default_attrs = default_attrs, .sysfs_ops = &part_sysfs_ops, };