@@ -1097,8 +1097,21 @@ static void disk_release(struct device *dev)
free_part_info(&disk->part0);
kfree(disk);
}
+
+static int block_uevent(struct device *dev, struct kobj_uevent_env *env)
+{
+ struct gendisk *disk = dev_to_disk(dev);
+
+ if (!disk->fops)
+ return 0;
+ if (disk->fops->uevent)
+ return disk->fops->uevent(disk, env);
+ return 0;
+}
+
struct class block_class = {
.name = "block",
+ .dev_uevent = block_uevent,
};
static char *block_devnode(struct device *dev, mode_t *mode)
@@ -2682,11 +2682,17 @@ void dm_free_md_mempools(struct dm_md_mempools *pools)
kfree(pools);
}
+static int dm_uevent(struct gendisk *disk, struct kobj_uevent_env *env)
+{
+ return add_uevent_var(env, "COOKIE_MONSTER=1");
+}
+
static const struct block_device_operations dm_blk_dops = {
.open = dm_blk_open,
.release = dm_blk_close,
.ioctl = dm_blk_ioctl,
.getgeo = dm_blk_getgeo,
+ .uevent = dm_uevent,
.owner = THIS_MODULE
};
@@ -1300,6 +1300,7 @@ struct block_device_operations {
void **, unsigned long *);
unsigned int (*check_events) (struct gendisk *disk,
unsigned int clearing);
+ int (*uevent) (struct gendisk *, struct kobj_uevent_env *env);
/* ->media_changed() is DEPRECATED, use ->check_events() instead */
int (*media_changed) (struct gendisk *);
void (*unlock_native_capacity) (struct gendisk *);