diff options
Diffstat (limited to 'fs/ocfs2/dlm/dlmdomain.c')
-rw-r--r-- | fs/ocfs2/dlm/dlmdomain.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/fs/ocfs2/dlm/dlmdomain.c b/fs/ocfs2/dlm/dlmdomain.c index 4f7695c851ed..c137d693cef3 100644 --- a/fs/ocfs2/dlm/dlmdomain.c +++ b/fs/ocfs2/dlm/dlmdomain.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <linux/spinlock.h> | 33 | #include <linux/spinlock.h> |
34 | #include <linux/delay.h> | 34 | #include <linux/delay.h> |
35 | #include <linux/err.h> | 35 | #include <linux/err.h> |
36 | #include <linux/debugfs.h> | ||
36 | 37 | ||
37 | #include "cluster/heartbeat.h" | 38 | #include "cluster/heartbeat.h" |
38 | #include "cluster/nodemanager.h" | 39 | #include "cluster/nodemanager.h" |
@@ -40,8 +41,8 @@ | |||
40 | 41 | ||
41 | #include "dlmapi.h" | 42 | #include "dlmapi.h" |
42 | #include "dlmcommon.h" | 43 | #include "dlmcommon.h" |
43 | |||
44 | #include "dlmdomain.h" | 44 | #include "dlmdomain.h" |
45 | #include "dlmdebug.h" | ||
45 | 46 | ||
46 | #include "dlmver.h" | 47 | #include "dlmver.h" |
47 | 48 | ||
@@ -298,6 +299,8 @@ static int dlm_wait_on_domain_helper(const char *domain) | |||
298 | 299 | ||
299 | static void dlm_free_ctxt_mem(struct dlm_ctxt *dlm) | 300 | static void dlm_free_ctxt_mem(struct dlm_ctxt *dlm) |
300 | { | 301 | { |
302 | dlm_destroy_debugfs_subroot(dlm); | ||
303 | |||
301 | if (dlm->lockres_hash) | 304 | if (dlm->lockres_hash) |
302 | dlm_free_pagevec((void **)dlm->lockres_hash, DLM_HASH_PAGES); | 305 | dlm_free_pagevec((void **)dlm->lockres_hash, DLM_HASH_PAGES); |
303 | 306 | ||
@@ -1494,6 +1497,7 @@ static struct dlm_ctxt *dlm_alloc_ctxt(const char *domain, | |||
1494 | u32 key) | 1497 | u32 key) |
1495 | { | 1498 | { |
1496 | int i; | 1499 | int i; |
1500 | int ret; | ||
1497 | struct dlm_ctxt *dlm = NULL; | 1501 | struct dlm_ctxt *dlm = NULL; |
1498 | 1502 | ||
1499 | dlm = kzalloc(sizeof(*dlm), GFP_KERNEL); | 1503 | dlm = kzalloc(sizeof(*dlm), GFP_KERNEL); |
@@ -1526,6 +1530,15 @@ static struct dlm_ctxt *dlm_alloc_ctxt(const char *domain, | |||
1526 | dlm->key = key; | 1530 | dlm->key = key; |
1527 | dlm->node_num = o2nm_this_node(); | 1531 | dlm->node_num = o2nm_this_node(); |
1528 | 1532 | ||
1533 | ret = dlm_create_debugfs_subroot(dlm); | ||
1534 | if (ret < 0) { | ||
1535 | dlm_free_pagevec((void **)dlm->lockres_hash, DLM_HASH_PAGES); | ||
1536 | kfree(dlm->name); | ||
1537 | kfree(dlm); | ||
1538 | dlm = NULL; | ||
1539 | goto leave; | ||
1540 | } | ||
1541 | |||
1529 | spin_lock_init(&dlm->spinlock); | 1542 | spin_lock_init(&dlm->spinlock); |
1530 | spin_lock_init(&dlm->master_lock); | 1543 | spin_lock_init(&dlm->master_lock); |
1531 | spin_lock_init(&dlm->ast_lock); | 1544 | spin_lock_init(&dlm->ast_lock); |
@@ -1851,8 +1864,13 @@ static int __init dlm_init(void) | |||
1851 | goto error; | 1864 | goto error; |
1852 | } | 1865 | } |
1853 | 1866 | ||
1867 | status = dlm_create_debugfs_root(); | ||
1868 | if (status) | ||
1869 | goto error; | ||
1870 | |||
1854 | return 0; | 1871 | return 0; |
1855 | error: | 1872 | error: |
1873 | dlm_unregister_net_handlers(); | ||
1856 | dlm_destroy_lock_cache(); | 1874 | dlm_destroy_lock_cache(); |
1857 | dlm_destroy_master_caches(); | 1875 | dlm_destroy_master_caches(); |
1858 | dlm_destroy_mle_cache(); | 1876 | dlm_destroy_mle_cache(); |
@@ -1861,6 +1879,7 @@ error: | |||
1861 | 1879 | ||
1862 | static void __exit dlm_exit (void) | 1880 | static void __exit dlm_exit (void) |
1863 | { | 1881 | { |
1882 | dlm_destroy_debugfs_root(); | ||
1864 | dlm_unregister_net_handlers(); | 1883 | dlm_unregister_net_handlers(); |
1865 | dlm_destroy_lock_cache(); | 1884 | dlm_destroy_lock_cache(); |
1866 | dlm_destroy_master_caches(); | 1885 | dlm_destroy_master_caches(); |