diff options
author | Gabriel de Perthuis <g2p.code@gmail.com> | 2013-06-07 17:27:01 -0400 |
---|---|---|
committer | Kent Overstreet <koverstreet@google.com> | 2013-06-27 00:58:05 -0400 |
commit | a25c32bedeff3573b53572b87bcafe10ec5b75a9 (patch) | |
tree | d54f5e8c5beebf9084f89147114932d1261a00c4 | |
parent | bd206b51bca1e0a1c5f4b00218d56213a1f6d3bd (diff) |
bcache: Send a uevent with a cached device's UUID
Signed-off-by: Gabriel de Perthuis <g2p.code@gmail.com>
-rw-r--r-- | drivers/md/bcache/super.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c index 8c73f0c7f28a..a104dad2c7fa 100644 --- a/drivers/md/bcache/super.c +++ b/drivers/md/bcache/super.c | |||
@@ -825,6 +825,11 @@ static void calc_cached_dev_sectors(struct cache_set *c) | |||
825 | void bch_cached_dev_run(struct cached_dev *dc) | 825 | void bch_cached_dev_run(struct cached_dev *dc) |
826 | { | 826 | { |
827 | struct bcache_device *d = &dc->disk; | 827 | struct bcache_device *d = &dc->disk; |
828 | char *env[] = { | ||
829 | "DRIVER=bcache", | ||
830 | kasprintf(GFP_KERNEL, "CACHED_UUID=%pU", dc->sb.uuid), | ||
831 | NULL | ||
832 | }; | ||
828 | 833 | ||
829 | if (atomic_xchg(&dc->running, 1)) | 834 | if (atomic_xchg(&dc->running, 1)) |
830 | return; | 835 | return; |
@@ -841,10 +846,11 @@ void bch_cached_dev_run(struct cached_dev *dc) | |||
841 | 846 | ||
842 | add_disk(d->disk); | 847 | add_disk(d->disk); |
843 | bd_link_disk_holder(dc->bdev, dc->disk.disk); | 848 | bd_link_disk_holder(dc->bdev, dc->disk.disk); |
844 | #if 0 | 849 | /* won't show up in the uevent file, use udevadm monitor -e instead |
845 | char *env[] = { "SYMLINK=label" , NULL }; | 850 | * only class / kset properties are persistent */ |
846 | kobject_uevent_env(&disk_to_dev(d->disk)->kobj, KOBJ_CHANGE, env); | 851 | kobject_uevent_env(&disk_to_dev(d->disk)->kobj, KOBJ_CHANGE, env); |
847 | #endif | 852 | kfree(env[1]); |
853 | |||
848 | if (sysfs_create_link(&d->kobj, &disk_to_dev(d->disk)->kobj, "dev") || | 854 | if (sysfs_create_link(&d->kobj, &disk_to_dev(d->disk)->kobj, "dev") || |
849 | sysfs_create_link(&disk_to_dev(d->disk)->kobj, &d->kobj, "bcache")) | 855 | sysfs_create_link(&disk_to_dev(d->disk)->kobj, &d->kobj, "bcache")) |
850 | pr_debug("error creating sysfs link"); | 856 | pr_debug("error creating sysfs link"); |