diff options
author | Michael Marineau <michael.marineau@coreos.com> | 2013-08-11 00:53:45 -0400 |
---|---|---|
committer | Eric Van Hensbergen <ericvh@gmail.com> | 2013-08-26 11:28:22 -0400 |
commit | e0d6cb9cd3a3ac8a3b8e5b22b83c4f8619786f22 (patch) | |
tree | 76e952d480e4f3793308f3c5b554402cf659475d /net | |
parent | b3f8ab4b7953b4719aaa00c22c1de5d9161f57f5 (diff) |
9p: send uevent after adding/removing mount_tag attribute
This driver adds an attribute to the existing virtio device so a CHANGE
event is required in order udev rules to make use of it. The ADD event
happens before this driver is probed and unlike a more typical driver
like a block device there isn't a higher level device to watch for.
Signed-off-by: Michael Marineau <michael.marineau@coreos.com>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/9p/trans_virtio.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c index e1c26b101830..990afab2be1b 100644 --- a/net/9p/trans_virtio.c +++ b/net/9p/trans_virtio.c | |||
@@ -577,6 +577,10 @@ static int p9_virtio_probe(struct virtio_device *vdev) | |||
577 | mutex_lock(&virtio_9p_lock); | 577 | mutex_lock(&virtio_9p_lock); |
578 | list_add_tail(&chan->chan_list, &virtio_chan_list); | 578 | list_add_tail(&chan->chan_list, &virtio_chan_list); |
579 | mutex_unlock(&virtio_9p_lock); | 579 | mutex_unlock(&virtio_9p_lock); |
580 | |||
581 | /* Let udev rules use the new mount_tag attribute. */ | ||
582 | kobject_uevent(&(vdev->dev.kobj), KOBJ_CHANGE); | ||
583 | |||
580 | return 0; | 584 | return 0; |
581 | 585 | ||
582 | out_free_tag: | 586 | out_free_tag: |
@@ -654,6 +658,7 @@ static void p9_virtio_remove(struct virtio_device *vdev) | |||
654 | list_del(&chan->chan_list); | 658 | list_del(&chan->chan_list); |
655 | mutex_unlock(&virtio_9p_lock); | 659 | mutex_unlock(&virtio_9p_lock); |
656 | sysfs_remove_file(&(vdev->dev.kobj), &dev_attr_mount_tag.attr); | 660 | sysfs_remove_file(&(vdev->dev.kobj), &dev_attr_mount_tag.attr); |
661 | kobject_uevent(&(vdev->dev.kobj), KOBJ_CHANGE); | ||
657 | kfree(chan->tag); | 662 | kfree(chan->tag); |
658 | kfree(chan->vc_wq); | 663 | kfree(chan->vc_wq); |
659 | kfree(chan); | 664 | kfree(chan); |