aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/xen-blkback/xenbus.c
diff options
context:
space:
mode:
authorPaul Durrant <pdurrant@amazon.com>2019-12-02 11:41:17 +0000
committerJuergen Gross <jgross@suse.com>2019-12-04 11:35:35 +0100
commit14855954f63608c5622d5eaa964d3872ce5c5514 (patch)
tree47775d38e3f27c12a0464fc877ab9cf5195df050 /drivers/block/xen-blkback/xenbus.c
parentxen/xenbus: reference count registered modules (diff)
downloadlinux-dev-14855954f63608c5622d5eaa964d3872ce5c5514.tar.xz
linux-dev-14855954f63608c5622d5eaa964d3872ce5c5514.zip
xen-blkback: allow module to be cleanly unloaded
Add a module_exit() to perform the necessary clean-up. Signed-off-by: Paul Durrant <pdurrant@amazon.com> Reviewed-by: "Roger Pau Monné" <roger.pau@citrix.com> Reviewed-by: Juergen Gross <jgross@suse.com> Signed-off-by: Juergen Gross <jgross@suse.com>
Diffstat (limited to '')
-rw-r--r--drivers/block/xen-blkback/xenbus.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c
index b90dbcd99c03..e8c5c54e1d26 100644
--- a/drivers/block/xen-blkback/xenbus.c
+++ b/drivers/block/xen-blkback/xenbus.c
@@ -333,6 +333,12 @@ int __init xen_blkif_interface_init(void)
return 0;
}
+void xen_blkif_interface_fini(void)
+{
+ kmem_cache_destroy(xen_blkif_cachep);
+ xen_blkif_cachep = NULL;
+}
+
/*
* sysfs interface for VBD I/O requests
*/
@@ -1122,3 +1128,8 @@ int xen_blkif_xenbus_init(void)
{
return xenbus_register_backend(&xen_blkbk_driver);
}
+
+void xen_blkif_xenbus_fini(void)
+{
+ xenbus_unregister_driver(&xen_blkbk_driver);
+}