diff options
author | David Teigland <teigland@redhat.com> | 2007-01-09 10:44:01 -0500 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2007-02-05 13:36:40 -0500 |
commit | 99fc64874aad1ee0aea5c4d8c07e3529f9d03497 (patch) | |
tree | 46d36b4d11d920e31bbbf04f5d62e676945550e6 /fs | |
parent | 68c817a1c4e21b893672ac73d8a498e6647453aa (diff) |
[DLM] add config entry to enable log_debug
Add a new dlm_config_info field to enable log_debug output and change
log_debug() to use it.
Signed-off-by: David Teigland <teigland@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/dlm/config.c | 4 | ||||
-rw-r--r-- | fs/dlm/config.h | 1 | ||||
-rw-r--r-- | fs/dlm/dlm_internal.h | 13 |
3 files changed, 11 insertions, 7 deletions
diff --git a/fs/dlm/config.c b/fs/dlm/config.c index 958021f91486..7cf20209b127 100644 --- a/fs/dlm/config.c +++ b/fs/dlm/config.c | |||
@@ -775,6 +775,7 @@ int dlm_our_addr(struct sockaddr_storage *addr, int num) | |||
775 | #define DEFAULT_RECOVER_TIMER 5 | 775 | #define DEFAULT_RECOVER_TIMER 5 |
776 | #define DEFAULT_TOSS_SECS 10 | 776 | #define DEFAULT_TOSS_SECS 10 |
777 | #define DEFAULT_SCAN_SECS 5 | 777 | #define DEFAULT_SCAN_SECS 5 |
778 | #define DEFAULT_LOG_DEBUG 0 | ||
778 | 779 | ||
779 | struct dlm_config_info dlm_config = { | 780 | struct dlm_config_info dlm_config = { |
780 | .ci_tcp_port = DEFAULT_TCP_PORT, | 781 | .ci_tcp_port = DEFAULT_TCP_PORT, |
@@ -784,6 +785,7 @@ struct dlm_config_info dlm_config = { | |||
784 | .ci_dirtbl_size = DEFAULT_DIRTBL_SIZE, | 785 | .ci_dirtbl_size = DEFAULT_DIRTBL_SIZE, |
785 | .ci_recover_timer = DEFAULT_RECOVER_TIMER, | 786 | .ci_recover_timer = DEFAULT_RECOVER_TIMER, |
786 | .ci_toss_secs = DEFAULT_TOSS_SECS, | 787 | .ci_toss_secs = DEFAULT_TOSS_SECS, |
787 | .ci_scan_secs = DEFAULT_SCAN_SECS | 788 | .ci_scan_secs = DEFAULT_SCAN_SECS, |
789 | .ci_log_debug = DEFAULT_LOG_DEBUG | ||
788 | }; | 790 | }; |
789 | 791 | ||
diff --git a/fs/dlm/config.h b/fs/dlm/config.h index ce603e1c3bac..1e978611a96e 100644 --- a/fs/dlm/config.h +++ b/fs/dlm/config.h | |||
@@ -25,6 +25,7 @@ struct dlm_config_info { | |||
25 | int ci_recover_timer; | 25 | int ci_recover_timer; |
26 | int ci_toss_secs; | 26 | int ci_toss_secs; |
27 | int ci_scan_secs; | 27 | int ci_scan_secs; |
28 | int ci_log_debug; | ||
28 | }; | 29 | }; |
29 | 30 | ||
30 | extern struct dlm_config_info dlm_config; | 31 | extern struct dlm_config_info dlm_config; |
diff --git a/fs/dlm/dlm_internal.h b/fs/dlm/dlm_internal.h index 7185a132a8b5..ee993c5c2307 100644 --- a/fs/dlm/dlm_internal.h +++ b/fs/dlm/dlm_internal.h | |||
@@ -41,6 +41,7 @@ | |||
41 | #include <asm/uaccess.h> | 41 | #include <asm/uaccess.h> |
42 | 42 | ||
43 | #include <linux/dlm.h> | 43 | #include <linux/dlm.h> |
44 | #include "config.h" | ||
44 | 45 | ||
45 | #define DLM_LOCKSPACE_LEN 64 | 46 | #define DLM_LOCKSPACE_LEN 64 |
46 | 47 | ||
@@ -69,12 +70,12 @@ struct dlm_mhandle; | |||
69 | #define log_error(ls, fmt, args...) \ | 70 | #define log_error(ls, fmt, args...) \ |
70 | printk(KERN_ERR "dlm: %s: " fmt "\n", (ls)->ls_name , ##args) | 71 | printk(KERN_ERR "dlm: %s: " fmt "\n", (ls)->ls_name , ##args) |
71 | 72 | ||
72 | #define DLM_LOG_DEBUG | 73 | #define log_debug(ls, fmt, args...) \ |
73 | #ifdef DLM_LOG_DEBUG | 74 | do { \ |
74 | #define log_debug(ls, fmt, args...) log_error(ls, fmt, ##args) | 75 | if (dlm_config.ci_log_debug) \ |
75 | #else | 76 | printk(KERN_DEBUG "dlm: %s: " fmt "\n", \ |
76 | #define log_debug(ls, fmt, args...) | 77 | (ls)->ls_name , ##args); \ |
77 | #endif | 78 | } while (0) |
78 | 79 | ||
79 | #define DLM_ASSERT(x, do) \ | 80 | #define DLM_ASSERT(x, do) \ |
80 | { \ | 81 | { \ |