summaryrefslogtreecommitdiff
path: root/drivers/vfio/virqfd.c
diff options
context:
space:
mode:
authorAlex Williamson <alex.williamson@redhat.com>2015-03-17 08:33:38 -0600
committerAlex Williamson <alex.williamson@redhat.com>2015-03-17 08:33:38 -0600
commit71be3423a62be548c56bab5b818e1a1383e659d2 (patch)
treeb2896fa415f72111e8c26a42d2ee822ac701ac67 /drivers/vfio/virqfd.c
parent66fdc052d7dba5bb8386f7a1a38107ba8307a59e (diff)
downloadlwn-71be3423a62be548c56bab5b818e1a1383e659d2.tar.gz
lwn-71be3423a62be548c56bab5b818e1a1383e659d2.zip
vfio: Split virqfd into a separate module for vfio bus drivers
An unintended consequence of commit 42ac9bd18d4f ("vfio: initialize the virqfd workqueue in VFIO generic code") is that the vfio module is renamed to vfio_core so that it can include both vfio and virqfd. That's a user visible change that may break module loading scritps and it imposes eventfd support as a dependency on the core vfio code, which it's really not. virqfd is intended to be provided as a service to vfio bus drivers, so instead of wrapping it into vfio.ko, we can make it a stand-alone module toggled by vfio bus drivers. This has the additional benefit of removing initialization and exit from the core vfio code. Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'drivers/vfio/virqfd.c')
-rw-r--r--drivers/vfio/virqfd.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/vfio/virqfd.c b/drivers/vfio/virqfd.c
index 3d19aaf0e6c9..27c89cd5d70b 100644
--- a/drivers/vfio/virqfd.c
+++ b/drivers/vfio/virqfd.c
@@ -13,12 +13,17 @@
#include <linux/vfio.h>
#include <linux/eventfd.h>
#include <linux/file.h>
+#include <linux/module.h>
#include <linux/slab.h>
+#define DRIVER_VERSION "0.1"
+#define DRIVER_AUTHOR "Alex Williamson <alex.williamson@redhat.com>"
+#define DRIVER_DESC "IRQFD support for VFIO bus drivers"
+
static struct workqueue_struct *vfio_irqfd_cleanup_wq;
static DEFINE_SPINLOCK(virqfd_lock);
-int __init vfio_virqfd_init(void)
+static int __init vfio_virqfd_init(void)
{
vfio_irqfd_cleanup_wq =
create_singlethread_workqueue("vfio-irqfd-cleanup");
@@ -28,7 +33,7 @@ int __init vfio_virqfd_init(void)
return 0;
}
-void vfio_virqfd_exit(void)
+static void __exit vfio_virqfd_exit(void)
{
destroy_workqueue(vfio_irqfd_cleanup_wq);
}
@@ -211,3 +216,11 @@ void vfio_virqfd_disable(struct virqfd **pvirqfd)
flush_workqueue(vfio_irqfd_cleanup_wq);
}
EXPORT_SYMBOL_GPL(vfio_virqfd_disable);
+
+module_init(vfio_virqfd_init);
+module_exit(vfio_virqfd_exit);
+
+MODULE_VERSION(DRIVER_VERSION);
+MODULE_LICENSE("GPL v2");
+MODULE_AUTHOR(DRIVER_AUTHOR);
+MODULE_DESCRIPTION(DRIVER_DESC);