diff options
author | Zhilong Liu <zlliu@suse.com> | 2016-06-20 00:52:46 -0400 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2016-06-21 10:04:24 -0400 |
commit | 505ee5283c3d23220dfbf7630bfc4efdc391e743 (patch) | |
tree | df0138f800d0985a808c53901ad18f1d6f45990d | |
parent | 33688abb2802ff3a230bd2441f765477b94cc89e (diff) |
dlm: add log_info config option
This config option can be used to disable the
LOG_INFO recovery messages.
Signed-off-by: Zhilong Liu <zlliu@suse.com>
Signed-off-by: David Teigland <teigland@redhat.com>
-rw-r--r-- | fs/dlm/config.c | 7 | ||||
-rw-r--r-- | fs/dlm/config.h | 1 | ||||
-rw-r--r-- | fs/dlm/dlm_internal.h | 10 |
3 files changed, 17 insertions, 1 deletions
diff --git a/fs/dlm/config.c b/fs/dlm/config.c index 1669f6291c95..df955d2209ce 100644 --- a/fs/dlm/config.c +++ b/fs/dlm/config.c | |||
@@ -73,6 +73,7 @@ struct dlm_cluster { | |||
73 | unsigned int cl_toss_secs; | 73 | unsigned int cl_toss_secs; |
74 | unsigned int cl_scan_secs; | 74 | unsigned int cl_scan_secs; |
75 | unsigned int cl_log_debug; | 75 | unsigned int cl_log_debug; |
76 | unsigned int cl_log_info; | ||
76 | unsigned int cl_protocol; | 77 | unsigned int cl_protocol; |
77 | unsigned int cl_timewarn_cs; | 78 | unsigned int cl_timewarn_cs; |
78 | unsigned int cl_waitwarn_us; | 79 | unsigned int cl_waitwarn_us; |
@@ -95,6 +96,7 @@ enum { | |||
95 | CLUSTER_ATTR_TOSS_SECS, | 96 | CLUSTER_ATTR_TOSS_SECS, |
96 | CLUSTER_ATTR_SCAN_SECS, | 97 | CLUSTER_ATTR_SCAN_SECS, |
97 | CLUSTER_ATTR_LOG_DEBUG, | 98 | CLUSTER_ATTR_LOG_DEBUG, |
99 | CLUSTER_ATTR_LOG_INFO, | ||
98 | CLUSTER_ATTR_PROTOCOL, | 100 | CLUSTER_ATTR_PROTOCOL, |
99 | CLUSTER_ATTR_TIMEWARN_CS, | 101 | CLUSTER_ATTR_TIMEWARN_CS, |
100 | CLUSTER_ATTR_WAITWARN_US, | 102 | CLUSTER_ATTR_WAITWARN_US, |
@@ -166,6 +168,7 @@ CLUSTER_ATTR(recover_timer, 1); | |||
166 | CLUSTER_ATTR(toss_secs, 1); | 168 | CLUSTER_ATTR(toss_secs, 1); |
167 | CLUSTER_ATTR(scan_secs, 1); | 169 | CLUSTER_ATTR(scan_secs, 1); |
168 | CLUSTER_ATTR(log_debug, 0); | 170 | CLUSTER_ATTR(log_debug, 0); |
171 | CLUSTER_ATTR(log_info, 0); | ||
169 | CLUSTER_ATTR(protocol, 0); | 172 | CLUSTER_ATTR(protocol, 0); |
170 | CLUSTER_ATTR(timewarn_cs, 1); | 173 | CLUSTER_ATTR(timewarn_cs, 1); |
171 | CLUSTER_ATTR(waitwarn_us, 0); | 174 | CLUSTER_ATTR(waitwarn_us, 0); |
@@ -180,6 +183,7 @@ static struct configfs_attribute *cluster_attrs[] = { | |||
180 | [CLUSTER_ATTR_TOSS_SECS] = &cluster_attr_toss_secs, | 183 | [CLUSTER_ATTR_TOSS_SECS] = &cluster_attr_toss_secs, |
181 | [CLUSTER_ATTR_SCAN_SECS] = &cluster_attr_scan_secs, | 184 | [CLUSTER_ATTR_SCAN_SECS] = &cluster_attr_scan_secs, |
182 | [CLUSTER_ATTR_LOG_DEBUG] = &cluster_attr_log_debug, | 185 | [CLUSTER_ATTR_LOG_DEBUG] = &cluster_attr_log_debug, |
186 | [CLUSTER_ATTR_LOG_INFO] = &cluster_attr_log_info, | ||
183 | [CLUSTER_ATTR_PROTOCOL] = &cluster_attr_protocol, | 187 | [CLUSTER_ATTR_PROTOCOL] = &cluster_attr_protocol, |
184 | [CLUSTER_ATTR_TIMEWARN_CS] = &cluster_attr_timewarn_cs, | 188 | [CLUSTER_ATTR_TIMEWARN_CS] = &cluster_attr_timewarn_cs, |
185 | [CLUSTER_ATTR_WAITWARN_US] = &cluster_attr_waitwarn_us, | 189 | [CLUSTER_ATTR_WAITWARN_US] = &cluster_attr_waitwarn_us, |
@@ -365,6 +369,7 @@ static struct config_group *make_cluster(struct config_group *g, | |||
365 | cl->cl_toss_secs = dlm_config.ci_toss_secs; | 369 | cl->cl_toss_secs = dlm_config.ci_toss_secs; |
366 | cl->cl_scan_secs = dlm_config.ci_scan_secs; | 370 | cl->cl_scan_secs = dlm_config.ci_scan_secs; |
367 | cl->cl_log_debug = dlm_config.ci_log_debug; | 371 | cl->cl_log_debug = dlm_config.ci_log_debug; |
372 | cl->cl_log_info = dlm_config.ci_log_info; | ||
368 | cl->cl_protocol = dlm_config.ci_protocol; | 373 | cl->cl_protocol = dlm_config.ci_protocol; |
369 | cl->cl_timewarn_cs = dlm_config.ci_timewarn_cs; | 374 | cl->cl_timewarn_cs = dlm_config.ci_timewarn_cs; |
370 | cl->cl_waitwarn_us = dlm_config.ci_waitwarn_us; | 375 | cl->cl_waitwarn_us = dlm_config.ci_waitwarn_us; |
@@ -850,6 +855,7 @@ int dlm_our_addr(struct sockaddr_storage *addr, int num) | |||
850 | #define DEFAULT_TOSS_SECS 10 | 855 | #define DEFAULT_TOSS_SECS 10 |
851 | #define DEFAULT_SCAN_SECS 5 | 856 | #define DEFAULT_SCAN_SECS 5 |
852 | #define DEFAULT_LOG_DEBUG 0 | 857 | #define DEFAULT_LOG_DEBUG 0 |
858 | #define DEFAULT_LOG_INFO 1 | ||
853 | #define DEFAULT_PROTOCOL 0 | 859 | #define DEFAULT_PROTOCOL 0 |
854 | #define DEFAULT_TIMEWARN_CS 500 /* 5 sec = 500 centiseconds */ | 860 | #define DEFAULT_TIMEWARN_CS 500 /* 5 sec = 500 centiseconds */ |
855 | #define DEFAULT_WAITWARN_US 0 | 861 | #define DEFAULT_WAITWARN_US 0 |
@@ -865,6 +871,7 @@ struct dlm_config_info dlm_config = { | |||
865 | .ci_toss_secs = DEFAULT_TOSS_SECS, | 871 | .ci_toss_secs = DEFAULT_TOSS_SECS, |
866 | .ci_scan_secs = DEFAULT_SCAN_SECS, | 872 | .ci_scan_secs = DEFAULT_SCAN_SECS, |
867 | .ci_log_debug = DEFAULT_LOG_DEBUG, | 873 | .ci_log_debug = DEFAULT_LOG_DEBUG, |
874 | .ci_log_info = DEFAULT_LOG_INFO, | ||
868 | .ci_protocol = DEFAULT_PROTOCOL, | 875 | .ci_protocol = DEFAULT_PROTOCOL, |
869 | .ci_timewarn_cs = DEFAULT_TIMEWARN_CS, | 876 | .ci_timewarn_cs = DEFAULT_TIMEWARN_CS, |
870 | .ci_waitwarn_us = DEFAULT_WAITWARN_US, | 877 | .ci_waitwarn_us = DEFAULT_WAITWARN_US, |
diff --git a/fs/dlm/config.h b/fs/dlm/config.h index f30697bc2780..6041eec886ab 100644 --- a/fs/dlm/config.h +++ b/fs/dlm/config.h | |||
@@ -31,6 +31,7 @@ struct dlm_config_info { | |||
31 | int ci_toss_secs; | 31 | int ci_toss_secs; |
32 | int ci_scan_secs; | 32 | int ci_scan_secs; |
33 | int ci_log_debug; | 33 | int ci_log_debug; |
34 | int ci_log_info; | ||
34 | int ci_protocol; | 35 | int ci_protocol; |
35 | int ci_timewarn_cs; | 36 | int ci_timewarn_cs; |
36 | int ci_waitwarn_us; | 37 | int ci_waitwarn_us; |
diff --git a/fs/dlm/dlm_internal.h b/fs/dlm/dlm_internal.h index 5eff6ea3e27f..216b61604ef9 100644 --- a/fs/dlm/dlm_internal.h +++ b/fs/dlm/dlm_internal.h | |||
@@ -65,8 +65,16 @@ struct dlm_mhandle; | |||
65 | printk(KERN_ERR "dlm: "fmt"\n" , ##args) | 65 | printk(KERN_ERR "dlm: "fmt"\n" , ##args) |
66 | #define log_error(ls, fmt, args...) \ | 66 | #define log_error(ls, fmt, args...) \ |
67 | printk(KERN_ERR "dlm: %s: " fmt "\n", (ls)->ls_name , ##args) | 67 | printk(KERN_ERR "dlm: %s: " fmt "\n", (ls)->ls_name , ##args) |
68 | |||
68 | #define log_rinfo(ls, fmt, args...) \ | 69 | #define log_rinfo(ls, fmt, args...) \ |
69 | printk(KERN_INFO "dlm: %s: " fmt "\n", (ls)->ls_name , ##args); | 70 | do { \ |
71 | if (dlm_config.ci_log_info) \ | ||
72 | printk(KERN_INFO "dlm: %s: " fmt "\n", \ | ||
73 | (ls)->ls_name, ##args); \ | ||
74 | else if (dlm_config.ci_log_debug) \ | ||
75 | printk(KERN_DEBUG "dlm: %s: " fmt "\n", \ | ||
76 | (ls)->ls_name , ##args); \ | ||
77 | } while (0) | ||
70 | 78 | ||
71 | #define log_debug(ls, fmt, args...) \ | 79 | #define log_debug(ls, fmt, args...) \ |
72 | do { \ | 80 | do { \ |