static int uevent_filter(struct kset *kset, struct kobject *kobj) { struct kobj_type *ktype = get_ktype(kobj); if (ktype == &module_ktype) return 1; return 0; }
static int dev_hotplug_filter(struct kset *kset, struct kobject *kobj) { struct kobj_type *ktype = get_ktype(kobj); if (ktype == &ktype_device) { struct device *dev = to_dev(kobj); if (dev->bus) return 1; } return 0; }
static int block_hotplug(struct kset *kset, struct kobject *kobj, char **envp, int num_envp, char *buffer, int buffer_size) { struct device *dev = NULL; struct kobj_type *ktype = get_ktype(kobj); int length = 0; int i = 0; /* get physical device backing disk or partition */ if (ktype == &ktype_block) { struct gendisk *disk = container_of(kobj, struct gendisk, kobj); dev = disk->driverfs_dev; } else if (ktype == &ktype_part) {
static int block_hotplug(struct kset *kset, struct kobject *kobj, char **envp, int num_envp, char *buffer, int buffer_size) { struct kobj_type *ktype = get_ktype(kobj); struct device *physdev; struct gendisk *disk; struct hd_struct *part; int length = 0; int i = 0; if (ktype == &ktype_block) { disk = container_of(kobj, struct gendisk, kobj); add_hotplug_env_var(envp, num_envp, &i, buffer, buffer_size, &length, "MINOR=%u", disk->first_minor); } else if (ktype == &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 int recovery_button_hotplug_filter(struct kset* kset, struct kobject* kobj) { return get_ktype(kobj) == &ktype_recovery_button; }
static int power_button_hotplug_filter(struct kset* kset, struct kobject* kobj) { return get_ktype(kobj) == &ktype_power_button; }