diff options
author | Amit Shah <amit.shah@redhat.com> | 2010-09-02 09:08:30 -0400 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2010-10-21 03:14:03 -0400 |
commit | e062013c7d22e40ee634b818d28fd615db36998e (patch) | |
tree | 375eed8979d6f4c77d5846af89490f624e714db6 /drivers/char/virtio_console.c | |
parent | b353a6b821627053f82b4e7b907e824cb7a6879c (diff) |
virtio: console: Reference counting portdev structs is not needed
Explain in a comment why there's no need to reference-count the portdev
struct: when a device is yanked out, we can't do anything more with it
anyway so just give up doing anything more with the data or the vqs and
exit cleanly.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'drivers/char/virtio_console.c')
-rw-r--r-- | drivers/char/virtio_console.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index 288701ccbf7a..c84486b3e43d 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c | |||
@@ -1738,6 +1738,14 @@ static void virtcons_remove(struct virtio_device *vdev) | |||
1738 | 1738 | ||
1739 | unregister_chrdev(portdev->chr_major, "virtio-portsdev"); | 1739 | unregister_chrdev(portdev->chr_major, "virtio-portsdev"); |
1740 | 1740 | ||
1741 | /* | ||
1742 | * When yanking out a device, we immediately lose the | ||
1743 | * (device-side) queues. So there's no point in keeping the | ||
1744 | * guest side around till we drop our final reference. This | ||
1745 | * also means that any ports which are in an open state will | ||
1746 | * have to just stop using the port, as the vqs are going | ||
1747 | * away. | ||
1748 | */ | ||
1741 | if (use_multiport(portdev)) { | 1749 | if (use_multiport(portdev)) { |
1742 | struct port_buffer *buf; | 1750 | struct port_buffer *buf; |
1743 | unsigned int len; | 1751 | unsigned int len; |