aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/dlm/dlmdomain.c
diff options
context:
space:
mode:
authorSunil Mushran <sunil.mushran@oracle.com>2008-03-10 18:16:22 -0400
committerMark Fasheh <mfasheh@suse.com>2008-04-18 11:56:08 -0400
commit6325b4a22b8f5e40ea9353288b3d6a32181f9718 (patch)
tree3a76692cc5c1c7dfa9d7341ea8b07cb7eb4dadd0 /fs/ocfs2/dlm/dlmdomain.c
parent29576f8bb54045be944ba809d4fca1ad77c94165 (diff)
ocfs2/dlm: Create debugfs dirs
This patch creates the debugfs directories that will hold the files to be used to dump the dlm state. Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com> Signed-off-by: Joel Becker <joel.becker@oracle.com> Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Diffstat (limited to 'fs/ocfs2/dlm/dlmdomain.c')
-rw-r--r--fs/ocfs2/dlm/dlmdomain.c21
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
299static void dlm_free_ctxt_mem(struct dlm_ctxt *dlm) 300static 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;
1855error: 1872error:
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
1862static void __exit dlm_exit (void) 1880static 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();