xref: /openbmc/linux/fs/ocfs2/dlm/dlmdebug.h (revision b593bce5)
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /* -*- mode: c; c-basic-offset: 8; -*-
3  * vim: noexpandtab sw=8 ts=8 sts=0:
4  *
5  * dlmdebug.h
6  *
7  * Copyright (C) 2008 Oracle.  All rights reserved.
8  */
9 
10 #ifndef DLMDEBUG_H
11 #define DLMDEBUG_H
12 
13 void dlm_print_one_mle(struct dlm_master_list_entry *mle);
14 
15 #ifdef CONFIG_DEBUG_FS
16 
17 struct dlm_debug_ctxt {
18 	struct dentry *debug_state_dentry;
19 	struct dentry *debug_lockres_dentry;
20 	struct dentry *debug_mle_dentry;
21 	struct dentry *debug_purgelist_dentry;
22 };
23 
24 struct debug_lockres {
25 	int dl_len;
26 	char *dl_buf;
27 	struct dlm_ctxt *dl_ctxt;
28 	struct dlm_lock_resource *dl_res;
29 };
30 
31 void dlm_debug_init(struct dlm_ctxt *dlm);
32 void dlm_debug_shutdown(struct dlm_ctxt *dlm);
33 
34 int dlm_create_debugfs_subroot(struct dlm_ctxt *dlm);
35 void dlm_destroy_debugfs_subroot(struct dlm_ctxt *dlm);
36 
37 void dlm_create_debugfs_root(void);
38 void dlm_destroy_debugfs_root(void);
39 
40 #else
41 
42 static inline void dlm_debug_init(struct dlm_ctxt *dlm)
43 {
44 }
45 static inline void dlm_debug_shutdown(struct dlm_ctxt *dlm)
46 {
47 }
48 static inline int dlm_create_debugfs_subroot(struct dlm_ctxt *dlm)
49 {
50 	return 0;
51 }
52 static inline void dlm_destroy_debugfs_subroot(struct dlm_ctxt *dlm)
53 {
54 }
55 static inline void dlm_create_debugfs_root(void)
56 {
57 }
58 static inline void dlm_destroy_debugfs_root(void)
59 {
60 }
61 
62 #endif	/* CONFIG_DEBUG_FS */
63 #endif	/* DLMDEBUG_H */
64