aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/dlm/dlmdomain.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ocfs2/dlm/dlmdomain.c')
-rw-r--r--fs/ocfs2/dlm/dlmdomain.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/fs/ocfs2/dlm/dlmdomain.c b/fs/ocfs2/dlm/dlmdomain.c
index 2ce620742f9e..b092364d0d52 100644
--- a/fs/ocfs2/dlm/dlmdomain.c
+++ b/fs/ocfs2/dlm/dlmdomain.c
@@ -1818,21 +1818,41 @@ static int __init dlm_init(void)
1818 status = dlm_init_mle_cache(); 1818 status = dlm_init_mle_cache();
1819 if (status) { 1819 if (status) {
1820 mlog(ML_ERROR, "Could not create o2dlm_mle slabcache\n"); 1820 mlog(ML_ERROR, "Could not create o2dlm_mle slabcache\n");
1821 return -1; 1821 goto error;
1822 }
1823
1824 status = dlm_init_master_caches();
1825 if (status) {
1826 mlog(ML_ERROR, "Could not create o2dlm_lockres and "
1827 "o2dlm_lockname slabcaches\n");
1828 goto error;
1829 }
1830
1831 status = dlm_init_lock_cache();
1832 if (status) {
1833 mlog(ML_ERROR, "Count not create o2dlm_lock slabcache\n");
1834 goto error;
1822 } 1835 }
1823 1836
1824 status = dlm_register_net_handlers(); 1837 status = dlm_register_net_handlers();
1825 if (status) { 1838 if (status) {
1826 dlm_destroy_mle_cache(); 1839 mlog(ML_ERROR, "Unable to register network handlers\n");
1827 return -1; 1840 goto error;
1828 } 1841 }
1829 1842
1830 return 0; 1843 return 0;
1844error:
1845 dlm_destroy_lock_cache();
1846 dlm_destroy_master_caches();
1847 dlm_destroy_mle_cache();
1848 return -1;
1831} 1849}
1832 1850
1833static void __exit dlm_exit (void) 1851static void __exit dlm_exit (void)
1834{ 1852{
1835 dlm_unregister_net_handlers(); 1853 dlm_unregister_net_handlers();
1854 dlm_destroy_lock_cache();
1855 dlm_destroy_master_caches();
1836 dlm_destroy_mle_cache(); 1856 dlm_destroy_mle_cache();
1837} 1857}
1838 1858